/* ============================================================
   云文件共享平台 SaaS v6 — 商用级 UI 设计系统
   包含：布局 / 侧边栏 / 卡片 / 表格 / 表单 / 取密页 / 内容页 / 响应式
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0891b2;
    --info-light: #cffafe;

    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-hover: #f8fafc;
    --bg-overlay: rgba(15, 23, 42, 0.6);

    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 2px 8px rgba(0,0,0,.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,.15);

    --sidebar-width: 250px;
    --sidebar-width-collapsed: 68px;
    --header-height: 60px;

    --transition: all .25s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-sidebar: #020617;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    --shadow: 0 2px 8px rgba(0,0,0,.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==================== 布局 ==================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width); background: var(--bg-sidebar); color: var(--text-light);
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 100; transition: var(--transition); overflow-y: auto; overflow-x: hidden;
}
.sidebar.collapsed { width: var(--sidebar-width-collapsed); }
.sidebar-brand {
    padding: 20px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08); min-height: var(--header-height);
}
.sidebar-brand .logo { width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0; }
.sidebar-brand .name { font-size: 16px; font-weight: 700; color: #fff; white-space: nowrap; }
.sidebar.collapsed .sidebar-brand .name { display: none; }

.sidebar-menu { flex: 1; padding: 12px 0; }
.menu-label { padding: 16px 20px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: #64748b; font-weight: 700; white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .menu-label { opacity: 0; }
.menu-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: #94a3b8;
    cursor: pointer; transition: var(--transition); position: relative; white-space: nowrap;
}
.menu-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu-item.active { background: var(--primary); color: #fff; }
.menu-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #fff; border-radius: 0 3px 3px 0; }
.menu-item .icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.menu-item .text { font-size: 14px; font-weight: 500; }
.sidebar.collapsed .menu-item .text,
.sidebar.collapsed .menu-item .badge { display: none; }
.menu-item .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 10px; font-weight: 700; }
.sidebar.collapsed .menu-item .badge { display: none; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar.collapsed .sidebar-footer .user-info { display: none; }
.user-info-mini { display: flex; align-items: center; gap: 10px; }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-info .uname { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .urole { font-size: 11px; color: #64748b; }

.main { flex: 1; margin-left: var(--sidebar-width); transition: var(--transition); display: flex; flex-direction: column; min-width: 0; }
.sidebar.collapsed ~ .main { margin-left: var(--sidebar-width-collapsed); }

.topbar {
    height: var(--header-height); background: var(--bg-card); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 50;
}
.topbar .toggle-btn { width: 36px; height: 36px; border: none; background: var(--bg-hover); border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--text-secondary); transition: var(--transition); }
.topbar .toggle-btn:hover { background: var(--primary-light); color: var(--primary); }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); flex: 1; }
.breadcrumb .current { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; }
.search-box input { width: 240px; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-hover); font-size: 13px; transition: var(--transition); }
.search-box input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-light); }
.search-box .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }
.icon-btn { width: 36px; height: 36px; border: none; background: transparent; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--text-secondary); transition: var(--transition); position: relative; }
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn .dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--bg-card); }

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

/* ==================== 页面头 ==================== */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ==================== 按钮 ==================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border: none; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ==================== 卡片 ==================== */
.card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border-light); margin-bottom: 20px; overflow: hidden; }
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border-light); background: var(--bg-hover); }

