/* 云舟网盘 · 全局样式（骨架为纯 HTML/CSS，内容与 MDUI 2 组件配合） */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --text: #1c1b20;
  --muted: #6d6a7c;
  --border: #e8e5ef;
  --primary: #6750a4;
  --primary-soft: #f1ebff;
  --on-primary: #ffffff;
  --success: #16794a;
  --success-soft: #e4f6ec;
  --warn: #9a6700;
  --warn-soft: #fff3d6;
  --danger: #ba1a1a;
  --danger-soft: #fdeaea;
  --info: #2759a8;
  --info-soft: #e8f0ff;
  --shadow: 0 2px 16px rgba(38, 28, 70, .06);
  --shadow-lg: 0 18px 50px rgba(38, 28, 70, .16);
  --radius: 18px;
}
html.mdui-theme-dark, html[data-theme="dark"] {
  --bg: #131318;
  --surface: #1e1e25;
  --surface-2: #262630;
  --text: #e8e5ef;
  --muted: #a8a3b8;
  --border: #34323e;
  --primary: #cfbcff;
  --primary-soft: #34294d;
  --on-primary: #33234f;
  --success: #7bd6a5;
  --success-soft: #17392a;
  --warn: #e8c06a;
  --warn-soft: #3a2f16;
  --danger: #ff9b9b;
  --danger-soft: #431f22;
  --info: #9dbcff;
  --info-soft: #1b2c49;
  --shadow: 0 2px 16px rgba(0, 0, 0, .28);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Roboto, system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; opacity: .88; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: .2px; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.icon { width: 20px; height: 20px; display: inline-block; vertical-align: -4px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* ---------- 顶栏 / 侧栏 ---------- */
.app-topbar {
  position: fixed; inset: 0 0 auto 0; height: 64px; z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #7c5cc4, #4f3d99); color: #fff;
  box-shadow: 0 5px 14px rgba(103, 80, 164, .28);
}
.brand-mark .icon { width: 22px; height: 22px; }
.topbar-area {
  margin-left: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.topbar-spacer { flex: 1; }
.topbar-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; padding: 6px 10px; border-radius: 10px; }
.topbar-link:hover { background: var(--surface-2); color: var(--primary); opacity: 1; }
.topbar-link .icon { width: 17px; height: 17px; }
.icon-btn {
  width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted);
  border-radius: 10px; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--primary); }
.menu-btn { display: none; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent;
  color: var(--text); cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 999px; font-size: 13px;
}
.user-trigger:hover { background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; text-transform: uppercase;
}
mdui-menu-item .icon { width: 17px; height: 17px; margin-right: 8px; vertical-align: -3px; }

