/* ============ 基础变量与重置 ============ */
:root {
    --bg: #f2f5fa;
    --surface: #ffffff;
    --sidebar: #0e1a2b;
    --sidebar-soft: #16273d;
    --sidebar-text: #c7d3e3;
    --sidebar-muted: #7f92ab;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #e8efff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e3e8f0;
    --success: #15803d;
    --success-soft: #e8f7ee;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --warning: #b45309;
    --warning-soft: #fdf3e3;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 28px rgba(15, 23, 42, .06);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5 {
    margin: 0;
    font-weight: 650;
    letter-spacing: -.01em;
}

p {
    margin: 0;
}

img {
    max-width: 100%;
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    vertical-align: -3px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12.5px;
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
}

/* ============ 布局 ============ */
.layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 246px;
    background: linear-gradient(180deg, #0e1a2b 0%, #122238 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 60;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 20px 20px 18px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}

.brand-mark .icon {
    width: 21px;
    height: 21px;
}

.brand-text strong {
    display: block;
    color: #fff;
    font-size: 16px;
    letter-spacing: .3px;
}

.brand-text span {
    display: block;
    color: var(--sidebar-muted);
    font-size: 11.5px;
}

.nav-group {
    padding: 8px 12px 0;
}

.nav-label {
    padding: 10px 10px 6px;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    transition: background .15s ease, color .15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, .95), rgba(37, 99, 235, .68));
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .28);
}

.nav-item .icon {
    width: 17px;
    height: 17px;
    opacity: .9;
}

.sidebar-foot {
    margin-top: auto;
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    font-size: 12px;
    color: var(--sidebar-muted);
}

.org-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .05);
    color: var(--sidebar-text);
}

.org-chip .icon {
    width: 16px;
    height: 16px;
}

.main {
    margin-left: 246px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 15.5px;
    font-weight: 650;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 8px 5px 5px;
    border-radius: 999px;
    color: var(--text);
}

.user-menu:hover {
    background: #f1f5f9;
}

.user-menu .name {
    font-size: 13px;
    font-weight: 550;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content {
    padding: 26px 28px 56px;
    width: 100%;
    max-width: 1320px;
}

.menu-btn, .icon-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 55;
}

/* ============ 通用组件 ============ */
.page-head {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-head h1 {
    font-size: 22px;
}

.page-head .sub {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.page-head .actions {
    margin-left: auto;
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 37px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #fff;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 550;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .05s ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .22);
}

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

.btn-outline {
    border-color: var(--border);
    background: #fff;
}

.btn-outline:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: var(--text);
}

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

.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--text);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-danger:hover {
    background: #fbdada;
    color: #b91c1c;
}

.btn-sm {
    height: 31px;
    padding: 0 11px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-head h2 {
    font-size: 15px;
}

.card-head .actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 18px;
    align-items: start;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    padding: 17px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12.5px;
}

.stat-label .icon {
    width: 15px;
    height: 15px;
}

