/* =============================================================================
   短剧提现 · 设计系统
   移植自参考项目的设计语言：品牌橙 #ff6900、四级墨色、四级阴影、四级圆角。
   零构建，纯 CSS 变量驱动；移动端 860 / 520 两个断点。
   ========================================================================== */

:root {
  --brand: #ff6900;
  --brand-dark: #c2410c;
  --brand-soft: #fff4ec;
  --brand-line: #ffd9bf;
  --brand-fill: #c2410c;

  --ok: #067647;
  --ok-soft: #e7f8f0;
  --warn: #b54708;
  --warn-soft: #fef4e6;
  --err: #b42318;
  --err-soft: #feeceb;
  --err-line: #fecdca;

  --ink-1: #0d1117;
  --ink-2: #344054;
  --ink-3: #475467;
  --ink-4: #667085;

  --line: #e9ebef;
  --line-soft: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --bg: #f5f6f8;

  --r-xs: 6px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-full: 999px;

  --e-1: 0 1px 2px rgba(13, 17, 23, .04), 0 1px 1px rgba(13, 17, 23, .03);
  --e-2: 0 2px 4px rgba(13, 17, 23, .04), 0 4px 12px -2px rgba(13, 17, 23, .06);
  --e-3: 0 4px 8px rgba(13, 17, 23, .05), 0 12px 28px -6px rgba(13, 17, 23, .1);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 160ms;

  --header-h: 56px;
  --page-max: 1340px;
  --pad-x: 20px;

  color-scheme: light;
}

/* hidden 属性必须生效：类选择器里的 display 会压过浏览器默认的 [hidden] */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink-1);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

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

.muted { color: var(--ink-4); }
.center { text-align: center; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: -.2px;
}
.num { font-variant-numeric: tabular-nums; text-align: right; }
.grow { flex: 1 1 auto; }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--page-max); margin: 0 auto; height: 100%;
  padding: 0 var(--pad-x);
  display: flex; align-items: center; gap: 18px;
}
.brand {
  font-weight: 700; font-size: 15px; color: var(--ink-1);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); display: inline-block;
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 11px; border-radius: var(--r-sm); color: var(--ink-3);
  font-size: 14px; white-space: nowrap; transition: background var(--dur) var(--ease);
}
.nav a:hover { background: var(--line-soft); text-decoration: none; }
.nav a.on { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.who em {
  font-style: normal; font-size: 11px; color: var(--brand-dark);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  padding: 1px 6px; border-radius: var(--r-full); margin-left: 4px;
}

/* ---------------------------------------------------------------- 页面骨架 */
.page {
  max-width: var(--page-max); margin: 0 auto;
  padding: 20px var(--pad-x) 48px;
}
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.page-head h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.page-head .desc { color: var(--ink-4); font-size: 13px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--e-1);
  margin-bottom: 14px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 15px; }
.card-head .sub { color: var(--ink-4); font-size: 12.5px; }
.card-body { padding: 14px 16px; }

/* ---------------------------------------------------------------- 统计卡 */
.stats {
  display: grid; gap: 12px; margin-bottom: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 15px; box-shadow: var(--e-1);
}
.stat-k { font-size: 12.5px; color: var(--ink-4); }
.stat-v {
  font-size: 24px; font-weight: 700; letter-spacing: -.6px;
  margin-top: 2px; font-variant-numeric: tabular-nums;
}
.stat-s { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.tone-brand .stat-v { color: var(--brand-dark); }
.tone-ok .stat-v { color: var(--ok); }
.tone-err .stat-v { color: var(--err); }

/* ---------------------------------------------------------------- 标签页 */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  margin-bottom: 16px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 10px 14px; font-size: 14px; color: var(--ink-4);
  border-bottom: 2px solid transparent; white-space: nowrap;
  font-family: inherit; transition: color var(--dur) var(--ease);
}
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------------------------------------------------------------- 表单控件 */
input, select, textarea {
  font: inherit; color: var(--ink-1); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 10px; width: 100%; min-width: 0;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: none; padding-right: 26px; }