/* ==================== 统计卡片 ==================== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px; display: flex; align-items: center; gap: 16px; transition: var(--transition); border: 1px solid var(--border-light); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-icon { width: 52px; height: 52px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ==================== 表格 ==================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); border-bottom: 2px solid var(--border); background: var(--bg-hover); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }

/* ==================== 标签/徽章 ==================== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-purple { background: #ede9fe; color: #7c3aed; }

/* ==================== 表单 ==================== */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 14px; background: var(--bg-card); color: var(--text); transition: var(--transition);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-row textarea { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ==================== 上传区 ==================== */
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 48px 24px;
    text-align: center; cursor: pointer; background: var(--bg-hover); transition: var(--transition);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone .uz-icon { font-size: 48px; }
.upload-zone .uz-text { font-size: 15px; font-weight: 600; }
.upload-zone .uz-hint { font-size: 12px; color: var(--text-muted); }

.progress { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 4px; transition: width .3s; width: 0; }

/* ==================== 登录页 ==================== */
.auth-split { display: flex; min-height: 100vh; }
.auth-left { flex: 1; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); display: flex; flex-direction: column; justify-content: center; padding: 60px; color: #fff; position: relative; overflow: hidden; }
.auth-left::before { content: ''; position: absolute; top: -100px; right: -100px; width: 400px; height: 400px; background: rgba(255,255,255,.08); border-radius: 50%; }
.auth-left::after { content: ''; position: absolute; bottom: -150px; left: -50px; width: 500px; height: 500px; background: rgba(255,255,255,.05); border-radius: 50%; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 60px; position: relative; z-index: 1; }
.auth-brand .logo { width: 48px; height: 48px; background: rgba(255,255,255,.15); backdrop-filter: blur(10px); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; }
.auth-brand .name { font-size: 22px; font-weight: 800; }
.auth-hero { position: relative; z-index: 1; }
.auth-hero h1 { font-size: 38px; font-weight: 800; line-height: 1.25; margin-bottom: 16px; }
.auth-hero p { font-size: 16px; opacity: .9; line-height: 1.8; max-width: 440px; }
.auth-features { margin-top: 40px; position: relative; z-index: 1; }
.auth-feature { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; opacity: .95; }
.auth-feature .fi { width: 24px; height: 24px; background: rgba(255,255,255,.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg-card); }
.auth-form { width: 100%; max-width: 420px; }
.auth-tabs { display: flex; gap: 8px; background: var(--bg-hover); padding: 4px; border-radius: var(--radius); margin-bottom: 28px; }
.auth-tab { flex: 1; padding: 9px; text-align: center; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: var(--transition); border: none; background: transparent; }
.auth-tab.active { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-form-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.auth-form-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.tenant-input { margin-bottom: 18px; }
.tenant-input label { font-size: 12px; color: var(--text-muted); }
.tenant-input .link { font-size: 12px; color: var(--primary); cursor: pointer; float: right; }

/* ==================== 取密页（分离页，零内容） ==================== */
.access-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%); }
.access-box { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); padding: 40px; max-width: 440px; width: 100%; text-align: center; }
.access-brand { margin-bottom: 28px; }
.access-brand .logo { width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: var(--radius-lg); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.access-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.access-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.access-mode-tabs { display: flex; gap: 8px; background: var(--bg-hover); padding: 4px; border-radius: var(--radius); margin-bottom: 20px; }
.access-mode-tab { flex: 1; padding: 10px 4px; text-align: center; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: var(--transition); border: none; background: transparent; }
.access-mode-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.pass-display { background: linear-gradient(135deg, var(--primary-light), #e0e7ff); border-radius: var(--radius-lg); padding: 24px; margin: 20px 0; }
.pass-display .pd-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.pass-display .pd-value { font-size: 32px; font-weight: 800; letter-spacing: 4px; color: var(--primary-dark); font-family: 'Courier New', monospace; }
.pass-display .pd-timer { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.access-tip { font-size: 12px; color: var(--text-muted); background: var(--bg-hover); border-radius: var(--radius); padding: 12px; margin-top: 16px; text-align: left; }
.verify-row { display: flex; gap: 10px; }
.verify-row input { flex: 1; text-align: center; letter-spacing: 4px; font-size: 20px; font-weight: 700; }
.resend-btn { font-size: 12px; color: var(--primary); cursor: pointer; text-align: center; margin-top: 12px; }

/* ==================== 内容页（只读，含资料卡） ==================== */
.viewer-page { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.viewer-header { background: #fff; border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 50; }
.viewer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.viewer-brand .logo { width: 32px; height: 32px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; font-weight: 800; }
.viewer-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 12px; }
.session-timer { display: flex; align-items: center; gap: 6px; background: var(--warning-light); color: var(--warning); padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.viewer-body { flex: 1; padding: 32px 24px; max-width: 960px; margin: 0 auto; width: 100%; position: relative; }
/* 隐形水印 */
.viewer-body::after { content: attr(data-watermark); position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; font-size: 14px; color: rgba(0,0,0,.03); z-index: 9999; display: flex; align-items: center; justify-content: center; transform: rotate(-30deg); white-space: nowrap; overflow: hidden; }
.viewer-content { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 40px; margin-bottom: 24px; }
.viewer-file-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.viewer-file-icon { width: 56px; height: 56px; border-radius: var(--radius-lg); background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.viewer-file-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.viewer-file-info { font-size: 13px; color: var(--text-muted); }
.viewer-actions { display: flex; gap: 10px; margin-bottom: 24px; }
.viewer-preview { min-height: 300px; border: 2px dashed var(--border); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; padding: 40px; text-align: center; }

/* 使用者资料卡 */
.owner-card { background: linear-gradient(135deg, #fff, #f8fafc); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-top: 32px; }
.owner-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.owner-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; font-weight: 700; overflow: hidden; }
.owner-avatar img { width: 100%; height: 100%; object-fit: cover; }
.owner-name { font-size: 17px; font-weight: 700; }
.owner-title { font-size: 13px; color: var(--text-muted); }
.owner-divider { height: 1px; background: var(--border); margin: 16px 0; }
.owner-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); font-weight: 700; margin-bottom: 12px; }
.owner-contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.owner-contact { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-hover); border-radius: var(--radius); font-size: 13px; transition: var(--transition); }
.owner-contact:hover { background: var(--primary-light); }
.owner-contact .ci { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.owner-bio { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-top: 12px; padding: 14px; background: var(--bg-hover); border-radius: var(--radius); border-left: 3px solid var(--primary); }
.owner-badge { display: inline-block; font-size: 10px; color: var(--text-muted); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }

/* ==================== 套餐页 ==================== */
.plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.plan-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 2px solid var(--border-light); padding: 28px; transition: var(--transition); position: relative; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card.popular { border-color: var(--primary); }
.plan-popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 14px; border-radius: 20px; white-space: nowrap; }
.plan-name { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.plan-price { font-size: 36px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.plan-price .unit { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.plan-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; min-height: 38px; }
.plan-features { list-style: none; margin-bottom: 24px; }
.plan-features li { padding: 6px 0; font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.plan-features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }
.plan-features li.disabled { color: var(--text-muted); text-decoration: line-through; }
.plan-features li.disabled::before { content: '—'; color: var(--text-muted); }
.cycle-toggle { display: flex; gap: 4px; background: var(--bg-hover); padding: 4px; border-radius: var(--radius); margin-bottom: 24px; }
.cycle-toggle button { flex: 1; padding: 8px; border: none; background: transparent; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: var(--transition); }
.cycle-toggle button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ==================== 模态框 ==================== */
.modal-overlay { position: fixed; inset: 0; background: var(--bg-overlay); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: var(--transition); }
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; transform: scale(.95); transition: var(--transition); }
.modal-overlay.show .modal { transform: scale(1); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border: none; background: var(--bg-hover); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--text-muted); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; justify-content: flex-end; }

/* ==================== Toast ==================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 20px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px; min-width: 280px; border-left: 4px solid var(--primary); animation: slideIn .3s ease; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==================== 切换开关 ==================== */
.switch { position: relative; width: 44px; height: 24px; background: var(--border); border-radius: 20px; cursor: pointer; transition: var(--transition); flex-shrink: 0; border: none; }
.switch.on { background: var(--primary); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: var(--transition); box-shadow: var(--shadow-sm); }
.switch.on::after { left: 22px; }

/* ==================== 文件浏览器 ==================== */
.path-bar { display: flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; flex-wrap: wrap; }
.path-item { color: var(--text-muted); cursor: pointer; transition: var(--transition); padding: 2px 6px; border-radius: 4px; }
.path-item:hover { color: var(--primary); background: var(--primary-light); }
.path-item.current { color: var(--text); font-weight: 600; }
.path-sep { color: var(--text-muted); }

.file-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.view-toggle { display: flex; gap: 4px; background: var(--bg-card); padding: 3px; border-radius: var(--radius); border: 1px solid var(--border-light); }
.view-toggle button { padding: 6px 10px; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; color: var(--text-muted); transition: var(--transition); }
.view-toggle button.active { background: var(--primary-light); color: var(--primary); }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.file-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; transition: var(--transition); text-align: center; }
.file-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.file-card .fc-icon { font-size: 42px; margin-bottom: 10px; }
.file-card .fc-name { font-size: 13px; font-weight: 600; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }

/* ==================== 移动端 ==================== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .plans-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width); }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar.collapsed { width: var(--sidebar-width); }
    .sidebar.collapsed .menu-label,
    .sidebar.collapsed .menu-item .text,
    .sidebar.collapsed .sidebar-footer .user-info { display: block; }
    .main { margin-left: 0 !important; }
    .content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-icon { width: 42px; height: 42px; font-size: 20px; }
    .stat-value { font-size: 20px; }
    .plans-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .owner-contacts { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header .btn { width: 100%; }
    .topbar { padding: 0 12px; }
    .search-box { display: none; }
    .breadcrumb { font-size: 12px; }
    .card-body { padding: 16px; }
    .table-wrap { font-size: 12px; }
    .auth-split { flex-direction: column; }
    .auth-left { padding: 40px 24px; }
    .auth-left .auth-hero h1 { font-size: 26px; }
    .auth-right { padding: 24px 16px; }
    .access-box { padding: 28px 20px; }
    .pass-display .pd-value { font-size: 26px; }
    .viewer-header { padding: 10px 12px; flex-wrap: wrap; }
    .viewer-meta { font-size: 11px; gap: 8px; }
    .viewer-body { padding: 20px 12px; }
    .viewer-content { padding: 20px 16px; }
    .modal { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; align-self: flex-end; }
    /* 移动端抽屉 */
    .drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; display: none; }
    .drawer-overlay.show { display: block; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .file-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ==================== 工具类 ==================== */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; } .fw-800 { font-weight: 800; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-100 { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
