/**
 * 築心相簿 - Google Photos 風格純淨美學樣式表
 * assets/css/app.css
 */

:root {
    --primary: #cb376d;
    --primary-hover: #b32b5b;
    --primary-bg: #fdf0f5;
    --surface: #f4f6f9;
    --surface-secondary: #ebedf2;
    --surface-variant: #e2e6ed;
    --border: #d0d6e0;
    --border-light: #e4e8ef;
    --text-primary: #1e2329;
    --text-secondary: #586170;
    --text-tertiary: #87909f;
    --header-bg: rgba(244, 246, 249, 0.9);
    --card-bg: #ffffff;
    --card-hover-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.16), 0 10px 20px -4px rgba(15, 23, 42, 0.08);
    --input-bg: #ffffff;
    --input-border: #d0d6e0;
    --modal-bg: #ffffff;
    --danger: #d93025;
    --danger-bg: #fce8e6;
    --success: #1e8e3e;
    --success-bg: #e6f4ea;
    --warning: #f29900;
    --warning-bg: #fef7e0;
    --pill-bg: rgba(15, 23, 42, 0.75);
    --pill-text: #ffffff;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 16px 32px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", sans-serif;
    --header-height: 64px;
    --grid-gap: 16px;
    --color-scheme: light;
}

html[data-theme="light"] {
    --primary: #cb376d;
    --primary-hover: #b32b5b;
    --primary-bg: #fdf0f5;
    --surface: #f4f6f9;
    --surface-secondary: #ebedf2;
    --surface-variant: #e2e6ed;
    --border: #d0d6e0;
    --border-light: #e4e8ef;
    --text-primary: #1e2329;
    --text-secondary: #586170;
    --text-tertiary: #87909f;
    --header-bg: rgba(244, 246, 249, 0.9);
    --card-bg: #ffffff;
    --card-hover-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.16), 0 10px 20px -4px rgba(15, 23, 42, 0.08);
    --input-bg: #ffffff;
    --input-border: #d0d6e0;
    --modal-bg: #ffffff;
    --danger: #d93025;
    --danger-bg: #fce8e6;
    --success: #1e8e3e;
    --success-bg: #e6f4ea;
    --warning: #f29900;
    --warning-bg: #fef7e0;
    --pill-bg: rgba(15, 23, 42, 0.75);
    --pill-text: #ffffff;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 16px 32px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
    --color-scheme: light;
}

html[data-theme="dark"] {
    --primary: #f06292;
    --primary-hover: #f48fb1;
    --primary-bg: rgba(240, 98, 146, 0.16);
    --surface: #141518;
    --surface-secondary: #1c1e23;
    --surface-variant: #25282f;
    --border: #333842;
    --border-light: #25282f;
    --text-primary: #f0f2f5;
    --text-secondary: #a1aab7;
    --text-tertiary: #757f8f;
    --header-bg: rgba(20, 21, 24, 0.92);
    --card-bg: #1c1e23;
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 0 1.5px rgba(240, 98, 146, 0.4);
    --input-bg: #25282f;
    --input-border: #383d47;
    --modal-bg: #1c1e23;
    --danger: #f28b82;
    --danger-bg: rgba(242, 139, 130, 0.16);
    --success: #81c995;
    --success-bg: rgba(129, 201, 149, 0.16);
    --warning: #fdd663;
    --warning-bg: rgba(253, 214, 99, 0.16);
    --pill-bg: rgba(0, 0, 0, 0.85);
    --pill-text: #e8eaed;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.65);
    --color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --primary: #f06292;
        --primary-hover: #f48fb1;
        --primary-bg: rgba(240, 98, 146, 0.16);
        --surface: #141518;
        --surface-secondary: #1c1e23;
        --surface-variant: #25282f;
        --border: #333842;
        --border-light: #25282f;
        --text-primary: #f0f2f5;
        --text-secondary: #a1aab7;
        --text-tertiary: #757f8f;
        --header-bg: rgba(20, 21, 24, 0.92);
        --card-bg: #1c1e23;
        --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 0 1.5px rgba(240, 98, 146, 0.4);
        --input-bg: #25282f;
        --input-border: #383d47;
        --modal-bg: #1c1e23;
        --danger: #f28b82;
        --danger-bg: rgba(242, 139, 130, 0.16);
        --success: #81c995;
        --success-bg: rgba(129, 201, 149, 0.16);
        --warning: #fdd663;
        --warning-bg: rgba(253, 214, 99, 0.16);
        --pill-bg: rgba(0, 0, 0, 0.85);
        --pill-text: #e8eaed;
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
        --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.65);
        --color-scheme: dark;
    }
}

