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

:root {
  --blue: #2b6cff;
  --blue-d: #1f5be0;
  --ink: #1f2329;
  --ink-2: #5b626d;
  --ink-3: #8a909a;
  --line: #e9ecf1;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --danger: #e5484d;
}

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

img { border: 0; }
input, button, select { font-family: inherit; font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 18px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 600; cursor: pointer; transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: #cfd6e2; color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(43, 108, 255, .2); }
.btn.primary:hover { background: var(--blue-d); color: #fff; }
.btn.ghost { background: #fff; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; margin-top: 14px; height: 42px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.linkbtn {
  border: 0; background: none; color: var(--blue); font-size: 13px;
  cursor: pointer; padding: 0 4px; font-weight: 600;
}
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--danger); }

/* ---------- 登录 ---------- */
.login-wrap {
  display: none; min-height: 100vh; align-items: center; justify-content: center;
  background: radial-gradient(700px 420px at 50% 0%, #e9f0ff 0%, rgba(233, 240, 255, 0) 70%), var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 16px;
  padding: 30px 26px 24px; box-shadow: 0 16px 40px rgba(31, 35, 41, .1);
}
.brandline { display: flex; align-items: center; gap: 10px; }
.brandline img { width: 26px; height: 26px; border-radius: 6px; }
.brandline .brand { font-weight: 700; letter-spacing: .5px; }
.login-card h1 { margin-top: 18px; font-size: 24px; font-weight: 800; }
.login-card .sub { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

/* www 一键登录：账号体系只认授权站，这里放最上面 */
.sso-btn { display: flex; align-items: center; justify-content: center; margin-top: 18px; height: 42px; text-decoration: none; }
.sso-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; color: var(--ink-3); font-size: 12px; }
.sso-or::before, .sso-or::after { content: ''; flex: 1; height: 1px; background: #eceef1; }

.login-tabs {
  display: flex; gap: 4px; margin: 20px 0 16px; padding: 4px;
  background: #f2f4f7; border-radius: 10px;
}
.login-tab {
  flex: 1; height: 34px; border: 0; border-radius: 8px; background: none;
  color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.login-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(31, 35, 41, .08); }

.pane input {
  width: 100%; height: 42px; margin-bottom: 10px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; outline: none;
}
.pane input:focus { border-color: var(--blue); background: #fff; }
.phone-row { display: flex; gap: 8px; }
.phone-row input { flex: 1; }
.sms-btn { height: 42px; padding: 0 12px; margin-bottom: 10px; font-size: 13px; }

.qr-box {
  width: 100%; height: 236px; border-radius: 12px; background: #f7f9fc;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.qr-box canvas { width: 220px; height: 220px; }
.qr-placeholder { font-size: 13px; color: var(--ink-3); text-align: center; padding: 0 20px; }
.qr-tip { margin: 12px 0 4px; font-size: 12.5px; color: var(--ink-2); text-align: center; }
.qr-refresh { width: 100%; }

.tip { margin-top: 12px; font-size: 12.5px; color: var(--danger); min-height: 18px; }

/* ---------- 主界面骨架 ---------- */
#app { display: none; height: 100vh; grid-template-columns: 218px 1fr; }

.side {
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px;
}
.side-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 18px; font-weight: 800; letter-spacing: .5px; }
.side-brand img { width: 26px; height: 26px; border-radius: 6px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 9px; color: var(--ink-2); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: .15s; text-decoration: none;
}
.nav-item:hover { background: #f5f7fb; color: var(--ink); }
.nav-item.active { background: rgba(43, 108, 255, .09); color: var(--blue); }
.nav-item svg { width: 18px; height: 18px; stroke: currentColor; flex: 0 0 auto; }
/* 小屏专用退出入口：桌面端不显示 */
.nav-out { display: none; border: 0; background: none; text-align: left; font: inherit; }
.nav-out span { display: none; }

.side-user { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); }
.u-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan { padding: 2px 7px; border-radius: 6px; background: rgba(43, 108, 255, .09); color: var(--blue); font-size: 11px; font-weight: 700; }
.u-name { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quota-bar { height: 5px; margin: 10px 0 6px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.quota-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2b6cff, #6f9bff); border-radius: 99px; }
.quota-text { font-size: 11.5px; color: var(--ink-3); margin-bottom: 10px; }
.side-user .btn { width: 100%; }

.content { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.head {
  display: flex; align-items: center; gap: 16px; padding: 14px 24px;
  background: #fff; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.head-title { font-size: 17px; font-weight: 800; white-space: nowrap; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 9px; background: #f5f7fa; border: 1px solid transparent;
  transition: .16s; width: 260px;
}
.search:focus-within { border-color: var(--blue); background: #fff; }
.search svg { width: 16px; height: 16px; stroke: var(--ink-3); }
.search input { flex: 1; border: 0; background: none; outline: none; }

.pane-view { flex: 1; overflow: auto; padding: 18px 24px 26px; }

.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 12px; min-height: 18px; }
.crumb a { color: var(--ink-2); cursor: pointer; }
.crumb a:hover { color: var(--blue); }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sel { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-2); outline: none; }
.batch {
  display: flex; align-items: center; gap: 6px; margin-left: 6px;
  padding: 6px 12px; border-radius: 9px; background: rgba(43, 108, 255, .08); font-size: 12.5px; color: var(--blue);
}
.batch b { font-weight: 700; }

.section-note {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2);
}
.share-cap { color: var(--blue); font-weight: 600; white-space: nowrap; }

/* ---------- 表格 ---------- */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.files { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.files th {
  padding: 11px 12px; font-size: 12px; font-weight: 600; color: var(--ink-3);
  text-align: left; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.files td { padding: 11px 12px; border-bottom: 1px solid #f2f4f8; font-size: 13.5px; vertical-align: middle; }
table.files tbody tr:last-child td { border-bottom: 0; }
table.files tbody tr:hover { background: #fbfcff; }
table.files tbody tr.selected { background: rgba(43, 108, 255, .05); }
.col-check { width: 42px; }
.col-size { width: 96px; }
.col-time { width: 140px; }
.col-op { width: 258px; }
.col-link { width: 250px; }
.col-code { width: 86px; }
.col-down { width: 92px; }
.col-status { width: 96px; }

td.name { display: flex; align-items: center; gap: 9px; overflow: hidden; }
td.name .nmwrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
td.name .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.name .sub { font-size: 11px; line-height: 1.2; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.name .ico { width: 19px; height: 19px; flex: 0 0 auto; }
td.name .starred { color: #f5a623; font-size: 12px; }

.muted { color: var(--ink-3); }
td .lnk { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); }
.ops { display: flex; gap: 2px; flex-wrap: wrap; }

.status {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.st-active { background: rgba(43, 108, 255, .09); color: var(--blue); }
.st-expired { background: #f1f2f4; color: var(--ink-3); }
.st-full { background: rgba(245, 166, 35, .12); color: #b9810f; }

.empty { display: none; padding: 46px 0; text-align: center; font-size: 13px; color: var(--ink-3); }

/* ---------- 上传队列 ---------- */
.queue {
  display: none; position: fixed; right: 24px; bottom: 24px; width: 320px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(31, 35, 41, .16); z-index: 40; overflow: hidden;
}
.queue-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600;
}
.queue-head b { color: var(--blue); }
#queueList { max-height: 260px; overflow: auto; }
.q-item { padding: 9px 14px; border-bottom: 1px solid #f4f6f9; }
.q-item.error .q-pct { color: var(--danger); }
.q-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-pct { color: var(--ink-3); white-space: nowrap; }
.q-bar { height: 4px; margin-top: 6px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.q-bar span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: .2s; }

.drop-mask {
  display: none; position: fixed; inset: 0; z-index: 50; background: rgba(43, 108, 255, .12);
  border: 3px dashed var(--blue); align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: var(--blue);
}

/* ---------- 弹窗 / toast ---------- */
.modal {
  display: none; position: fixed; inset: 0; z-index: 60; background: rgba(19, 24, 33, .45);
  align-items: center; justify-content: center; padding: 24px;
}
.modal-card {
  width: 100%; max-width: 460px; background: #fff; border-radius: 14px;
  padding: 22px 22px 18px; box-shadow: 0 24px 60px rgba(19, 24, 33, .28);
  max-height: 86vh; overflow: auto;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.modal-body input, .modal-body select {
  width: 100%; height: 40px; padding: 0 12px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; outline: none;
}
.modal-body input:focus, .modal-body select:focus { border-color: var(--blue); background: #fff; }
.modal-body label { display: block; font-size: 12px; color: var(--ink-3); margin: 4px 0 5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.kv { font-size: 13.5px; line-height: 1.9; color: var(--ink-2); word-break: break-all; }
.kv b { color: var(--ink); }

.toast {
  display: none; position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 10px; background: rgba(31, 35, 41, .92); color: #fff;
  font-size: 13px; z-index: 70; max-width: 80vw;
}

/* ---------- 小屏 ---------- */
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  /* 小屏把品牌、导航、退出收成一行，别让顶部吃掉半屏 */
  .side { flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
  .side-brand { padding: 0; flex: 0 0 auto; }
  .side-brand span { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 2px; flex: 1 1 auto; min-width: 0; max-width: calc(100% - 110px); }
  .nav-item { padding: 8px 10px; white-space: nowrap; }
  .side-user { display: none; }
  .nav-out { display: flex; align-items: center; color: var(--ink-3); }
  .head { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .search { width: 100%; order: 3; margin-left: 0; }
  .pane-view { padding: 12px 14px 20px; }
  /* 手机上先看名字和操作，大小/时间收起来，避免表格横向滚半天 */
  table.files { min-width: 0; }
  table.files .col-size, table.files .col-time { display: none; }
  .col-op { width: 170px; }
  .ops { font-size: 12.5px; gap: 0; }
  .table-wrap { overflow-x: auto; }
}

.qr-mini { margin-top: 12px; height: 200px; }
.qr-mini canvas { width: 180px; height: 180px; }

/* hidden 属性优先于 flex/grid 布局声明，避免隐藏元素仍占位 */
[hidden] { display: none !important; }
#file { display: none; }



#modalBody .kv div { word-break: break-all; line-height: 1.6; }