.app-shell { display: flex; padding-top: 64px; min-height: 100vh; }
.app-sidebar {
  width: 246px; position: fixed; top: 64px; bottom: 0; left: 0; z-index: 40;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px 14px;
  overflow-y: auto;
}
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-label { padding: 10px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; }
.side-label-gap { margin-top: 14px; }
.side-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  color: var(--muted); font-size: 14px; font-weight: 500; transition: .15s;
}
.side-item .icon { width: 19px; height: 19px; }
.side-item:hover { background: var(--surface-2); color: var(--text); opacity: 1; }
.side-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.side-footer { padding: 14px 10px 4px; border-top: 1px solid var(--border); }
.side-quota-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 8px; gap: 6px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; background: linear-gradient(90deg, #8a6ad1, #6750a4); border-radius: 99px; }
.side-version { margin-top: 14px; font-size: 11px; color: var(--muted); text-align: center; }
.sidebar-mask { display: none; }
.app-main { flex: 1; min-width: 0; margin-left: 246px; padding: 26px 30px 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-heading h1 { font-size: 24px; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-heading-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 通用卡片 / 表格 ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel + .panel { margin-top: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title h2 { font-size: 16px; }
.panel-title .icon { color: var(--primary); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 140px; }
.toolbar mdui-text-field { width: 240px; max-width: 100%; }
.toolbar .native-select { min-width: 150px; }
.toolbar mdui-select { width: 182px; min-width: 150px; }
.native-select {
  height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 13px; outline: none;
}
.native-select:focus { border-color: var(--primary); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .file-cell { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.file-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .3px; color: #fff; flex: none; text-transform: uppercase;
}
.file-name { font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: 11.5px; color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions mdui-button { --mdui-comp-button-tonal-state-layer-color: var(--primary); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-yellow { background: var(--warn-soft); color: var(--warn); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-purple { background: var(--primary-soft); color: var(--primary); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-state .icon { width: 40px; height: 40px; color: var(--primary); opacity: .55; margin-bottom: 10px; }
.empty-state h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 16px; color: var(--muted); font-size: 12.5px; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 14px;
}
.stat-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-card.green .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card.blue .stat-icon { background: var(--info-soft); color: var(--info); }
.stat-card.yellow .stat-icon { background: var(--warn-soft); color: var(--warn); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.35; letter-spacing: -.5px; }
.stat-hint { font-size: 11px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12.5px; }
.bar-row .bar-label { width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-track { flex: 1; height: 9px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.bar-row .bar-fill { height: 100%; background: linear-gradient(90deg, #9a7ee0, #6750a4); border-radius: 99px; }
.bar-row .bar-value { width: 76px; text-align: right; color: var(--muted); }

/* ---------- 趋势图 ---------- */
.trend-chart { display: flex; gap: 10px; align-items: flex-end; height: 196px; padding: 12px 4px 0; border-bottom: 1px solid var(--border); }
.trend-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.trend-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.trend-bar { width: 15px; max-width: 42%; min-height: 2px; border-radius: 5px 5px 0 0; transition: height .3s ease; }
.trend-bar.up { background: linear-gradient(180deg, #9a7ee0, #6750a4); }
.trend-bar.dl { background: #69b9a2; }
.trend-col > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.trend-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.trend-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* ---------- 上传 / 弹窗 ---------- */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px 20px; text-align: center;
  background: var(--surface-2); color: var(--muted); cursor: pointer; transition: .18s; margin-bottom: 16px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone .icon { width: 36px; height: 36px; color: var(--primary); margin-bottom: 6px; }
.dropzone strong { color: var(--text); display: block; font-size: 15px; margin-bottom: 2px; }
.upload-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.upload-item:last-child { border-bottom: 0; }
.upload-item .progress { flex: 1; }
.upload-name { width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 34, .48);
  display: none; align-items: center; justify-content: center; padding: 18px; backdrop-filter: blur(3px);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px 24px;
  border: 1px solid var(--border);
}
.modal h3 { font-size: 18px; margin-bottom: 4px; }
.modal .modal-desc { color: var(--muted); font-size: 12.5px; margin: 0 0 18px; }
.modal .form-row { margin-bottom: 14px; }
.modal .form-row label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.modal mdui-text-field, .modal mdui-select, .public-card mdui-text-field, .share-card mdui-text-field { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 18px; }
.form-grid .form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.form-row input[type="text"], .form-row input[type="password"], .form-row input[type="number"], .form-row input[type="email"], .form-row select {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 13px; outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--primary); }
.cp-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 300;
  background: #2c2735; color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 13px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .22s; max-width: 86vw;
}
.cp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.cp-toast.error { background: #8f2020; }

/* ---------- 登录 / 注册 / 安装 ---------- */
.public-body { min-height: 100vh; background: var(--bg); }
.public-wrap { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.public-hero {
  position: relative; overflow: hidden; padding: 54px 56px; color: #fff;
  background: linear-gradient(145deg, #4b3487 0%, #6750a4 48%, #9270d6 100%);
  display: flex; flex-direction: column; justify-content: center;
}
.brand-light { color: #fff; position: absolute; top: 36px; left: 56px; }
.brand-light .brand-mark { background: rgba(255, 255, 255, .18); box-shadow: none; }
.public-hero h2 { font-size: 40px; line-height: 1.25; margin-top: 40px; letter-spacing: 1px; }
.public-hero > p { font-size: 15px; opacity: .85; margin: 14px 0 34px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-size: 14px; opacity: .95; }
.hero-points li { display: flex; align-items: center; gap: 10px; }
.hero-points .icon { width: 19px; height: 19px; }
.hero-orbs i { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero-orbs i:nth-child(1) { width: 340px; height: 340px; right: -130px; bottom: -120px; }
.hero-orbs i:nth-child(2) { width: 180px; height: 180px; right: 120px; top: -70px; }
.hero-orbs i:nth-child(3) { width: 90px; height: 90px; right: 40px; bottom: 90px; background: rgba(255, 255, 255, .12); }
.public-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; }
.public-card { width: 100%; max-width: 400px; }
.public-card h1 { font-size: 26px; }
.public-card .sub { color: var(--muted); margin: 6px 0 26px; font-size: 13px; }
.public-card .form-row { margin-bottom: 16px; }
.public-card mdui-text-field { width: 100%; margin-bottom: 16px; }
.public-card .btn-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.public-card .link-row { display: flex; justify-content: space-between; margin-top: 22px; font-size: 13px; }
.public-foot { color: var(--muted); font-size: 12px; margin-top: 28px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--info-soft); color: var(--info); }

/* ---------- 公开外链页 / 安装向导 ---------- */
.share-body { min-height: 100vh; background: var(--bg); }
.share-topbar { height: 64px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; }
.share-main { max-width: 560px; margin: 54px auto; padding: 0 18px; }
.share-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 30px; }
.share-card .file-hero { display: flex; gap: 16px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.share-card .file-hero .file-icon { width: 58px; height: 58px; border-radius: 16px; font-size: 14px; }
.share-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 24px; }
.share-meta div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.share-meta span { display: block; color: var(--muted); font-size: 11px; }
.share-meta strong { font-size: 13.5px; }
.share-foot { text-align: center; color: var(--muted); font-size: 12px; padding-bottom: 30px; }
.install-wrap { max-width: 860px; margin: 40px auto 70px; padding: 0 18px; }
.install-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.install-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 26px 28px; }
.steps { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.step { flex: 1; min-width: 110px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; text-align: center; border: 1px solid var(--border); }
.step.active { background: var(--primary-soft); color: var(--primary); border-color: transparent; font-weight: 700; }
.step.done { background: var(--success-soft); color: var(--success); border-color: transparent; }
.check-list { list-style: none; padding: 0; margin: 0 0 20px; }
.check-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .topbar-area { display: none; }
  .topbar-link span { display: none; }
  .user-name { display: none; }
  .app-sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-mask.open { display: block; position: fixed; inset: 64px 0 0; background: rgba(20, 16, 34, .4); z-index: 35; }
  .app-main { margin-left: 0; padding: 20px 16px 60px; }
  .public-wrap { grid-template-columns: 1fr; }
  .public-hero { padding: 28px 26px 34px; min-height: 230px; }
  .public-hero h2 { font-size: 27px; margin-top: 46px; }
  .public-hero > p { margin-bottom: 18px; }
  .brand-light { position: static; margin-bottom: 10px; }
  .hero-points { gap: 8px; font-size: 12.5px; }
  .public-form { padding: 32px 22px; }
}
@media (max-width: 560px) {
  .page-heading h1 { font-size: 20px; }
  .panel { padding: 15px; }
  .toolbar mdui-text-field { width: 100%; }
  .toolbar > * { flex: 1 1 140px; }
  .share-meta { grid-template-columns: 1fr; }
  .share-main { margin: 24px auto; }
  .data-table th, .data-table td { padding: 10px 8px; }
}
