/* ==================== Announcement ==================== */
.announcement-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    max-width: 90%;
}
.announcement-bar:hover {
    background: var(--bg);
}
.announcement-bar svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}
.announcement-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.announcement-new {
    display: inline-block;
    padding: 1px 6px;
    background: #ff3b30;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.02em;
    animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Announcement Modal */
.announcement-modal-content {
    max-width: 520px;
    width: 90%;
}
.announcement-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.7;
    font-size: 0.9375rem;
    color: var(--text-primary);
    padding: 1.25rem;
}
.announcement-modal-body a {
    color: var(--accent);
    text-decoration: underline;
}
.announcement-modal-body a:hover {
    color: var(--accent-hover);
}
.announcement-modal-body code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.announcement-modal-body strong {
    font-weight: 600;
}
.announcement-modal-body em {
    font-style: italic;
}

/* ==================== Apple Minimalist Style ==================== */
:root {
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #aeaeb2;
    --bg: #fbfbfd;
    --card-bg: #ffffff;
    --border: rgba(0, 0, 0, 0.04);
    --border-hover: rgba(0, 0, 0, 0.08);
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --green: #34c759;
    --red: #ff3b30;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
}

/* ==================== Container ==================== */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 4.5rem 1.5rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== Header ==================== */
.header {
    text-align: left;
    margin-bottom: 3.5rem;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.header-main .back-link {
    position: absolute;
    left: 0;
}

.header-main h1 {
    text-align: center;
}

.header-home {
    justify-content: space-between;
}

.header-center {
    text-align: center;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 980px;
    transition: background 0.2s;
}

.user-name:hover {
    background: rgba(0, 0, 0, 0.04);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
}

.btn-sm svg {
    margin-right: 0.25rem;
}

/* ==================== Upload Area ==================== */
.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    background: var(--card-bg);
    border: 1.5px dashed var(--border-hover);
    border-radius: var(--radius);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(0, 113, 227, 0.02);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(0, 113, 227, 0.04);
    transform: scale(1.01);
}

.upload-icon {
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    transition: color 0.25s;
}

.upload-area:hover .upload-icon {
    color: var(--accent);
}

.upload-text {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.upload-sub {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ==================== Progress ==================== */
.upload-progress-container {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-progress-item {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.upload-progress-item.error {
    background: rgba(255, 59, 48, 0.04);
    border: 1px solid rgba(255, 59, 48, 0.15);
}

.progress-file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.625rem;
}

.progress-file-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-file-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.upload-progress-item.error .progress-file-status {
    color: var(--red);
    font-weight: 500;
}

.progress-bar {
    height: 3px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-item.error .progress-fill {
    background: var(--red);
}

/* Legacy single progress (kept for compatibility) */
.upload-progress {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-top: 0.75rem;
    box-shadow: var(--shadow);
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* ==================== Results ==================== */
.results-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.results-header h2 {
    font-size: 1.0625rem;
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ==================== Result Items ==================== */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.875rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.result-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.result-preview {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.04);
}

.result-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.375rem;
}

.size-info {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 400;
}

.compress-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--green);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 4px;
    margin-left: 0.375rem;
}

.result-url {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.result-url input {
    flex: 1;
    min-width: 0;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    font-size: 0.6875rem;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    background: var(--card-bg);
    color: var(--text-secondary);
    outline: none;
}

.result-url input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

/* ==================== File Result Card (New Style) ==================== */
.file-result-item {
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.file-result-item:hover {
    background: transparent;
}

.file-result-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    width: 100%;
}

.file-result-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-color: var(--border-hover);
}

.file-result-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.file-icon-emoji {
    font-size: 1.75rem;
    line-height: 1;
}

.file-ext-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 1px 4px;
    border-radius: 3px;
}

.file-result-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
}

.file-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.file-result-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.file-result-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.file-result-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.file-result-url {
    flex: 1;
    min-width: 200px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.file-result-url input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-hover);
    border-radius: 8px;
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    background: var(--bg);
    color: var(--text-secondary);
    outline: none;
    transition: all 0.2s;
}

.file-result-url input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.file-result-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--border-hover);
    white-space: nowrap;
}

.file-result-view-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.file-result-view-btn svg {
    width: 14px;
    height: 14px;
}

.file-result-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: #fff;
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--border-hover);
    white-space: nowrap;
    cursor: pointer;
}

.file-result-settings-btn:hover {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.file-result-settings-btn svg {
    width: 14px;
    height: 14px;
}

.file-result-actions-secondary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.file-result-actions-secondary .file-result-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-result-actions-secondary .file-result-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==================== Copy Format Menu ==================== */
.copy-format-menu {
    position: fixed;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    z-index: 10000;
    min-width: 280px;
    max-width: 90vw;
    overflow: hidden;
    animation: copyMenuIn 0.15s ease;
}

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

.copy-format-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.copy-format-item:last-child {
    border-bottom: none;
}

.copy-format-item:hover {
    background: var(--bg);
}

.copy-format-item:active {
    background: rgba(0, 113, 227, 0.08);
}

.copy-format-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 72px;
    flex-shrink: 0;
}