.stat-value {
    margin-top: 7px;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.stat-value small {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-left: 4px;
}

/* ============ 表格 ============ */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.data th {
    text-align: left;
    padding: 11px 16px;
    color: var(--muted);
    font-weight: 550;
    font-size: 12px;
    letter-spacing: .04em;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data td {
    padding: 13px 16px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

table.data tr:last-child td {
    border-bottom: none;
}

table.data tbody tr:hover {
    background: #fbfdff;
}

.cell-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cell-title .name {
    font-weight: 550;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 360px;
}

.file-badge {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    flex: 0 0 auto;
}

.file-badge.k-image { background: #eef7ee; color: #15803d; }
.file-badge.k-pdf { background: #fdeeee; color: #dc2626; }
.file-badge.k-word { background: #e8f0fe; color: #1d4ed8; }
.file-badge.k-excel { background: #e9f7ef; color: #15803d; }
.file-badge.k-ppt { background: #fdf0e7; color: #c2410c; }
.file-badge.k-video, .file-badge.k-audio { background: #f3ecfe; color: #7c3aed; }
.file-badge.k-text { background: #eef2f7; color: #475569; }

/* ============ 文档卡片 ============ */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 15px;
}

.doc-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 17px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    color: var(--text);
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #cfdcef;
    color: var(--text);
}

.doc-card-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.doc-card-head .file-badge {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 10.5px;
}

.doc-card-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
}

.doc-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 12px;
    color: var(--muted);
}

.doc-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 550;
    background: #eef2f7;
    color: #475569;
    white-space: nowrap;
}

.badge-private { background: #f1f5f9; color: #475569; }
.badge-organization { background: #e8f0fe; color: #1d4ed8; }
.badge-specific { background: #fdf0e7; color: #c2410c; }
.badge-public { background: #e9f7ef; color: #15803d; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }

/* ============ 表单 ============ */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.field > label {
    font-size: 13px;
    font-weight: 550;
}

.field .hint {
    font-size: 12px;
    color: var(--muted);
}

.input, select.input, textarea.input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea.input {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
    min-height: 84px;
    line-height: 1.6;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

.input:focus {
    border-color: #93b4f5;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.field-error {
    color: var(--danger);
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.radio-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-card {
    flex: 1 1 180px;
    display: flex;
    gap: 9px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.radio-card:hover {
    border-color: #c7d7f2;
}

.radio-card input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.radio-card strong {
    display: block;
    font-size: 13px;
}

.radio-card span {
    font-size: 12px;
    color: var(--muted);
}

.check-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fbfcfe;
    max-height: 210px;
    overflow-y: auto;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 5px 6px;
    border-radius: 7px;
    cursor: pointer;
}

.check-item:hover {
    background: #f1f5fb;
}

.check-item input {
    accent-color: var(--primary);
}

/* 上传区域 */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 34px 20px;
    border: 1.6px dashed #c7d5ea;
    border-radius: 13px;
    background: #f9fbff;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.dropzone:hover, .dropzone.dragging {
    border-color: var(--primary);
    background: #f2f7ff;
}

.dropzone .icon {
    width: 30px;
    height: 30px;
    color: var(--primary);
}

.dropzone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 12.5px;
}

.file-row .name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 分片上传进度 */
.upload-item {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12.5px;
}

.upload-item + .upload-item {
    margin-top: 8px;
}

.upload-item .upload-head {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.upload-item .upload-head .name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 550;
}

.upload-item .upload-status {
    flex: none;
    color: var(--muted);
    font-size: 12px;
}

.upload-item.done .upload-status {
    color: var(--success);
}

.upload-item.error .upload-status {
    color: var(--danger);
}

.upload-bar {
    margin-top: 7px;
    height: 6px;
    border-radius: 999px;
    background: #e6ebf3;
    overflow: hidden;
}

.upload-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--primary);
    transition: width .18s ease;
}

.upload-item.done .upload-bar-fill {
    background: var(--success);
}

.upload-item.error .upload-bar-fill {
    background: var(--danger);
}

.upload-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 11.8px;
}

.upload-meta .spacer {
    flex: 1;
}

.link-btn {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 11.8px;
    cursor: pointer;
    padding: 0;
}

.link-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.link-btn[disabled] {
    color: var(--muted);
    cursor: default;
    text-decoration: none;
}

/* ============ 提示 ============ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 14px;
    border-radius: 11px;
    font-size: 13.2px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert .icon {
    margin-top: 2px;
    width: 16px;
    height: 16px;
}

.alert-success {
    background: var(--success-soft);
    color: #166534;
    border-color: #c7ebd4;
}

.alert-error {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: #f5cccc;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #d3e3fd;
}

.toast-wrap {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 15px;
    border-radius: 12px;
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .28);
    animation: toast-in .25s ease;
}

.toast.success { background: #14532d; }
.toast.error { background: #7f1d1d; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ 空状态 / 分页 ============ */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 56px 20px;
    text-align: center;
    color: var(--muted);
}

.empty .empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #eef3fb;
    display: grid;
    place-items: center;
    color: #94a3b8;
}

.empty .empty-icon .icon {
    width: 26px;
    height: 26px;
}

.empty strong {
    color: var(--text);
    font-size: 15px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.pager a, .pager span.current {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 13px;
}

.pager span.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pager a.disabled {
    pointer-events: none;
    opacity: .45;
}

/* ============ 筛选条 ============ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

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

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.chip:hover {
    color: var(--text);
    border-color: #cbd5e1;
}

.chip.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.search {
    position: relative;
    flex: 1 1 220px;
    max-width: 340px;
    margin-left: auto;
}

.search .icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    width: 16px;
    height: 16px;
}

.search input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
}

.search input:focus {
    border-color: #93b4f5;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

/* ============ 详情 ============ */
.detail-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.detail-head .file-badge {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 12px;
}

.detail-title {
    font-size: 20px;
    line-height: 1.35;
    word-break: break-word;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--muted);
}

.meta-list {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px 12px;
    font-size: 13.2px;
}

.meta-list dt {
    color: var(--muted);
}

.meta-list dd {
    margin: 0;
    word-break: break-all;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin: 22px 0 12px;
}

.share-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--muted);
}

.share-link .url {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

/* ============ 预览 ============ */
.preview-stage {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    overflow: hidden;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.preview-stage img {
    display: block;
    margin: 0 auto;
    max-height: 76vh;
    object-fit: contain;
}

.preview-stage iframe {
    width: 100%;
    height: 76vh;
    border: 0;
    background: #fff;
}

.preview-stage video, .preview-stage audio {
    width: 100%;
    max-height: 74vh;
    background: #000;
}

.preview-stage audio {
    margin: 30px;
    width: calc(100% - 60px);
}

.preview-text {
    margin: 0;
    padding: 22px 24px;
    overflow: auto;
    max-height: 76vh;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12.8px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    color: #1e293b;
    background: #fcfdff;
}

.office-doc {
    padding: 30px 34px;
    overflow: auto;
    max-height: 76vh;
    line-height: 1.85;
    color: #1f2937;
}

.office-doc h3 {
    font-size: 16px;
    margin: 18px 0 8px;
}

.office-doc h4 {
    font-size: 14px;
    margin: 0 0 8px;
}

.office-doc p {
    margin: 0 0 10px;
}

.office-table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0 18px;
    font-size: 12.8px;
}

.office-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 9px;
    vertical-align: top;
}

.office-table tr:first-child td {
    background: #f6f8fc;
    font-weight: 600;
}

.ppt-slide {
    padding: 14px 0 18px;
    border-bottom: 1px dashed var(--border);
}

.ppt-slide:last-child {
    border-bottom: none;
}

.preview-note {
    display: flex;
    gap: 9px;
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--warning-soft);
    color: #92400e;
    font-size: 13px;
}

/* ============ 磁盘管理 ============ */
.progress {
    height: 7px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
    margin-top: 8px;
}

.progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.volume-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.volume-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.volume-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #eef3fb;
    color: var(--primary);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.volume-head strong {
    font-size: 14.5px;
}

.path {
    font-size: 12px;
    color: var(--muted);
    word-break: break-all;
}

.volume-nums {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 14px;
}

.breadcrumb .sep {
    color: #cbd5e1;
}

/* ============ 认证页 ============ */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #f6f8fc;
}

