/* ===== Theme Variables ===== */
:root, [data-theme="midnight"] {
    --bg-app: #0f172a;
    --bg-panel: #1e293b;
    --bg-input: #020617;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --color-primary: #10b981;
    --color-primary-hover: #059669;
    --color-primary-bg: rgba(16, 185, 129, 0.1);
    --color-primary-border: rgba(16, 185, 129, 0.3);
    --color-accent: #f59e0b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    --border-color: #334155;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glass-blur: 12px;
}

[data-theme="aurora"] {
    --bg-app: #0B1021;
    --bg-panel: #131A2E;
    --bg-input: #080D1A;
    --bg-hover: #1E2642;
    --text-primary: #E2E8F0;
    --text-secondary: #8B9DC3;
    --text-muted: #5A6B8A;
    --color-primary: #818CF8;
    --color-primary-hover: #6366F1;
    --color-primary-bg: rgba(129, 140, 248, 0.1);
    --color-primary-border: rgba(129, 140, 248, 0.3);
    --color-accent: #C084FC;
    --color-success: #34D399;
    --color-warning: #FBBF24;
    --color-error: #F87171;
    --color-info: #60A5FA;
    --border-color: #1E2642;
    --border-subtle: rgba(129, 140, 248, 0.1);
    --glass-bg: rgba(19, 26, 46, 0.8);
    --glass-border: rgba(129, 140, 248, 0.15);
    --glass-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.1);
}

[data-theme="daylight"] {
    --bg-app: #f8fafc;
    --bg-panel: #ffffff;
    --bg-input: #f1f5f9;
    --bg-hover: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #94a3b8;
    --color-primary: #059669;
    --color-primary-hover: #047857;
    --color-primary-bg: rgba(5, 150, 105, 0.1);
    --color-primary-border: rgba(5, 150, 105, 0.3);
    --color-accent: #d97706;
    --color-success: #059669;
    --color-warning: #d97706;
    --color-error: #dc2626;
    --color-info: #2563eb;
    --border-color: #e2e8f0;
    --border-subtle: rgba(0, 0, 0, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-tap-highlight-color: rgba(16, 185, 129, 0.2);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-app); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Components ===== */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.5rem 1rem; border-radius: 0.5rem;
    font-weight: 500; transition: all 0.2s; cursor: pointer;
    border: none; outline: none; gap: 0.5rem; font-size: 0.875rem;
    min-height: 44px; min-width: 44px;
}
.btn-primary { background-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background-color: var(--color-primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--color-primary-bg); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background-color: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.btn-secondary:hover { background-color: var(--border-color); }
.btn-secondary:active { transform: scale(0.97); }
.btn-ghost { background-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background-color: var(--bg-hover); color: var(--text-primary); }
.btn-ghost:active { transform: scale(0.97); }
.btn-danger { background-color: rgba(239, 68, 68, 0.15); color: var(--color-error); border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background-color: rgba(239, 68, 68, 0.25); }
.btn-danger:active { transform: scale(0.97); }

.input-field {
    background-color: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: 0.5rem; padding: 0.6rem 1rem;
    color: var(--text-primary); width: 100%; transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out; font-size: 0.875rem;
}
.input-field:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 2px var(--color-primary-bg); }
.input-field::placeholder { color: var(--text-muted); }
.form-error {
    margin-top: 0.35rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid color-mix(in srgb, var(--color-error) 45%, var(--glass-border));
    background: color-mix(in srgb, var(--color-error) 12%, transparent);
    color: var(--color-error);
    font-size: 0.8rem;
    line-height: 1.35;
}

.card { padding: 1.5rem; border-radius: 1rem; }

.badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.6rem; border-radius: 9999px;
    font-size: 0.7rem; font-weight: 600;
}
.badge-success { background: color-mix(in srgb, var(--color-success) 16%, transparent); color: var(--color-success); }
.badge-warning { background: color-mix(in srgb, var(--color-warning) 16%, transparent); color: var(--color-warning); }
.badge-danger { background: color-mix(in srgb, var(--color-error) 16%, transparent); color: var(--color-error); }
.badge-gray { background: var(--bg-hover); color: var(--text-muted); }
.badge-info { background: color-mix(in srgb, var(--color-info) 16%, transparent); color: var(--color-info); }

