:root {
    --primary: #ff6a00;
    --primary-hover: #e55f00;
    --primary-light: #fff7f0;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #a0a4b8;
    --sidebar-active: #ffffff;
    --bg: #f5f6fa;
    --card: #ffffff;
    --border: #e8eaed;
    --text: #1f2329;
    --text-secondary: #646a73;
    --danger: #f53f3f;
    --success: #00b42a;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo-icon {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
}

.logo-text { color: #fff; font-weight: 600; font-size: 15px; }

.sidebar-nav { flex: 1; padding: 12px 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    text-decoration: none;
    margin-bottom: 4px;
    transition: background .15s;
}

.nav-item:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav-item.active { background: rgba(255,106,0,.2); color: var(--primary); }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.user-badge { color: #fff; }
.logout-link { color: var(--sidebar-text); }

.main-content { flex: 1; padding: 24px 32px; overflow: auto; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 45%, #0f3460 100%);
}
.login-bg::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,106,0,.15) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}
.login-wrap {
    position: relative;
    display: flex;
    max-width: 900px;
    width: 92%;
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-brand-panel {
    flex: 1;
    padding: 48px 40px;
    background: linear-gradient(160deg, #ff6a00 0%, #e55f00 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-brand-logo {
    display: inline-block;
    font-weight: 800;
    font-size: 22px;
    padding: 10px 16px;
    background: rgba(255,255,255,.2);
    border-radius: 10px;
    width: fit-content;
    margin-bottom: 20px;
}
.login-brand-panel h2 { font-size: 24px; margin-bottom: 8px; }
.login-brand-panel > p { opacity: .9; font-size: 14px; margin-bottom: 28px; }
.login-features { list-style: none; font-size: 14px; line-height: 2; opacity: .95; }
.login-card {
    flex: 1;
    padding: 48px 40px;
    min-width: 320px;
}
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.login-form { margin-top: 8px; }
.login-form .settings-alert { margin-bottom: 16px; }
.btn-login { padding: 12px; font-size: 15px; margin-top: 8px; }
.login-hint {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}
.login-hint code { font-size: 11px; background: #f0f1f3; padding: 2px 6px; border-radius: 4px; }

/* Page */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 600; }
.subtitle { color: var(--text-secondary); margin-top: 4px; font-size: 13px; }
.flex-between { display: flex; justify-content: space-between; align-items: flex-start; }

.breadcrumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
}
.stat-card.accent { border-left-color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-small { font-size: 18px; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.panel {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.panel-header h2 { font-size: 16px; font-weight: 600; }
.panel > h2 { padding: 16px 20px 0; font-size: 16px; }
.panel .info-list, .panel .doc-list, .panel .api-table { margin: 0 20px 20px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: #fafbfc;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.data-table tr:hover td { background: #fafbfc; }
.data-table .empty { text-align: center; color: var(--text-secondary); padding: 32px; }
.data-table .mono { font-family: ui-monospace, monospace; font-size: 12px; }
.data-table .truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table code { font-size: 12px; background: #f0f1f3; padding: 2px 6px; border-radius: 4px; }

.actions { white-space: nowrap; }
.actions .btn { margin-right: 4px; }

/* Tags */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #f0f1f3;
    color: var(--text-secondary);
}
.tag-private { background: #fff7e8; color: #d46b08; }
.tag-public { background: #e8ffea; color: var(--success); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--danger); border-color: #ffccc7; }
.btn-danger:hover { background: #fff2f0; border-color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; }

.acl-select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
}

.file-icon.folder { font-weight: 500; }
.folder-up { color: var(--text-secondary); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-content {
    position: relative;
    background: var(--card);
    border-radius: 12px;
    padding: 24px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0,0,0,.2);
}
.modal-content h3 { margin-bottom: 16px; }
.modal-content label { display: block; margin-bottom: 14px; }
.modal-content label span { display: block; margin-bottom: 6px; font-weight: 500; }
.modal-content input, .modal-content select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.modal-content small { color: var(--text-secondary); font-size: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.full-width { width: 100%; padding: 10px; margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; }

.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.alert-error { background: #fff2f0; color: var(--danger); border: 1px solid #ffccc7; }

.info-list { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; padding: 16px 0; }
.info-list dt { color: var(--text-secondary); font-weight: 500; }
.doc-list { padding: 12px 0 12px 20px; }
.doc-list li { margin-bottom: 8px; }

.hidden { display: none !important; }
.link { font-size: 13px; }
.hint { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.text-muted { color: var(--text-secondary); }

.link-cell { max-width: 360px; }
.access-link-wrap { display: flex; flex-direction: column; gap: 4px; }
.access-link-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    font-family: ui-monospace, monospace;
    background: #fafbfc;
    color: var(--text-secondary);
}
.link-expires { font-size: 11px; color: var(--text-secondary); }
.format-hint { font-size: 12px; color: var(--text-secondary); margin-top: 6px; max-width: 720px; line-height: 1.6; }

.tag-media.tag-image { background: #e8f3ff; color: #1677ff; }
.tag-media.tag-video { background: #fff0f6; color: #c41d7f; }
.tag-media.tag-audio { background: #f6ffed; color: #389e0d; }
.btn-preview { border-color: #91caff; color: #1677ff; }
.btn-preview:hover { background: #e6f4ff; }
.btn-extract { border-color: #b7eb8f; color: #389e0d; }
.btn-extract:hover { background: #f6ffed; }
.tag-archive { background: #fffbe6; color: #ad6800; }

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    margin-bottom: 16px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.dropzone p { margin-bottom: 6px; font-weight: 500; }
.dropzone small { color: var(--text-secondary); font-size: 12px; }

.toolbar { margin-bottom: 12px; }
.search-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 220px;
    font-size: 14px;
}
.col-check { width: 40px; }

.modal-preview-content { width: min(92vw, 960px); }
.preview-body { min-height: 200px; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 8px; overflow: hidden; }
.preview-body-doc { background: #f5f6fa; }
.preview-body-text { background: #fff; align-items: stretch; justify-content: flex-start; max-height: 70vh; overflow: auto; }
.preview-media { max-width: 100%; max-height: 70vh; }
.preview-iframe { width: 100%; height: 60vh; border: none; }
.preview-pdf, .preview-office { background: #fff; }
.preview-text {
    margin: 0;
    padding: 16px 20px;
    width: 100%;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text);
}
.preview-loading { padding: 24px; color: var(--text-secondary); width: 100%; text-align: center; }
.preview-fallback {
    padding: 32px 28px;
    text-align: center;
    max-width: 420px;
    color: var(--text);
}
.preview-fallback-icon { font-size: 48px; margin-bottom: 12px; }
.preview-fallback-hint { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.6; }
.preview-fallback-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.tag-pdf { background: #fff1f0; color: #cf1322; }
.tag-document { background: #e6f4ff; color: #0958d9; }
.tag-spreadsheet { background: #f6ffed; color: #389e0d; }
.tag-presentation { background: #fff7e6; color: #d46b08; }
.tag-text { background: #f9f0ff; color: #531dab; }

.upload-progress {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--card);
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    z-index: 900;
    min-width: 240px;
}
.upload-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 8px; overflow: hidden; }
.upload-progress-bar div { height: 100%; background: var(--primary); width: 0; transition: width .2s; }

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 18px;
    border-radius: var(--radius);
    background: #1f2329;
    color: #fff;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s;
    max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #00b42a; }
.toast-error { background: #f53f3f; }

.footer-version {
    font-size: 10px;
    color: rgba(255,255,255,.35);
    letter-spacing: .02em;
}
.footer-domain {
    font-size: 11px;
    color: var(--sidebar-text);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-footer { flex-direction: column; align-items: flex-start; gap: 4px; }

.sort-select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.toolbar-meta { color: var(--text-secondary); font-size: 13px; margin-left: auto; }
.pagination { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border); }

.quota-panel { padding: 16px 20px 20px; margin-bottom: 20px; }
.quota-panel h2 { font-size: 16px; margin-bottom: 12px; }
.quota-bar-wrap { display: flex; align-items: center; gap: 16px; }
.quota-bar { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.quota-fill { height: 100%; background: var(--primary); transition: width .3s; }
.quota-fill.quota-warn { background: var(--danger); }
.quota-alert { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* ========== 访问设置页 ========== */
.settings-page { max-width: 1100px; }

.settings-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #fff7f0 0%, #fff 50%, #f5f8ff 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.settings-hero-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(255, 106, 0, 0.15);
}
.settings-hero h1 { font-size: 26px; font-weight: 600; margin-bottom: 4px; }
.settings-hero .subtitle { margin-top: 0; }

.settings-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}
.settings-alert.alert-success { background: #e8ffea; color: #008026; border: 1px solid #b7eb8f; }
.settings-alert.alert-error { background: #fff2f0; color: var(--danger); border: 1px solid #ffccc7; }
.settings-alert .alert-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.settings-alert.alert-success .alert-icon { background: var(--success); color: #fff; }
.settings-alert.alert-error .alert-icon { background: var(--danger); color: #fff; }

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.settings-card {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px 24px;
}
.settings-card-wide { margin-bottom: 20px; }
.settings-card-accent {
    border-top: 3px solid var(--primary);
}
.settings-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.settings-card-icon {
    font-size: 24px;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 10px;
}
.settings-card-head h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.settings-card-head p { font-size: 13px; color: var(--text-secondary); margin: 0; }

.settings-form .form-row { margin-bottom: 16px; }
.settings-form .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.settings-form label { display: block; }
.settings-form .label-text {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.settings-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.settings-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.settings-form .form-actions { margin-top: 8px; }
.settings-tip {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.info-card {
    padding: 14px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: border-color .15s;
}
.info-card:hover { border-color: var(--border); }
.info-card-highlight {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff7f0 0%, #fafbfc 100%);
    border-color: rgba(255, 106, 0, 0.2);
}
.info-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.info-card-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}
.info-card-value.url-value { font-size: 14px; font-weight: 500; color: var(--primary); }
.info-card-value .text-muted { font-weight: 400; font-size: 13px; }
.info-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    font-size: 11px;
    background: #e8ffea;
    color: var(--success);
    border-radius: 4px;
}
.mini-quota-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.mini-quota-fill { height: 100%; background: var(--primary); border-radius: 2px; }

.acl-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.acl-card {
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.acl-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.acl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.acl-private { background: #fffbe6; border-color: #ffe58f; }
.acl-private .acl-dot { background: #faad14; }
.acl-private .acl-card-title { color: #d46b08; }
.acl-public { background: #e6f4ff; border-color: #91caff; }
.acl-public .acl-dot { background: #1677ff; }
.acl-public .acl-card-title { color: #0958d9; }
.acl-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0; }

.api-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.api-item {
    display: grid;
    grid-template-columns: 64px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: background .15s;
}
.api-item:hover { background: #f0f1f3; }
.api-method {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    letter-spacing: 0.02em;
}
.api-get { background: #e6f4ff; color: #1677ff; }
.api-post { background: #fff7e6; color: #d46b08; }
.api-delete { background: #fff2f0; color: #cf1322; }
.api-path {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    color: var(--text);
    background: var(--card);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    overflow-x: auto;
}
.api-desc { font-size: 13px; color: var(--text-secondary); }
.api-note {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* ========== 概览页 ========== */
.dashboard-page { max-width: 1200px; }

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding: 22px 28px;
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 40%, #fff7f0 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.dashboard-hero-left { display: flex; align-items: center; gap: 18px; }
.dashboard-hero-icon {
    width: 52px;
    height: 52px;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(22, 119, 255, 0.12);
}
.dashboard-hero h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }

.dashboard-quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    min-width: 88px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 12px;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.quick-action:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.12);
    text-decoration: none;
    transform: translateY(-1px);
}
.quick-action-primary {
    background: var(--primary-light);
    border-color: rgba(255, 106, 0, 0.35);
    color: var(--primary);
}
.quick-action-primary .qa-icon {
    background: var(--primary);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}
.qa-icon { font-size: 20px; line-height: 1; }

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.dash-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
}
.dash-stat-primary { border-left-color: var(--primary); }
.dash-stat-blue { border-left-color: #1677ff; }
.dash-stat-orange { border-left-color: #ff6a00; }
.dash-stat-green { border-left-color: #00b42a; }
.dash-stat-pink { border-left-color: #eb2f96; }
.dash-stat-purple { border-left-color: #722ed1; }
.dash-stat-icon { font-size: 22px; line-height: 1; opacity: 0.9; }
.dash-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.dash-stat-label { font-size: 12px; color: var(--text-secondary); }

.dashboard-quota {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.dashboard-quota-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}
.dashboard-quota-head strong { color: var(--primary); }
.dashboard-quota-bar {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}
.dashboard-quota-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff9a44);
    border-radius: 5px;
    transition: width .4s ease;
}
.dashboard-quota-fill.caution { background: linear-gradient(90deg, #faad14, #ffc53d); }
.dashboard-quota-fill.warn { background: linear-gradient(90deg, #f53f3f, #ff7875); }
.dashboard-quota-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.quota-warn-text { color: var(--danger); font-weight: 500; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
}
.dashboard-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.dashboard-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}
.dashboard-card-head h2 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.dashboard-card-head p { font-size: 12px; color: var(--text-secondary); margin: 0; }

.dashboard-empty-mini {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}
.dashboard-empty-mini .btn { margin-top: 12px; }

.bucket-mini-list { padding: 8px; }
.bucket-mini-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.bucket-mini-item:hover {
    background: var(--primary-light);
    text-decoration: none;
}
.bucket-mini-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #ff9a44);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bucket-mini-info { flex: 1; min-width: 0; }
.bucket-mini-info strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}
.bucket-mini-info small {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.acl-mini {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.acl-mini.private { background: #fff7e8; color: #d46b08; }
.acl-mini.public { background: #e8ffea; color: #00b42a; }
.bucket-mini-size {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.activity-list { list-style: none; padding: 8px 12px; max-height: 420px; overflow-y: auto; }
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.log-upload { background: #e6f4ff; }
.log-delete { background: #fff2f0; }
.log-rename { background: #fff7e6; }
.log-default { background: #f0f1f3; }
.activity-body { flex: 1; min-width: 0; }
.activity-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.activity-action { font-size: 13px; font-weight: 600; }
.activity-bucket {
    font-size: 11px;
    padding: 1px 6px;
    background: #f0f1f3;
    border-radius: 4px;
}
.activity-key {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-time {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ========== Bucket 列表页 ========== */
.buckets-page { max-width: 1200px; }

.buckets-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 22px 28px;
    background: linear-gradient(135deg, #fff7f0 0%, #fff 45%, #f0f7ff 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.buckets-hero-left { display: flex; align-items: center; gap: 18px; }
.buckets-hero-icon {
    width: 52px;
    height: 52px;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(255, 106, 0, 0.12);
}
.buckets-hero h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.btn-create { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; font-size: 14px; }
.btn-create .btn-icon { font-size: 18px; line-height: 1; }

.buckets-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.buckets-stat-item {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
    text-align: center;
}
.buckets-stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.buckets-stat-label { font-size: 12px; color: var(--text-secondary); }

.buckets-card {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.buckets-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}
.buckets-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 360px;
    padding: 0 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}
.buckets-search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-icon { font-size: 14px; opacity: 0.5; }
.buckets-search {
    flex: 1;
    border: none;
    padding: 10px 0;
    font-size: 14px;
    background: transparent;
    outline: none;
}
.buckets-count { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

.buckets-table-wrap { overflow-x: auto; }
.buckets-table {
    width: 100%;
    border-collapse: collapse;
}
.buckets-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.buckets-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.buckets-table tbody tr:last-child td { border-bottom: none; }
.buckets-table tbody tr:hover { background: #fafbfc; }
.buckets-table tbody tr.hidden { display: none; }

.bucket-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.bucket-name-cell:hover strong { color: var(--primary); }
.bucket-name-cell:hover { text-decoration: none; }
.bucket-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff9a44 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bucket-name-cell strong {
    display: block;
    font-size: 14px;
    color: var(--text);
    transition: color .15s;
}
.bucket-name-cell small {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

.region-badge, .storage-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    background: #f0f1f3;
    color: var(--text-secondary);
    white-space: nowrap;
}
.region-badge { background: #e6f4ff; color: #1677ff; }

.acl-pill {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    background: var(--card);
    cursor: pointer;
    transition: border-color .15s;
}
.acl-pill:focus { outline: none; border-color: var(--primary); }

.num-cell { font-weight: 600; font-variant-numeric: tabular-nums; }
.size-cell { font-weight: 500; color: var(--text-secondary); font-size: 13px; }
.time-cell { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-files {
    border-color: #91caff;
    color: #1677ff;
    background: #e6f4ff;
}
.btn-files:hover { background: #bae0ff; color: #0958d9; text-decoration: none; }
.btn-danger-outline {
    color: var(--danger);
    border-color: #ffccc7;
    background: #fff;
}
.btn-danger-outline:hover { background: #fff2f0; border-color: var(--danger); }

.buckets-empty {
    text-align: center;
    padding: 56px 24px;
}
.buckets-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.buckets-empty h3 { font-size: 18px; margin-bottom: 8px; }
.buckets-empty p { color: var(--text-secondary); margin-bottom: 20px; font-size: 14px; }

.buckets-no-result {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
    font-size: 14px;
}
.buckets-no-result.hidden { display: none; }

.modal-bucket-create { width: 440px; max-width: 92vw; }
.modal-bucket-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-bucket-icon { font-size: 28px; }
.modal-bucket-head h3 { font-size: 18px; margin-bottom: 4px; }
.modal-bucket-head p { font-size: 13px; color: var(--text-secondary); margin: 0; }
.modal-bucket-create .field-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}
.modal-bucket-create select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

@media (max-width: 900px) {
    .buckets-hero { flex-direction: column; align-items: stretch; }
    .btn-create { justify-content: center; }
    .buckets-stats { flex-direction: column; }
    .buckets-card-toolbar { flex-direction: column; align-items: stretch; }
    .buckets-search-wrap { max-width: none; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-form .form-row-2 { grid-template-columns: 1fr; }
    .acl-cards { grid-template-columns: 1fr; }
    .api-item {
        grid-template-columns: 56px 1fr;
        grid-template-rows: auto auto;
    }
    .api-desc, .api-note { grid-column: 2; }
}

.modal-qr-content { text-align: center; }
.qr-body { margin: 12px 0; }
.qr-url { font-size: 11px; color: var(--text-secondary); word-break: break-all; }

/* 文件管理页 */
.files-page { max-width: 1200px; }
.files-dropzone { margin-bottom: 16px; }
.files-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #fff7f0 0%, #fff 50%, #f0f7ff 100%);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.files-back {
    display: inline-block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-decoration: none;
}
.files-back:hover { color: var(--primary); }
.files-hero-title { display: flex; align-items: flex-start; gap: 14px; }
.bucket-avatar-lg { width: 48px; height: 48px; font-size: 20px; border-radius: 12px; }
.files-hero h1 { font-size: 22px; margin-bottom: 4px; }
.breadcrumb-inline { margin-top: 8px; font-size: 12px; }
.files-actions { flex-wrap: wrap; }
.files-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.files-search-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.files-search-form .buckets-search-wrap { max-width: 280px; flex: 1; }
.files-table-wrap { overflow-x: auto; }
.files-table .col-check { width: 40px; }
.files-table .link-cell { max-width: 280px; min-width: 160px; }

/* 404 */
.error-page {
    text-align: center;
    padding: 80px 24px;
}
.error-code {
    font-size: 72px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 16px;
    opacity: .35;
}
.error-page h1 { font-size: 24px; margin-bottom: 8px; }
.error-page p { color: var(--text-secondary); margin-bottom: 24px; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 移动端侧边栏 */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1040;
}
.app-shell.sidebar-open .sidebar-overlay { display: block; }

@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .panel-grid { grid-template-columns: 1fr; }
    .sidebar { width: 64px; }
    .logo-text, .nav-item span:not(.nav-icon), .sidebar-footer .user-badge { display: none; }
    .sidebar-footer { align-items: center; }
}

@media (max-width: 768px) {
    .login-wrap { flex-direction: column; }
    .login-brand-panel { padding: 32px 28px; }
    .login-card { padding: 32px 28px; }
    .sidebar-toggle { display: block; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .25s ease;
        width: 260px;
        flex-direction: column;
        flex-wrap: nowrap;
    }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-nav { display: block; padding: 12px 8px; }
    .nav-item { padding: 10px 12px; font-size: 14px; }
    .logo-text, .nav-item span:not(.nav-icon), .sidebar-footer .user-badge { display: inline; }
    .main-content { padding: 56px 16px 16px; }
    .files-hero { flex-direction: column; }
    .files-actions { width: 100%; }
    .dashboard-hero { flex-direction: column; align-items: stretch; }
    .dashboard-quick-actions { justify-content: stretch; }
    .quick-action { flex: 1; min-width: 0; }
    .dashboard-stats { grid-template-columns: 1fr 1fr; }
    .buckets-hero { flex-direction: column; align-items: stretch; }
    .buckets-table th:nth-child(3),
    .buckets-table td:nth-child(3),
    .buckets-table th:nth-child(7),
    .buckets-table td:nth-child(7) { display: none; }
    .settings-hero { flex-direction: column; text-align: center; padding: 20px; }
    .info-cards { grid-template-columns: 1fr; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px; }
    .files-table .link-cell { max-width: 140px; min-width: 100px; }
    .actions { display: flex; flex-wrap: wrap; gap: 4px; }
    .btn-group { flex-wrap: wrap; }
    .page-header.flex-between { flex-direction: column; gap: 12px; }
}