.auth-aside {
    position: relative;
    padding: 56px 60px;
    background: linear-gradient(150deg, #0e1a2b 0%, #142845 55%, #1b3a63 100%);
    color: #e8eef8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-aside::after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    right: -160px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(59, 130, 246, .38), transparent 65%);
}

.auth-aside .brand {
    padding: 0;
}

.auth-aside h1 {
    font-size: 32px;
    line-height: 1.35;
    letter-spacing: -.02em;
    margin: 34px 0 16px;
    color: #fff;
}

.auth-aside p {
    color: #a9bcd6;
    max-width: 430px;
    line-height: 1.9;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    font-size: 13.5px;
    color: #cbd8ea;
}

.feature-item .ico-box {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #8fb8f6;
}

.auth-foot {
    font-size: 12px;
    color: #7d92ad;
    position: relative;
    z-index: 1;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 408px;
}

.auth-card h2 {
    font-size: 24px;
    margin-bottom: 6px;
}

.auth-card .lead {
    color: var(--muted);
    margin-bottom: 24px;
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.auth-tip {
    margin-top: 20px;
    padding: 11px 13px;
    background: #eef4ff;
    border: 1px solid #dbe7fd;
    border-radius: 10px;
    font-size: 12.5px;
    color: #1e40af;
    line-height: 1.7;
}

/* ============ 公开分享页 ============ */
.share-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 18px;
    background: linear-gradient(160deg, #eef3fb 0%, #f7fafd 60%, #eef4fc 100%);
}

.share-card {
    width: 100%;
    max-width: 620px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 30px;
}

.share-card.wide {
    max-width: 1060px;
}

.share-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 13px;
}

.share-brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.share-brand strong {
    color: var(--text);
    font-size: 14px;
    display: block;
    line-height: 1.2;
}

.share-file {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.share-file .file-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 12px;
}

.share-file h1 {
    font-size: 19px;
    line-height: 1.4;
    word-break: break-word;
}

.share-foot {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}

.share-preview-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.share-preview-bar .title {
    font-weight: 600;
    font-size: 15px;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

/* ============ 错误页 ============ */
.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
    background: linear-gradient(160deg, #eef3fb, #f8fafc);
}

.error-box {
    text-align: center;
    max-width: 440px;
}

.error-code {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: -.04em;
    color: #c8d6ea;
    line-height: 1;
}

.error-box h1 {
    font-size: 20px;
    margin: 10px 0 8px;
}

.error-box p {
    color: var(--muted);
    margin-bottom: 22px;
}

/* ============ 工作区 ============ */
.ws-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ws-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    color: var(--text);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.ws-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #cfdcef;
    color: var(--text);
}

.ws-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ws-head strong {
    font-size: 14.5px;
}

.ws-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #eef3fb;
    color: var(--primary);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.ws-icon .icon {
    width: 20px;
    height: 20px;
}

.ws-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}