/* Robot accounts v2 */
.robot-state {
    min-height: 88px; display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    border-block: 1px solid var(--border-color); color: var(--text-secondary); text-align: center; padding: 1.25rem;
}
.robot-state .btn { flex: 0 0 auto; white-space: nowrap; }
.robot-page .btn-primary { background-color: var(--color-primary-hover); }
.robot-page .btn-danger { background-color: color-mix(in srgb, var(--color-error) 20%, var(--bg-panel)); color: var(--text-primary); border-color: var(--color-error); }
.robot-page .badge-success { background: color-mix(in srgb, var(--color-success) 24%, var(--bg-panel)); color: var(--text-primary); }
.robot-page .badge-warning { background: color-mix(in srgb, var(--color-warning) 26%, var(--bg-panel)); color: var(--text-primary); }
.robot-page .badge-gray { color: var(--text-primary); }
.robot-row-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.robot-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.robot-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; max-width: 42rem; }
.robot-terms { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem; border: 1px solid color-mix(in srgb, var(--color-warning) 40%, var(--border-color)); background: color-mix(in srgb, var(--color-warning) 8%, transparent); color: var(--text-secondary); font-size: 0.75rem; }
.robot-auth-dialog { max-height: min(90vh, 760px); overflow-y: auto; border-radius: 0.5rem; }
.robot-auth-dialog .form-label { display: block; margin-bottom: 0.3rem; color: var(--text-secondary); font-size: 0.75rem; }
.robot-captcha { display: grid; gap: 0.75rem; padding: 0.75rem; border: 1px solid var(--border-color); background: var(--bg-input); }
.robot-captcha img { display: block; max-width: 100%; min-height: 44px; margin-inline: auto; object-fit: contain; }
.robot-queue-status { padding: 0.75rem; border: 1px solid color-mix(in srgb, var(--color-info) 40%, var(--border-color)); background: color-mix(in srgb, var(--color-info) 8%, transparent); }
.task-auth-panel { padding: 1rem; border: 1px solid color-mix(in srgb, var(--color-warning) 50%, var(--border-color)); background: color-mix(in srgb, var(--color-warning) 8%, var(--bg-panel)); }
.task-auth-panel .form-label { display: block; color: var(--text-secondary); font-size: 0.75rem; }
.task-auth-countdown { min-width: 4.5rem; padding: 0.35rem 0.55rem; border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-weight: 700; text-align: center; }
.task-auth-dialog { max-height: min(90vh, 720px); overflow-y: auto; border-radius: 0.5rem; }
.task-auth-dialog .form-label { display: block; color: var(--text-secondary); font-size: 0.75rem; }
.task-auth-dialog .btn-primary { background: #047857; color: #fff; }
.task-auth-dialog .btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.robot-wait-optin input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--color-primary); }
.btn:disabled { cursor: not-allowed; opacity: 0.5; transform: none; }
@media (max-width: 640px) {
    .robot-row-main, .robot-terms { align-items: stretch; flex-direction: column; }
    .robot-actions { justify-content: stretch; }
    .robot-actions .btn { flex: 1 1 auto; }
    .robot-auth-dialog { margin: 0.75rem; padding: 1.25rem; }
}

/* Sidebar */
.sidebar-link {
    display: flex; align-items: center;
    padding: 0.65rem 1rem; border-radius: 0.5rem;
    color: var(--text-secondary); text-decoration: none;
    transition: all 0.15s ease-out; gap: 0.75rem; margin-bottom: 0.125rem;
    font-size: 0.875rem; font-weight: 500;
}
.sidebar-link:hover { background-color: var(--bg-hover); color: var(--text-primary); }
.sidebar-link:active { transform: scale(0.98); }
.sidebar-link.active { background-color: var(--color-primary-bg); color: var(--color-primary); border-left: 3px solid var(--color-primary); }

/* Tabs */
.tab-btn {
    padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 500;
    color: var(--text-secondary); transition: all 0.15s ease-out;
    background: transparent; border: none; cursor: pointer; font-size: 0.875rem;
}
.tab-btn.active { background-color: var(--color-primary-bg); color: var(--color-primary); }
.tab-btn:hover:not(.active) { background-color: var(--bg-hover); color: var(--text-primary); }
.tab-btn:active { transform: scale(0.97); }

