/* ===================================
   Japandi Pro 生成器 - 主樣式表
   =================================== */

:root {
    --japandi-bg: #FAF9F6;
    --japandi-text: #1A1A1A;
    --japandi-accent: #A68B67;
    --japandi-grey-box: #F2F2F2;
    --japandi-red: #D9534F;
    --guide-color: #FF0055;
}

body {
    font-family: "Noto Sans TC", sans-serif;
    background-color: #E5E5E5;
    color: var(--japandi-text);
    overflow-x: hidden;
}

.font-serif-tc {
    font-family: "Noto Serif TC", serif;
}

/* --- Step Wizard --- */
.step-section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.step-section.active {
    display: block;
    opacity: 1;
}

/* --- IG Post Container --- */
.post-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
    min-height: 550px;
    align-items: center;
}

.ig-post {
    width: 400px;
    height: 500px;
    min-width: 400px;
    min-height: 500px;
    background-color: var(--japandi-bg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 55px 40px;
    box-sizing: border-box;
    transform-origin: center center;
    transition: transform 0.2s;
    z-index: 1;
}

/* Layers */
.bg-layer {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.bg-overlay {
    position: absolute;
    inset: 0;
    background-color: black;
    opacity: 0;
    transition: opacity 0.3s;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Style Variants */
.ig-post.has-bg {
    color: white;
}

.ig-post.has-bg .text-accent {
    color: #E5D0B1 !important;
}

.ig-post.has-bg .sub-header-box {
    background-color: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(5px);
    color: white !important;
}

.ig-post.layout-bold.has-bg .sub-header-box {
    background-color: transparent !important;
    backdrop-filter: none;
}

@media (max-width: 450px) {
    .ig-post {
        transform: scale(0.8);
    }

    .post-wrapper {
        min-height: 420px;
        margin-bottom: -80px;
    }
}

/* --- Elements --- */
.top-header {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 25px;
    letter-spacing: 0.05em;
    color: inherit;
    width: 100%;
    text-align: center;
    white-space: pre-wrap;
}

.top-header:hover {
    border: 1px dashed #ddd;
}

.sub-header-box {
    background-color: var(--japandi-grey-box);
    width: 100%;
    padding: 18px 20px;
    margin-bottom: 35px;
    font-size: 1.15rem;
    font-weight: 900;
    border-radius: 4px;
    text-align: center;
    line-height: 1.4;
    color: var(--japandi-text);
}

.content-body {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.footer-handle {
    position: absolute !important;
    bottom: 45px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 20;
}

.text-accent {
    color: var(--japandi-accent);
}

.bg-highlight {
    background-color: #fef08a;
    padding: 0 4px;
    color: black;
}

/* --- Layout Overrides --- */
.ig-post.layout-bold .top-header {
    display: none;
}

.ig-post.layout-bold .sub-header-box {
    background: transparent;
    font-size: 1.8rem;
    text-align: left;
    padding: 0;
    margin-bottom: 20px;
}

.ig-post.layout-bold .content-body {
    align-items: flex-start;
    text-align: left;
}

.ig-post.layout-quote .content-body {
    justify-content: center;
    text-align: center;
}

.ig-post.layout-polaroid {
    padding: 0;
    justify-content: center;
    background-color: #f0f0f0;
}

.ig-post.layout-polaroid .bg-layer {
    z-index: -2;
}

.ig-post.layout-polaroid .polaroid-frame {
    background: white;
    padding: 15px 15px 50px 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: rotate(-1deg);
    width: 85%;
}

.ig-post.layout-notion .checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 4px;
    margin-top: 3px;
    flex-shrink: 0;
}

.ig-post.layout-keyword {
    justify-content: center;
    padding: 40px;
}

/* --- Interactive --- */
.moveable {
    position: relative;
    cursor: text;
    transition: outline 0.1s;
    touch-action: none;
    user-select: text;
}

.moveable:hover {
    outline: 1px dashed #ddd;
}

.moveable:focus {
    outline: 2px solid var(--japandi-accent);
    background-color: rgba(166, 139, 103, 0.1);
    border-radius: 4px;
    z-index: 50;
}

body.shift-pressed .moveable {
    cursor: grab !important;
    outline: 1px dashed var(--japandi-accent) !important;
    user-select: none !important;
}

body.shift-pressed .moveable:active {
    cursor: grabbing !important;
}

/* --- Toolbar & Palette --- */
#textToolbar {
    position: absolute;
    background: #2D2D2D;
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    display: none;
    gap: 8px;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-size: 14px;
    flex-wrap: nowrap;
}

#textToolbar button {
    padding: 4px;
    border-radius: 4px;
    color: #ccc;
    transition: all 0.2s;
    position: relative;
}

#textToolbar button:hover {
    background: #444;
    color: white;
}