html {
    color-scheme: var(--color-scheme);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--surface);
    background-image: 
        radial-gradient(at 0% 0%, rgba(203, 55, 109, 0.04) 0px, transparent 45%), 
        radial-gradient(at 100% 100%, rgba(203, 55, 109, 0.03) 0px, transparent 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ─── 頂部導覽列 (Google Photos 風格) ─── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.2s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #cb376d, #e04b82);
    color: #fff;
    box-shadow: 0 2px 6px rgba(203, 55, 109, 0.35);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── 通用按鈕元件 ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: transparent;
    user-select: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: var(--surface-variant);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--border);
}

.btn-outline {
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: var(--surface-secondary);
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(217, 48, 37, 0.2);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: #fff;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background-color: var(--surface-variant);
    color: var(--text-primary);
}

/* ─── 主畫面容器 ─── */
.app-container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 80px;
    flex: 1;
}

/* ─── 頁面標頭與麵包屑 ─── */
.view-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.view-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    max-width: 100%;
}

.album-title-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    max-width: 100%;
    min-height: 2.2rem;
}

.album-title-display-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    position: relative;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease;
}

.album-title-h1 {
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    margin: 0;
    padding: 2px 0;
    border-bottom: 2px solid transparent;
    word-break: break-word;
    box-sizing: border-box;
    transition: border-color 0.2s ease, color 0.15s ease;
}

/* 非管理員（一般訪客）狀態：完全普通的靜態文字，不顯示編輯 icon、hover effect 或可編輯提示 */
.album-title-container:not(.is-admin-editable) .album-title-h1 {
    cursor: default;
    user-select: text;
}

.album-title-container:not(.is-admin-editable) .album-title-edit-btn,
.album-title-container:not(.is-admin-editable) .album-title-edit-wrap {
    display: none !important;
}

/* 管理員登入狀態：可點擊原地切換編輯 */
.album-title-container.is-admin-editable .album-title-display-wrap {
    cursor: pointer;
}

.album-title-container.is-admin-editable .album-title-h1 {
    cursor: text;
}

.album-title-container.is-admin-editable .album-title-h1:focus-visible {
    outline: none;
    border-bottom: 2px dashed var(--primary);
}

/* Desktop Hover 效果：低調顯示編輯鉛筆圖示 */
.album-title-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.15s ease, background-color 0.15s ease;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

@media (hover: hover) and (pointer: fine) {
    .album-title-container.is-admin-editable:hover .album-title-edit-btn {
        opacity: 0.85;
        transform: scale(1);
    }
    
    .album-title-container.is-admin-editable .album-title-edit-btn:hover {
        opacity: 1;
        color: var(--primary);
        background-color: var(--primary-bg);
    }
}

/* 原地編輯輸入框 (Google Photos 無邊框底線極簡風格) */
.album-title-edit-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 680px;
    gap: 10px;
}

.album-title-inline-input {
    font-family: inherit;
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary);
    border-radius: 0;
    outline: none;
    box-shadow: none;
    padding: 2px 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.album-title-inline-input:focus {
    border-bottom-color: var(--primary);
    box-shadow: 0 1px 0 0 var(--primary);
}

.album-title-edit-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    pointer-events: none;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.85;
}

/* 已儲存低調徽章 (Saved Badge) */
.album-title-saved-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: var(--success-bg);
    color: var(--success);
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.album-title-saved-badge.show {
    opacity: 1;
    transform: translateY(0);
}

.view-title-group .meta-info {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-variant);
    color: var(--text-secondary);
}