/* Toast */
.toast-container { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 70; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast {
    min-width: 280px; padding: 0.875rem 1rem; border-radius: 0.75rem;
    background: var(--bg-panel); border: 1px solid var(--glass-border);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    display: flex; align-items: center; gap: 0.75rem;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.875rem; pointer-events: auto;
}

.toast-message { color: var(--text-primary); line-height: 1.35; }
.toast-success { border-color: var(--color-primary-border); }
.toast-success .toast-message { color: var(--color-success); }
.toast-error { border-color: color-mix(in srgb, var(--color-error) 45%, var(--glass-border)); }
.toast-error .toast-message { color: var(--color-error); }
.toast-warning { border-color: color-mix(in srgb, var(--color-warning) 45%, var(--glass-border)); }
.toast-warning .toast-message { color: var(--color-warning); }
.toast-info { border-color: color-mix(in srgb, var(--color-info) 45%, var(--glass-border)); }
.toast-info .toast-message { color: var(--color-info); }
@media (max-width: 640px) {
    .toast-container { inset: auto 0.75rem 5.5rem; }
    .toast { min-width: 0; width: 100%; }
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Spinner */
.spinner { width: 1.25rem; height: 1.25rem; border: 2px solid var(--border-subtle); border-radius: 50%; border-top-color: var(--color-primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Animations */
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.slide-up-enter-active, .slide-up-leave-active { transition: all 0.3s ease-out; }
.slide-up-enter-from { opacity: 0; transform: translateY(20px); }
.slide-up-leave-to { opacity: 0; transform: translateY(-20px); }

/* Utility */
.text-primary-color { color: var(--color-primary); }
.text-muted { color: var(--text-muted); }
.bg-panel { background-color: var(--bg-panel); }

/* Code block */
.code-block {
    background: #000; color: #a5b4fc;
    font-family: 'JetBrains Mono', monospace;
    padding: 1rem; border-radius: 0.5rem;
    font-size: 0.8rem; overflow-x: auto;
    border: 1px solid var(--glass-border);
}

/* ===== Importer UI Components ===== */

/* Toggle Switch */
.toggle-switch {
    position: relative; width: 36px; height: 20px;
    background: var(--bg-hover); border-radius: 10px;
    cursor: pointer; transition: background 0.25s ease;
    flex-shrink: 0; border: 1px solid var(--border-color);
}
.toggle-switch.active {
    background: var(--color-primary); border-color: var(--color-primary);
}
.toggle-dot {
    position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px; background: #fff;
    border-radius: 50%; transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-switch.active .toggle-dot {
    transform: translateX(16px);
}

/* Toggle Row */
.toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.625rem 0.75rem; border-radius: 0.5rem;
    cursor: pointer; transition: background 0.15s ease-out;
}
.toggle-row:hover { background: var(--bg-hover); }
.toggle-row:active { transform: scale(0.99); }

/* Preset Pill */
.preset-pill {
    display: flex; align-items: center; justify-content: center; gap: 0.25rem;
    padding: 0.375rem 0.5rem; border-radius: 0.5rem;
    font-size: 0.7rem; font-weight: 500;
    background: var(--bg-input); color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer; transition: all 0.2s ease-out;
}
.preset-pill:hover {
    background: var(--bg-hover); color: var(--text-primary);
    border-color: var(--text-muted);
}
.preset-pill:active { transform: scale(0.95); }
.preset-pill.preset-active {
    background: var(--color-primary-bg); color: var(--color-primary);
    border-color: var(--color-primary-border);
    box-shadow: 0 0 0 1px var(--color-primary-bg);
}

/* File Drop Zone */
.file-drop-zone {
    display: flex; align-items: center; justify-content: center;
    border: 2px dashed var(--border-color); border-radius: 0.75rem;
    background: var(--bg-input); cursor: pointer;
    transition: all 0.25s ease-out; padding: 0.5rem;
}
.file-drop-zone:hover {
    border-color: var(--color-primary-border);
    background: var(--color-primary-bg);
}
.file-drop-zone:active { transform: scale(0.99); }

/* Range Slider */
.range-slider {
    -webkit-appearance: none; appearance: none;
    height: 6px; border-radius: 3px;
    background: var(--bg-hover); outline: none;
    transition: background 0.2s ease-out;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--color-primary); cursor: pointer;
    box-shadow: 0 0 0 3px var(--color-primary-bg), 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 5px var(--color-primary-bg), 0 2px 8px rgba(0,0,0,0.4);
}
.range-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
}
.range-slider::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--color-primary); cursor: pointer; border: none;
    box-shadow: 0 0 0 3px var(--color-primary-bg), 0 2px 6px rgba(0,0,0,0.3);
}