#textToolbar .divider {
    width: 1px;
    height: 16px;
    background: #555;
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid #555;
}

#colorPalette {
    position: absolute;
    top: 100%;
    left: 0;
    background: #2D2D2D;
    padding: 8px;
    border-radius: 8px;
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    width: 140px;
}

#colorPalette.active {
    display: grid;
}

.palette-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.1s;
}

.palette-swatch:hover {
    transform: scale(1.2);
    border-color: white;
}

/* --- Controls Grid Layout --- */
.slide-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.control-btn {
    background: white;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.control-btn:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #d1d5db;
}

.control-btn.btn-svg {
    color: #8B5E3C;
    border-color: #e7e0d8;
    background: #fffcf9;
}

.control-btn.btn-svg:hover {
    background: #faf8f5;
    color: #6d462a;
}

.control-btn.btn-delete {
    color: #D9534F;
    border-color: #fee2e2;
    background: #fff5f5;
}

.control-btn.btn-delete:hover {
    background: #fee2e2;
    color: #991b1b;
}

.adjust-panel {
    background: #fafaf9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    width: 100%;
    display: none;
    font-size: 0.75rem;
}

.adjust-panel.active {
    display: block;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #A68B67;
    cursor: pointer;
    margin-top: -5px;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #d6d3d1;
    border-radius: 2px;
}

select.layout-select {
    width: 100%;
    padding: 6px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #4b5563;
    margin-bottom: 8px;
    background-color: white;
}

/* ===================================
   Full-Width Structure Workspace
   =================================== */

/* Full-Width Structure Workspace (App Mode) */

/* Ensure Step 2 takes full screen */
#step2.step-fullwidth.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 100;
    display: flex;
    /* Hidden by default via JS class, but when active */
    flex-direction: column;
    margin: 0 !important;
    max-width: none !important;
    padding: 0 !important;
}

#step2.step-fullwidth[style*="display: none"] {
    display: none !important;
}

/* Top Toolbar - In Flow */
.top-toolbar {
    position: relative;
    /* Changed from fixed */
    flex: 0 0 auto;
    width: 100%;
    z-index: 50;
    top: auto;
    left: auto;
    border-bottom: 1px solid #e5e5e5;
}

/* Main Workspace - Flex Fill */
.main-workspace {
    display: flex;
    flex: 1;
    height: auto !important;
    /* Override calc */
    min-height: 0;
    /* Align with flex */
    margin-top: 0 !important;
    width: 100%;
    position: relative;
}

/* Fix Preview Container overflow */
.preview-container-full {
    flex: 1;
    height: 100%;
    overflow: hidden;
    /* Let internal views handle scroll */
    position: relative;
}

.moveable.is-selected {
    outline: 2px solid #3b82f6 !important;
    cursor: move;
    z-index: 40;
}

.guide-line {
    position: absolute;
    background-color: #ef4444;
    z-index: 50;
    pointer-events: none;
    display: none;
}

.guide-v {
    top: 0;
    bottom: 0;
    width: 1px;
    left: 50%;
}

.guide-h {
    left: 0;
    right: 0;
    height: 1px;
    top: 50%;
}

/* --- End Interaction Styles --- */

.picker-sidebar {
    width: 220px;
    background: white;
    border-left: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s, opacity 0.3s;
    overflow: hidden;
}

.picker-sidebar.hidden {
    width: 0;
    opacity: 0;
    border-left: none;
}

.picker-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #57534e;
    border-bottom: 1px solid #f5f5f4;
    flex-shrink: 0;
}

.picker-header span {
    flex: 1;
}

.picker-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #a8a29e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker-close:hover {
    background: #f5f5f4;
    color: #292524;
}

.picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    align-content: start;
}

.preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.preset-btn.preset-edu {
    background: #dbeafe;
    color: #1d4ed8;
}

.preset-btn.preset-edu:hover {
    background: #bfdbfe;
}

.preset-btn.preset-story {
    background: #f3e8ff;
    color: #7c3aed;
}

.preset-btn.preset-story:hover {
    background: #e9d5ff;
}

.preset-btn.preset-list {
    background: #dcfce7;
    color: #15803d;
}