label.field { display: block; font-size: 12.5px; color: var(--ink-4); }
label.field > span { display: block; margin-bottom: 4px; }
label.field > input, label.field > select, label.field > textarea { margin-top: 0; }

/* ---------------------------------------------------------------- 工具条 */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.toolbar .field { width: 150px; }
.toolbar .field.wide { width: 220px; }
.toolbar .spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  appearance: none; font: inherit; font-size: 14px; cursor: pointer;
  padding: 8px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--line-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--brand-fill); border-color: var(--brand-fill); color: #fff;
  box-shadow: 0 6px 18px -8px rgba(255, 105, 0, .6);
}
.btn-primary:hover { background: #a8380a; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-danger { color: var(--err); border-color: var(--err-line); background: var(--err-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 表格 */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td {
  padding: 10px 12px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--line-soft); vertical-align: middle;
}
.tbl th {
  font-size: 12px; font-weight: 600; color: var(--ink-4);
  background: var(--surface-2); position: sticky; top: 0; z-index: 1;
}
.tbl tbody tr:hover { background: var(--brand-soft); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.wrap { white-space: normal; min-width: 140px; }
.empty { padding: 34px 12px; text-align: center; color: var(--ink-4); font-size: 13.5px; }

/* ---------------------------------------------------------------- 徽标 */
.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px;
  border-radius: var(--r-full); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-3); line-height: 1.4;
}
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: #bfe6d4; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #fbe2bd; }
.badge.err { color: var(--err); background: var(--err-soft); border-color: var(--err-line); }
.badge.acc { color: var(--brand-dark); background: var(--brand-soft); border-color: var(--brand-line); }

/* ---------------------------------------------------------------- 备注格 */
.note-cell {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}
.note-cell:hover { color: var(--brand-dark); }
.note-empty { color: var(--ink-4); font-size: 12.5px; }

/* ---------------------------------------------------------------- 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(13, 17, 23, .5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--e-3); width: 100%; max-width: 720px;
  max-height: 88vh; display: flex; flex-direction: column;
  animation: pop var(--dur) var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-body label.field { margin-bottom: 10px; }

/* ---------------------------------------------------------------- 提示 */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 80;
  transform: translate(-50%, 20px);
  background: var(--ink-1); color: #fff;
  padding: 10px 16px; border-radius: var(--r-full);
  font-size: 13.5px; box-shadow: var(--e-3);
  opacity: 0; pointer-events: none; max-width: 88vw; text-align: center;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #054f31; }
.toast.err { background: #7a1a13; }

/* ---------------------------------------------------------------- 登录/注册 */
.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: flex; align-items: center; justify-content: center; padding: 28px 16px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--e-2);
  padding: 26px 22px; width: 100%; max-width: 372px;
}
.auth-card h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.3px; }
.auth-card label.field { margin: 14px 0; }
.auth-card .btn-block { margin-top: 6px; padding: 10px; }

/* ---------------------------------------------------------------- 穿透栏 */
.tunnel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 13.5px; flex-wrap: wrap;
}
.tunnel-row .mono { word-break: break-all; }

.foot {
  text-align: center; color: var(--ink-4); font-size: 12px;
  padding: 18px 12px 26px;
}

/* ---------------------------------------------------------------- 移动端 */
@media (max-width: 860px) {
  :root { --pad-x: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 11px 12px; }
  .stat-v { font-size: 20px; }
  .topbar-in { gap: 10px; }
  .brand span.full { display: none; }
  .toolbar { padding: 10px 12px; gap: 8px; }
  .toolbar .field, .toolbar .field.wide { width: calc(50% - 4px); }
  .card-head { padding: 12px; flex-wrap: wrap; }
  .modal { max-height: 92vh; }
  .who { display: none; }
  /* 次要列在小屏隐藏，避免横向滚动里全是低价值信息 */
  .opt { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .page-head h2 { font-size: 17px; }
  .toolbar .field, .toolbar .field.wide { width: 100%; }
  .tbl th, .tbl td { padding: 9px 10px; }
  .btn { padding: 8px 12px; }
  .modal-body { padding: 12px; }
}