/* Section Header */
.section-header {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Advanced Panel Transition */
.advanced-panel {
    animation: fadeSlideIn 0.25s ease-out;
}
.option-group { min-width: 0; padding-top: 0.75rem; border-top: 1px solid var(--border-color); }
.option-group legend { padding-right: 0.5rem; color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; }
.option-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.option-field-grid label { min-width: 0; color: var(--text-secondary); font-size: 0.7rem; }
.option-field-grid .input-field { margin-top: 0.25rem; padding: 0.5rem 0.65rem; }
.option-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 0.75rem; }
.option-check-grid label { display: flex; min-height: 44px; align-items: center; gap: 0.55rem; color: var(--text-secondary); font-size: 0.75rem; }
.option-check-grid input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--color-primary); }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.altcha-panel {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--glass-border) 70%, transparent), transparent 60%),
        var(--bg-input);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.altcha-panel.is-loading {
    border-color: color-mix(in srgb, var(--color-info) 35%, var(--glass-border));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-info) 10%, transparent);
}
.altcha-panel.is-ready {
    border-color: var(--color-primary-border);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 12%, transparent), transparent 62%),
        var(--bg-input);
}
.altcha-panel.is-solved {
    border-color: color-mix(in srgb, var(--color-success) 45%, var(--glass-border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--color-success) 14%, transparent), transparent 65%),
        var(--bg-input);
}
.altcha-panel.is-error {
    border-color: color-mix(in srgb, var(--color-error) 45%, var(--glass-border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--color-error) 10%, transparent), transparent 58%),
        var(--bg-input);
}
.altcha-indicator {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    flex-shrink: 0;
    background: var(--text-muted);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-muted) 14%, transparent);
}
.altcha-indicator.is-loading {
    background: var(--color-info);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-info) 16%, transparent);
}
.altcha-indicator.is-ready {
    background: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 16%, transparent);
}
.altcha-indicator.is-solved {
    background: var(--color-success);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-success) 18%, transparent);
}
.altcha-indicator.is-error {
    background: var(--color-error);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-error) 16%, transparent);
}
.altcha-panel .spinner {
    width: 1rem;
    height: 1rem;
}

.files-table {
    table-layout: fixed;
}

.files-table-name-cell {
    width: 40%;
}

.files-table-size {
    width: 12%;
    white-space: nowrap;
}

.files-table-type {
    width: 12%;
}

.files-table-time {
    width: 18%;
}

.files-table-actions-cell {
    width: 18%;
}

.files-table-actions {
    min-height: 2.25rem;
}

/* Coord Input Label */
.coord-label {
    position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%);
    font-size: 0.625rem; font-weight: 700;
}