.preset-btn.preset-list:hover {
    background: #bbf7d0;
}

.preset-btn.preset-article {
    background: #f3f4f6;
    color: #4b5563;
}

.preset-btn.preset-article:hover {
    background: #e5e7eb;
}

.preset-btn.preset-photo {
    background: #FFEDD5;
    color: #C2410C;
}

.preset-btn.preset-photo:hover {
    background: #FED7AA;
}

/* Main Preview Area */
.main-preview {
    background: white;
    border-radius: 16px;
    border: 2px solid #e5e5e5;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.main-preview-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* IG Post Preview (Large) */
.ig-post-preview {
    width: 320px;
    height: 400px;
    background-color: #FAF9F6;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 44px 32px;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 13px;
}

.ig-post-preview .top-header {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
    width: 100%;
    text-align: center;
}

.ig-post-preview .sub-header-box {
    background-color: #F2F2F2;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 28px;
    font-size: 0.95rem;
    font-weight: 900;
    border-radius: 4px;
    text-align: center;
    line-height: 1.4;
}

.ig-post-preview .content-body {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-preview {
    position: absolute;
    bottom: 36px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #78716c;
}

.preview-info {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}

.preview-number {
    background: #292524;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.preview-type {
    color: #78716c;
    font-size: 13px;
    font-weight: 600;
}

/* Navigation Bar */
.nav-bar-wrapper {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    padding: 12px;
    overflow-x: auto;
}

.nav-bar {
    display: flex;
    gap: 10px;
    min-height: 80px;
    align-items: center;
}

.nav-bar.drag-over {
    background: #f5f5f4;
    border-radius: 8px;
}

.nav-thumb {
    flex-shrink: 0;
    cursor: grab;
    transition: all 0.15s;
}

.nav-thumb:hover {
    transform: translateY(-2px);
}

.nav-thumb.active .nav-frame {
    border-color: #a68b67;
    box-shadow: 0 0 0 3px rgba(166, 139, 103, 0.2);
}

.nav-thumb.sortable-ghost {
    opacity: 0.3;
}

.nav-thumb-inner {
    position: relative;
}

.nav-number {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    background: #292524;
    color: white;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.nav-frame {
    width: 60px;
    height: 75px;
    overflow: hidden;
    border-radius: 6px;
    border: 2px solid #e5e5e5;
    background: #FAF9F6;
    transition: all 0.15s;
}

.nav-post {
    width: 400px;
    height: 500px;
}

.nav-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.15s;
    z-index: 5;
}

.nav-thumb:hover .nav-delete {
    opacity: 1;
}

.nav-add-btn {
    width: 60px;
    height: 75px;
    border: 2px dashed #d6d3d1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a8a29e;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.15s;
}

.nav-add-btn:hover {
    border-color: #a68b67;
    color: #a68b67;
    background: #fafaf9;
}

/* Picker Column */
.picker-column {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    padding: 12px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.picker-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #57534e;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f4;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.picker-item {
    cursor: pointer;
    transition: all 0.15s;
    padding: 4px;
    border-radius: 6px;
}

.picker-item:hover {
    background: #f5f5f4;
}

.picker-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.picker-preview {
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
    background: #FAF9F6;
    position: relative;
}

.picker-scale {
    width: 400px;
    height: 500px;
    position: absolute;
    top: 0;
    left: 0;
}

.picker-name {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #78716c;
    margin-top: 4px;
}

/* Mini IG Post (for thumbnails) */
.ig-post-mini {
    width: 400px;
    height: 500px;
    background-color: #FAF9F6;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 55px 40px;
    box-sizing: border-box;
    position: relative;
    font-size: 16px;
}

.ig-post-mini .top-header {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 25px;
    letter-spacing: 0.05em;
    width: 100%;
    text-align: center;
}

.ig-post-mini .sub-header-box {
    background-color: #F2F2F2;
    width: 100%;
    padding: 18px 20px;
    margin-bottom: 35px;
    font-size: 1.15rem;
    font-weight: 900;
    border-radius: 4px;
    text-align: center;
}

.ig-post-mini .content-body {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* ===================================
   Toolbar Row & View Mode Switcher
   =================================== */

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    flex-wrap: wrap;
}

.preset-group {
    display: flex;
    gap: 6px;
}

.view-mode-group {
    display: flex;
    background: #f5f5f4;
    border-radius: 8px;
    padding: 2px;
    margin-left: auto;
}

.view-mode-btn {
    width: 32px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #78716c;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.view-mode-btn:hover {
    color: #292524;
}

.view-mode-btn.active {
    background: white;
    color: #292524;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slide-count {
    font-size: 12px;
    font-weight: 600;
    color: #78716c;
    background: #f5f5f4;
    padding: 4px 10px;
    border-radius: 12px;
}

.clear-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #a8a29e;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.clear-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.confirm-btn {
    background: #292524;
    color: white;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn:hover {
    background: #1c1917;
    transform: translateY(-1px);
}

/* ===================================
   Preview Container (Unified)
   =================================== */

.preview-container,
.preview-container-full {
    background: #f5f5f4;
    min-height: 500px;
    position: relative;
    transition: all 0.2s;
}

.preview-container-full.drag-over {
    background: #fafaf9;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: #d6d3d1;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
}

/* ===================================
   Mode 1: Navigator (底部導覽列)
   =================================== */

.mode-navigator {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f5f5f4;
}

.mode-navigator .nav-main-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: #f5f5f4;
}

.mode-navigator .main-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mode-navigator .nav-bar-wrapper {
    background: white;
    border-top: 1px solid #e5e5e5;
    padding: 12px 16px;
    flex-shrink: 0;
}

.mode-navigator .nav-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

/* ===================================
   Mode 2: Vertical (垂直捲動)
   =================================== */

.mode-vertical {
    height: 100%;
    overflow-y: auto;
    padding: 24px;
}

.vertical-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.vertical-slide {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #fafaf9;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.2s;
    width: 100%;
    max-width: 400px;
}

.vertical-slide:hover {
    border-color: #e5e5e5;
}

.vertical-slide.active {
    border-color: #a68b67;
    background: white;
}

.vertical-slide.sortable-ghost {
    opacity: 0.3;
}

.vertical-number {
    width: 28px;
    height: 28px;
    background: #292524;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: grab;
}

.vertical-post {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ig-post-large {
    width: 280px;
    height: 350px;
    background-color: #FAF9F6;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 38px 28px;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    font-size: 11px;
}

.ig-post-large .top-header {
    font-size: 0.6rem;
    margin-bottom: 16px;
}

.ig-post-large .sub-header-box {
    padding: 10px 14px;
    margin-bottom: 24px;
    font-size: 0.8rem;
}

.footer-large {
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #78716c;
}

.vertical-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.vertical-type {
    font-size: 11px;
    font-weight: 600;
    color: #78716c;
    background: #f5f5f4;
    padding: 4px 8px;
    border-radius: 4px;
}

.vertical-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.vertical-slide:hover .vertical-delete {
    opacity: 1;
}

.vertical-add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: 2px dashed #d6d3d1;
    border-radius: 12px;
    color: #a8a29e;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
}

.vertical-add-btn:hover {
    border-color: #a68b67;
    color: #a68b67;
    background: #fafaf9;
}

/* ===================================
   Mode 3: Grid (網格全覽)
   =================================== */

.mode-grid {
    padding: 20px;
    overflow-y: auto;
    max-height: 600px;
}

.grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.grid-card {
    position: relative;
    cursor: pointer;
    transition: all 0.15s;
}

.grid-card:hover {
    transform: translateY(-2px);
}

.grid-card.active .grid-frame {
    border-color: #a68b67;
    box-shadow: 0 0 0 3px rgba(166, 139, 103, 0.2);
}

.grid-card.sortable-ghost {
    opacity: 0.3;
}

.grid-number {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 20px;
    height: 20px;
    background: #292524;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.grid-frame {
    width: 100px;
    height: 125px;
    overflow: hidden;
    border-radius: 6px;
    border: 2px solid #e5e5e5;
    background: #FAF9F6;
    transition: all 0.15s;
}

.grid-post {
    width: 400px;
    height: 500px;
}

.grid-label {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #78716c;
    margin-top: 4px;
}

.grid-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.15s;
    z-index: 5;
}

.grid-card:hover .grid-delete {
    opacity: 1;
}

.grid-add-btn {
    width: 100px;
    height: 125px;
    border: 2px dashed #d6d3d1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a8a29e;
    font-size: 24px;
    transition: all 0.15s;
}

.grid-add-btn:hover {
    border-color: #a68b67;
    color: #a68b67;
    background: #fafaf9;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 30px;
    background-color: #3b82f6;
    border-radius: 4px;
    cursor: col-resize;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s;
}

.moveable.is-selected .resize-handle {
    opacity: 1;
}

.moveable.is-editing .resize-handle {
    display: none;
}