.copy-format-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* 简洁版菜单（复制全部按钮用，不显示预览） */
.copy-format-menu-simple .copy-format-item {
    justify-content: center;
    padding: 10px 16px;
}

.copy-format-menu-simple .copy-format-label {
    flex: none;
}

/* ==================== File Settings Modal ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}
.announcement-modal-content {
    max-width: 680px !important;
}

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

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

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

.preset-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-primary);
}

.preset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.preset-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.custom-input {
    display: flex;
    gap: 8px;
}

.custom-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
}

.custom-input input:focus {
    border-color: var(--accent);
}

.custom-input select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    outline: none;
}

.hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.switch-label {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.2s;
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .slider {
    background: var(--accent);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.btn-secondary {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-primary);
}

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

/* Responsive: stack on small screens */
@media (max-width: 480px) {
    .file-result-card {
        flex-direction: column;
        gap: 0.875rem;
    }
    
    .file-result-icon {
        width: 100%;
        height: 48px;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .file-icon-emoji {
        font-size: 1.25rem;
    }
    
    .file-result-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .file-result-url {
        min-width: 0;
    }
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 980px;
    font-size: 0.8125rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==================== User Page ==================== */
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.back-link:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.profile-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0071e3 0%, #00c7be 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--bg);
    border-radius: 980px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.profile-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.profile-id-badge {
    font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.settings-section {
    margin-top: 1.5rem;
}
.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.settings-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}
.settings-item:last-child { border-bottom: none; }
.settings-label { font-size: 0.875rem; color: var(--text-secondary); }
.settings-value { font-size: 0.875rem; color: var(--text-primary); font-weight: 500; }

.actions-section {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.actions-section .btn { flex: 1; text-align: center; min-width: 100px; }

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.75rem;
    pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-meta {
    color: rgba(255,255,255,0.9);
    font-size: 0.6875rem;
    margin-bottom: 0.5rem;
}

.gallery-actions {
    display: flex;
    gap: 0.5rem;
    pointer-events: auto;
    justify-content: flex-end;
}

.gallery-actions .btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
}

.gallery-actions .btn-icon:hover {
    background: rgba(255,255,255,0.3);
}

.gallery-actions .btn-icon.btn-danger:hover {
    background: var(--red);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    background: var(--bg);
    transition: all 0.2s;
}

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

.page-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== User Lightbox ==================== */
.user-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.user-lightbox.active { display: flex; opacity: 1; }

.user-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.95);
}

.user-lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.user-lightbox-container {
    max-width: 90vw;
    max-height: calc(90vh - 80px);
    position: relative;
    overflow: visible;
    cursor: default;
}

.user-lightbox-wrapper {
    transition: transform 0.2s ease;
    transform-origin: center center;
}

.user-lightbox-content {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    object-fit: contain;
    border-radius: 8px;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.user-lightbox-content.loaded { opacity: 1; }

.user-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
    z-index: 10;
}
.user-lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.user-lightbox-nav.prev { left: 1rem; }
.user-lightbox-nav.next { right: 1rem; }
.user-lightbox-nav:disabled { opacity: 0.3; cursor: default; }

.user-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}
.user-lightbox-close:hover { background: rgba(255,255,255,0.2); }

.user-lightbox-info {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.95);
    text-align: center;
    max-width: 80vw;
    z-index: 10;
}
.user-lightbox-filename {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-lightbox-meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
}

.user-lightbox-caption {
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 0.75rem;
    font-size: 0.8125rem;
}

/* Zoom hint */
.zoom-hint {
    position: absolute;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: rgba(255,255,255,0.8);
    padding: 0.375rem 0.875rem;
    border-radius: 980px;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}
.user-lightbox.active .zoom-hint {
    opacity: 1;
}

/* ==================== Footer ==================== */
.footer {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    padding: 1.5rem 0 1rem;
    margin-top: 2rem;
}
.footer a {
    color: var(--text-secondary);
    transition: color 0.2s;
}
.footer a:hover {
    color: var(--accent);
}

/* ==================== Index Lightbox ==================== */
.index-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.index-lightbox.active {
    display: flex;
}
.index-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
}
.index-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.index-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== Responsive ==================== */
@media (max-width: 640px) {
    .container {
        padding: 1rem 1rem;
    }

    .header {
        margin-bottom: 2rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header-home {
        flex-wrap: nowrap;
        align-items: center;
        position: relative;
        padding-bottom: 2.8rem;
    }
    .header-home h1 {
        text-align: left;
        font-size: 1.5rem;
        line-height: 1.8;
        flex-shrink: 0;
    }
    .header-user {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    .header-user .storage-selector {
        position: absolute;
        bottom: 0;
        right: 0;
        width: auto;
        order: unset;
    }

    .upload-area {
        padding: 3rem 1.5rem;
    }

    .result-item {
        flex-direction: column;
        align-items: stretch;
    }

    .result-preview {
        width: 100%;
        height: 120px;
    }

    .result-url {
        flex-direction: row;
        width: 100%;
    }
    .result-url input {
        flex: 1;
        min-width: 0;
        box-sizing: border-box;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    .result-url .btn {
        flex-shrink: 0;
        justify-content: center;
    }
}