@media (max-width: 1023px) {
    .settings-page {
        min-height: calc(100vh - 5rem);
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    }

    .settings-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.125rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-section-header {
        align-items: center;
        flex-wrap: wrap;
    }

    .settings-modal-overlay {
        padding: 1rem;
        padding-top: max(1rem, env(safe-area-inset-top, 0px));
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }

    .settings-modal-panel {
        max-height: min(38rem, calc(100vh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .settings-modal-body {
        min-height: 0;
        overflow-y: auto;
        padding-right: 0.125rem;
        -webkit-overflow-scrolling: touch;
    }

    .settings-account-card {
        max-width: 100%;
    }

    .settings-account-security {
        gap: 0.875rem;
    }

    .settings-account-email-row {
        flex-wrap: wrap;
    }

    .settings-account-email-row .btn {
        flex-shrink: 0;
    }

    .settings-server-list {
        overflow-x: visible;
    }

    .settings-server-table {
        min-width: 100%;
        table-layout: fixed;
    }

    .settings-server-table th,
    .settings-server-table td {
        word-break: break-word;
    }

    .settings-server-table th:last-child,
    .settings-server-table td:last-child {
        width: 4rem;
    }

    .settings-server-table td[data-label="租赁服号"] {
        width: 34%;
    }

    .settings-server-table td[data-label="备注"] {
        width: 34%;
    }

    .settings-server-table td[data-label="密码"] {
        width: 20%;
    }

    .settings-server-table td[data-label="操作"] {
        width: 12%;
    }

    .settings-page {
        padding-bottom: 5.5rem;
    }
}

@media (max-width: 640px) {
    .option-field-grid, .option-check-grid { grid-template-columns: minmax(0, 1fr); }
    .task-auth-panel .btn { width: 100%; }
    .settings-page {
        gap: 1rem;
    }

    .settings-page .glass-panel.card {
        padding: 1rem;
    }

    .settings-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-section-header .btn {
        width: 100%;
        justify-content: center;
    }

    .settings-add-server-modal {
        padding: 1rem;
        border-radius: 0.875rem;
    }

    .settings-modal-body {
        gap: 0.75rem;
    }

    .settings-account-card {
        padding: 1rem;
    }

    .settings-account-security {
        gap: 0.75rem;
    }

    .settings-account-email-row {
        flex-direction: column;
    }

    .settings-account-email-row .btn {
        width: 100%;
        justify-content: center;
    }

    .settings-server-list {
        padding: 0.875rem;
    }

    .settings-server-table,
    .settings-server-table thead,
    .settings-server-table tbody,
    .settings-server-table tr,
    .settings-server-table th,
    .settings-server-table td {
        display: block;
        width: 100%;
    }

    .settings-server-table {
        min-width: 0;
    }

    .settings-server-table thead {
        display: none;
    }

    .settings-server-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .settings-server-table tr {
        border: 1px solid var(--border-color);
        border-radius: 0.875rem;
        padding: 0.75rem;
        background: color-mix(in srgb, var(--bg-panel) 88%, transparent);
    }

    .settings-server-table td {
        padding: 0;
        text-align: left;
        border: none;
    }

    .settings-server-table td + td {
        margin-top: 0.625rem;
    }

    .settings-server-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        text-transform: uppercase;
    }

    .settings-server-table th:last-child,
    .settings-server-table td:last-child {
        width: 100%;
    }

    .settings-server-table td[data-label="操作"] {
        margin-top: 0.875rem;
        display: flex;
        justify-content: flex-end;
    }

    .settings-server-table td[data-label="操作"]::before {
        flex: 1;
        margin-bottom: 0;
        align-self: center;
    }

    .files-table,
    .files-table thead,
    .files-table tbody,
    .files-table tr,
    .files-table th,
    .files-table td {
        display: block;
        width: 100%;
    }

    .files-table {
        min-width: 0;
    }

    .files-table thead {
        display: none;
    }

    .files-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .files-table tbody.divide-y {
        --tw-divide-y-reverse: 0;
        border-top-width: 0;
        border-bottom-width: 0;
    }

    .files-table tr {
        border: 1px solid var(--border-color);
        border-radius: 0.875rem;
        padding: 0.875rem;
        background: color-mix(in srgb, var(--bg-panel) 88%, transparent);
    }

    .files-table tr.files-table-state-row {
        padding: 0;
        background: transparent;
        border: none;
    }

    .files-table td {
        padding: 0;
        border: none;
        text-align: left;
    }

    .files-table td + td {
        margin-top: 0.75rem;
    }

    .files-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.25rem;
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        text-transform: uppercase;
    }

    .files-table td.files-table-state-cell {
        padding: 2.5rem 1rem;
    }

    .files-table-state-cell::before {
        display: none;
    }

    .files-table-name-cell::before {
        margin-bottom: 0.5rem;
    }

    .files-table-name-cell > div {
        align-items: flex-start;
    }

    .files-table-name-cell .input-field {
        min-width: 0;
    }

    .files-table-name-cell span,
    .files-table-time {
        word-break: break-word;
    }

    .files-table-type span {
        display: inline-flex;
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }

    .files-table-actions-cell {
        margin-top: 0.875rem;
    }

    .files-table-actions {
        opacity: 1;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}
.skip-link:focus {
    top: 0;
}

/* Config Collapse Transition */
.config-collapse-enter-active,
.config-collapse-leave-active {
    transition: all 0.25s ease-out;
    max-height: 800px;
    opacity: 1;
}

.config-collapse-enter-from,
.config-collapse-leave-to {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

/* Button Active States */
button:active:not(:disabled),
.btn:active:not(:disabled),
[role="button"]:active:not([aria-disabled="true"]) {
    transform: scale(0.98);
    filter: brightness(0.95);
}

/* Mobile Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    button, .btn, [role="button"], a {
        -webkit-tap-highlight-color: rgba(16, 185, 129, 0.2);
        min-height: 44px;
        min-width: 44px;
    }
}

/* 3D Preview Drawer (issue #14) */
.slide-drawer-enter-active,
.slide-drawer-leave-active {
    transition: transform 0.25s ease, opacity 0.2s ease;
}
.slide-drawer-enter-from,
.slide-drawer-leave-to {
    transform: translateX(100%);
    opacity: 0;
}

/* issue #17 share code import_preset */
.share-code-preview {
    border: 1px solid var(--border);
}
.share-code-badge {
    line-height: 1.2;
}