.badge-public {
    background: #e6f4ea;
    color: #137333;
}

.badge-guest {
    background: #fef7e0;
    color: #b06000;
}

.badge-private {
    background: #fce8e6;
    color: #c5221f;
}

/* ─── 一、相簿列表 (Google Photos Album Cards) ─── */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}

.album-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 
        0 1px 3px 0 rgba(15, 23, 42, 0.04),
        0 8px 20px -2px rgba(15, 23, 42, 0.08),
        0 2px 5px -1px rgba(15, 23, 42, 0.03);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), 
                box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), 
                border-color 0.3s ease, 
                background-color 0.25s ease;
    display: flex;
    flex-direction: column;
}

html[data-theme="dark"] .album-card {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.album-card:hover {
    transform: translateY(-8px) scale(1.012);
    box-shadow: 
        0 20px 40px -8px rgba(15, 23, 42, 0.16),
        0 10px 20px -4px rgba(15, 23, 42, 0.08),
        0 1px 3px 0 rgba(15, 23, 42, 0.04);
    border-color: rgba(0, 0, 0, 0.09);
}

html[data-theme="dark"] .album-card:hover {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7), 0 8px 16px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

.album-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: var(--surface-variant);
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .album-cover-wrap {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.album-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.album-card:hover .album-cover-img {
    transform: scale(1.06);
}

.album-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    gap: 8px;
}

.album-photo-count-pill {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.2px;
}

.album-info {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
}

.album-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.album-card:hover .album-title {
    color: var(--primary);
}

.album-date {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.album-desc {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── 二、單一相簿內 Responsive Photo Grid ─── */
.photo-grid-container {
    margin-top: 16px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--grid-gap);
}

@media (min-width: 992px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }
}

.photo-item {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: var(--surface-variant);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 8px -1px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease;
}

html[data-theme="dark"] .photo-item {
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s ease;
}

.photo-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px -3px rgba(15, 23, 42, 0.16), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
    z-index: 2;
}

html[data-theme="dark"] .photo-item:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}

.photo-item:hover img {
    transform: scale(1.06);
}

.photo-item.is-selected {
    transform: scale(0.93);
    box-shadow: 0 0 0 3.5px var(--primary);
}

.photo-item.is-selected img {
    filter: brightness(0.9);
}

.photo-item-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(203, 55, 109, 0.92);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 2;
}

.photo-select-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    padding: 0;
}

.photo-item:hover .photo-select-btn,
.photo-selection-active .photo-select-btn {
    opacity: 0.9;
}

.photo-item.is-selected .photo-select-btn {
    opacity: 1;
    background: var(--primary);
    border-color: #ffffff;
    color: #ffffff;
    transform: scale(1.08);
}

.photo-action-btn-group {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.photo-item:hover .photo-action-btn-group {
    opacity: 1;
}

.photo-selection-active .photo-action-btn-group {
    display: none !important;
}

.photo-mini-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.15s ease;
}

.photo-mini-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* ─── 批次選取浮動工具列 (Batch Action Bar) ─── */
.batch-action-bar {
    position: fixed;
    bottom: -90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), var(--shadow-lg);
    border-radius: var(--radius-xl);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 320px;
    max-width: 92vw;
    transition: bottom 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.batch-action-bar.active {
    bottom: 24px;
    opacity: 1;
    pointer-events: auto;
}

.batch-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-variant);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.batch-close-btn:hover {
    background: var(--border);
    transform: scale(1.05);
}

.batch-selected-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.batch-selected-text strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.batch-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-btn-light {
    border-color: var(--border);
    color: var(--text-primary);
}

/* ─── 拖曳排序 (Drag & Drop Sortable) 樣式 ─── */
.album-card {
    position: relative;
}