.alert-warning {
    background: var(--warning-soft);
    color: #92400e;
    border-color: #f3dcc0;
}

/* AI 工作区选择器 */
.workspace-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
}

.workspace-picker .icon {
    width: 14px;
    height: 14px;
    color: var(--muted);
}

.workspace-picker select {
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text);
    max-width: 150px;
}

.workspace-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--muted);
    padding: 6px 9px;
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    white-space: nowrap;
}

.workspace-link:hover {
    color: var(--primary);
    border-color: #9db9ea;
}

/* 输入框下方的工作区选择 */
.composer-left .workspace-picker {
    padding: 2px 7px;
    background: #f8fafc;
}

.composer-left .workspace-picker select {
    max-width: 120px;
    font-size: 12px;
}

.composer-left .workspace-link {
    padding: 4px 8px;
    font-size: 12px;
}

/* ============ 响应式 ============ */
@media (max-width: 1120px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        width: 264px;
        box-shadow: 0 0 40px rgba(15, 23, 42, .3);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .menu-btn {
        display: inline-flex;
    }

    .overlay.show {
        display: block;
    }

    .topbar {
        padding: 0 16px;
        height: 58px;
    }

    .content {
        padding: 18px 16px 44px;
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-head h1 {
        font-size: 19px;
    }

    .page-head .actions {
        width: 100%;
        margin-left: 0;
    }

    .page-head .actions .btn {
        flex: 1;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat {
        padding: 13px 14px;
    }

    .stat-value {
        font-size: 20px;
    }

    .doc-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .toolbar .search {
        max-width: none;
        flex-basis: 100%;
        margin-left: 0;
        order: 3;
    }

    .chips {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .chip {
        flex: 0 0 auto;
    }

    .user-menu .name {
        display: none;
    }

    .topbar .page-title {
        font-size: 14.5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .office-doc {
        padding: 18px 16px;
    }

    .preview-text {
        padding: 14px;
    }

    .meta-list {
        grid-template-columns: 84px 1fr;
        font-size: 12.8px;
    }

    .toast-wrap {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
    }

    .detail-head .detail-title {
        font-size: 17px;
    }
}

@media (max-width: 420px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}