.album-drag-handle {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: grab;
    touch-action: none;
    user-select: none;
    z-index: 5;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.album-card:hover .album-drag-handle,
.album-drag-handle:hover,
.album-drag-handle:active {
    opacity: 1;
    transform: scale(1.08);
    background: var(--primary);
    cursor: grabbing;
}

.photo-drag-handle {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: grab;
    touch-action: none;
    user-select: none;
    z-index: 6;
    backdrop-filter: blur(4px);
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.15s ease, background-color 0.2s ease;
}

.photo-drag-handle:hover,
.photo-drag-handle:active {
    opacity: 1;
    transform: scale(1.1);
    background: var(--primary);
    cursor: grabbing;
}

/* 排序中與拖曳虛影 Ghost / Placeholder 樣式 */
.is-dragging {
    opacity: 0.22 !important;
    transform: scale(0.96) !important;
    pointer-events: none !important;
}

.drag-placeholder {
    border: 2.5px dashed var(--primary) !important;
    border-radius: var(--radius-md) !important;
    background: var(--primary-bg) !important;
    opacity: 0.8 !important;
    box-sizing: border-box !important;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.drag-ghost {
    position: fixed !important;
    pointer-events: none !important;
    z-index: 99999 !important;
    opacity: 0.92 !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35) !important;
    transform: scale(1.04) rotate(1.5deg) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
    cursor: grabbing !important;
}

/* 相片排序模式狀態 */
.photo-reorder-active .photo-item {
    cursor: default;
}

.photo-reorder-active .photo-item img {
    pointer-events: none;
}

.photo-reorder-active .photo-select-btn,
.photo-reorder-active .photo-action-btn-group {
    display: none !important;
}

/* 鍵盤輔助與無障礙快速移動操作列 (Accessibility Controls) */
.photo-reorder-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 3px 2px;
    z-index: 6;
}

.photo-reorder-active .photo-reorder-actions {
    display: flex;
}

.photo-reorder-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 3px 5px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
}

.photo-reorder-btn:hover,
.photo-reorder-btn:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.1);
    outline: none;
}

/* 自訂排序模式底部浮動操作列 (Google Photos 風格) */
.reorder-action-bar {
    position: fixed;
    bottom: -90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 1000;
    max-width: 90%;
    width: auto;
    transition: bottom 0.35s cubic-bezier(0.2, 0, 0, 1), transform 0.35s ease;
}

.reorder-action-bar.active {
    bottom: 24px;
}

.reorder-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reorder-grip-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: bold;
}

.reorder-main-text {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.reorder-hint-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.reorder-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 680px) {
    .reorder-action-bar {
        width: calc(100% - 24px);
        padding: 8px 14px;
        gap: 8px;
    }
    .reorder-action-bar.active {
        bottom: 14px;
    }
    .reorder-hint-text {
        display: none;
    }
    .reorder-main-text {
        font-size: 0.88rem;
    }
    .reorder-bar-right .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .batch-action-bar {
        bottom: -100px;
        width: calc(100% - 24px);
        padding: 8px 12px;
        gap: 10px;
    }
    .batch-action-bar.active {
        bottom: 14px;
    }
    .batch-selected-text {
        font-size: 0.86rem;
    }
    .batch-bar-right .btn {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
}

/* ─── 三、全螢幕 Lightbox (原比例檢視、流暢縮放動畫與滑動切換) ─── */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 11, 14, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
    user-select: none;
    touch-action: none;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-topbar {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: #fff;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    pointer-events: auto;
}

.lightbox-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #f0f2f5;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60vw;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lightbox-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.06);
}

.lightbox-viewport {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 16px;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: default;
    transform-origin: center center;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: background-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
    z-index: 5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 768px) {
    .lightbox-nav-btn {
        display: none; /* 手機端採滑動手勢 */
    }
}

.lightbox-bottombar {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0b8c4;
    font-size: 0.85rem;
    font-weight: 500;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    pointer-events: none;
}

/* ─── 四、上傳區塊與進度條 (Drag & Drop) ─── */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-secondary);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 20px;
}

.upload-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.upload-icon {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.upload-progress-container {
    margin-top: 16px;
    display: none;
}

.upload-progress-bar {
    height: 6px;
    width: 100%;
    background: var(--surface-variant);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.2s ease;
}

.upload-progress-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
}

/* ─── 訪客授權與驗證碼外觀 ─── */
.upload-consent-card {
    background: var(--surface-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin: 16px auto 12px;
    max-width: 580px;
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.upload-consent-card.checked {
    border-color: #34a853;
    background: rgba(52, 168, 83, 0.06);
    box-shadow: 0 0 0 1px rgba(52, 168, 83, 0.2);
}

.upload-captcha-card {
    background: var(--surface-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin: 0 auto 16px;
    max-width: 580px;
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.upload-captcha-card.valid {
    border-color: #34a853;
    background: rgba(52, 168, 83, 0.06);
    box-shadow: 0 0 0 1px rgba(52, 168, 83, 0.2);
}

.upload-captcha-card.invalid {
    border-color: #d93025;
    background: rgba(217, 48, 37, 0.05);
}

.upload-gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.25s ease;
}

.upload-gate-badge.locked {
    background: rgba(217, 48, 37, 0.1);
    color: #c5221f;
    border: 1px solid rgba(217, 48, 37, 0.25);
}

.upload-gate-badge.unlocked {
    background: rgba(52, 168, 83, 0.12);
    color: #1e8e3e;
    border: 1px solid rgba(52, 168, 83, 0.3);
}

.upload-picker-zone.locked,
.upload-dropzone.locked {
    border: 2px dashed var(--border) !important;
    background: var(--surface-secondary) !important;
    opacity: 0.88;
    cursor: pointer;
}

.upload-picker-zone.locked .upload-picker-btn {
    background: var(--text-tertiary);
    box-shadow: none;
}

.upload-picker-zone.locked:hover,
.upload-dropzone.locked:hover {
    border-color: var(--danger) !important;
    background: rgba(217, 48, 37, 0.03) !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(217, 48, 37, 0.12) !important;
}

/* ─── 五、Modal 對話框 ─── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--modal-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.2s ease, background-color 0.25s ease;
    border: 1px solid var(--border);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--surface-secondary);
}

/* 表單元件 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text-primary);
    background: var(--input-bg);
    transition: border-color 0.2s ease, background-color 0.25s ease, color 0.25s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* ─── 六、Toast 提示 ─── */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #323232;
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-error {
    background: var(--danger);
}

.toast.toast-success {
    background: #1e8e3e;
}

/* ─── 空狀態與載入中 ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(203, 55, 109, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── 七、深淺色模式切換按鈕 (Theme Toggle Button) ─── */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--surface-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    background: var(--surface-variant);
    color: var(--primary);
    transform: rotate(15deg) scale(1.05);
}

.theme-icon-sun,
.theme-icon-moon {
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* 預設淺色：太陽隱藏，月亮顯示 */
.theme-icon-sun {
    display: none !important;
    color: #fdd663;
}

.theme-icon-moon {
    display: block !important;
    color: var(--text-secondary);
}

/* 深色模式：太陽顯示，月亮隱藏 */
html[data-theme="dark"] .theme-icon-sun {
    display: block !important;
}

html[data-theme="dark"] .theme-icon-moon {
    display: none !important;
}

/* 淺色模式：太陽隱藏，月亮顯示 */
html[data-theme="light"] .theme-icon-sun {
    display: none !important;
}

html[data-theme="light"] .theme-icon-moon {
    display: block !important;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .theme-icon-sun {
        display: block !important;
    }
    html:not([data-theme="light"]) .theme-icon-moon {
        display: none !important;
    }
}

/* ─── 八、更多選項下拉選單 (More Options Dropdown Menu) ─── */
.more-menu-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.more-menu-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.more-menu-btn:hover,
.more-menu-btn[aria-expanded="true"] {
    background: var(--surface-secondary);
    color: var(--primary);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.more-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 195px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 6px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 2px;
    transform-origin: top right;
    animation: dropdownFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html[data-theme="dark"] .more-dropdown-panel {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}

.more-dropdown-panel.show {
    display: flex;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: var(--radius-xs, 6px);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.dropdown-item svg {
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.dropdown-item:hover {
    background: var(--surface-secondary);
    color: var(--primary);
}

.dropdown-item:hover svg {
    color: var(--primary);
}

.dropdown-item.is-active {
    color: var(--primary);
    background: var(--surface-secondary);
    font-weight: 600;
}

.dropdown-item.is-active svg {
    color: var(--primary);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger svg {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background: rgba(234, 67, 53, 0.1);
    color: var(--danger);
}

.dropdown-item-danger:hover svg {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 6px;
}

html[data-theme="dark"] .dropdown-divider {
    background: #334155;
}

@media (max-width: 680px) {
    #admin-top-controls .btn span {
        display: none;
    }
    #admin-top-controls .btn {
        padding: 8px 10px;
    }
    .brand-link {
        font-size: 1.05rem;
    }
    .album-title-h1,
    .album-title-inline-input {
        font-size: 1.35rem;
    }
}

/* ─── 獨立公開投稿頁 (Standalone Public Upload Page) ─────────────────────── */
.upload-page-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.25s ease-out;
}

.upload-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 4px;
    text-decoration: none;
}

.upload-brand-badge svg {
    flex-shrink: 0;
}

.upload-hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.upload-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #34a853);
}

.upload-hero-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.upload-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 6px;
    word-break: break-word;
}

.upload-hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.upload-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.upload-box-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.upload-picker-zone {
    border: 2px dashed var(--primary);
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    padding: 2rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-picker-zone:hover,
.upload-picker-zone.dragover {
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(203, 55, 109, 0.18);
}

.upload-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 12px 24px;
    border-radius: 28px;
    border: none;
    box-shadow: 0 2px 8px rgba(203, 55, 109, 0.35);
    pointer-events: none;
}

.upload-format-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

.upload-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.upload-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.upload-preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-clear-all-btn {
    font-size: 0.82rem;
    color: var(--danger);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}

.upload-clear-all-btn:hover {
    text-decoration: underline;
}

.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 440px) {
    .upload-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.upload-preview-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: zoomIn 0.2s ease-out;
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.upload-preview-remove:hover {
    background: var(--danger);
    transform: scale(1.1);
}

.upload-preview-pill {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 0.72rem;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(4px);
}

.upload-external-actions {
    width: 100%;
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.upload-submit-btn {
    width: 100%;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(203, 55, 109, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(203, 55, 109, 0.45);
}

.upload-submit-btn:active {
    transform: translateY(0);
}

/* ─── 投稿進度條 UI ──────────────────────────────────────────────────────── */
.upload-progress-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-progress-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-progress-track {
    width: 100%;
    height: 12px;
    background: var(--surface-variant);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.upload-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #34a853);
    width: 0%;
    border-radius: 6px;
    transition: width 0.25s ease;
}

.upload-progress-counter {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
}

.upload-progress-warning {
    font-size: 0.86rem;
    color: var(--text-secondary);
    background: var(--surface-secondary);
    padding: 8px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ─── 投稿結果視圖 (成功 / 部分失敗 / 關閉) ────────────────────────────── */
.upload-status-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-status-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 4px;
}

.upload-status-icon-success {
    background: var(--success-bg);
    color: var(--success);
}

.upload-status-icon-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.upload-status-icon-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.upload-status-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-status-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 480px;
}

.upload-failed-list {
    width: 100%;
    text-align: left;
    background: var(--danger-bg);
    border: 1px solid rgba(217, 48, 37, 0.2);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
}

.upload-failed-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid rgba(217, 48, 37, 0.15);
    padding-bottom: 6px;
}

.upload-failed-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.upload-failed-filename {
    font-weight: 600;
    color: var(--text-primary);
    font-family: monospace;
}

.upload-failed-reason {
    color: var(--danger);
    font-size: 0.82rem;
}

.upload-status-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin-top: 10px;
}

@media (min-width: 480px) {
    .upload-status-actions {
        flex-direction: row;
        justify-content: center;
    }
    .upload-status-actions .btn {
        flex: 1;
        max-width: 220px;
    }
}

/* ─── QR Code Modal 專用樣式 ─────────────────────────────────────────── */
.qrcode-canvas-wrapper {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.qrcode-canvas-wrapper canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


