/* 云端版布局：桌面用顶部导航 + 居中内容，手机自动收窄 */

html, body {
  overflow: auto;
  height: auto;
  min-height: 100%;
  user-select: auto;
}

body { padding-bottom: 40px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 20px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.tb-left { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.tb-logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: #1f6feb; color: #fff;
  font-size: 12px; font-weight: 600; letter-spacing: .2px;
  display: flex; align-items: center; justify-content: center;
}
.tb-title { font-size: 13.5px; font-weight: 600; color: #14181f; }
.tb-title span { font-weight: 400; color: var(--sub); font-size: 12px; margin-left: 5px; }
.tb-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.tb-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--sub);
  background: #f4f5f7; border-radius: 20px; padding: 3px 10px;
  white-space: nowrap;
}
.tb-chip b { color: #3d434d; font-weight: 500; }
.tb-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; }
.tb-chip.warn i { background: var(--warn); }
.tb-right { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.tb-btn {
  height: 30px; padding: 0 12px; border-radius: 7px;
  border: 1px solid var(--line-strong); background: #fff; color: #3d434d;
  font-size: 12px; font-family: inherit; cursor: pointer;
  transition: background .12s;
}
.tb-btn:hover { background: #f6f7f9; }
.tb-btn.primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.tb-btn.primary:hover { background: #1a5fd0; }
.tb-btn.ghost { border-color: transparent; background: transparent; color: var(--sub); }
.tb-btn.ghost:hover { background: #f4f5f7; color: #3d434d; }
.tb-btn:disabled { opacity: .5; cursor: default; }

/* ---------------- 导航 ---------------- */
.nav {
  position: sticky; top: 56px; z-index: 39;
  display: flex; gap: 2px; overflow-x: auto;
  padding: 0 20px;
  background: #fff; border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav button {
  flex: 0 0 auto;
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12.5px; color: #5b6270;
  padding: 11px 13px 9px; border-bottom: 2px solid transparent;
  transition: color .12s;
  white-space: nowrap;
}
.nav button:hover { color: #23282f; }
.nav button.on { color: #1f6feb; border-bottom-color: #1f6feb; font-weight: 500; }
.nav .nav-badge {
  display: inline-block; margin-left: 5px;
  font-size: 10px; padding: 0 5px; border-radius: 8px;
  background: #fdf2f2; color: #c01017; vertical-align: 1px;
}

/* ---------------- 内容区 ---------------- */
.main { max-width: 1280px; margin: 0 auto; padding: 18px 20px 0; }
.pane { display: none; }
.pane.on { display: block; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------------- 筛选栏 ---------------- */
.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters select, .filters input[type="date"] {
  height: 30px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: #3d434d; font-size: 12px; font-family: inherit;
  padding: 0 8px; outline: none;
}
.filters select:focus, .filters input:focus { border-color: #9aa3b0; }
.filters .fsep { color: var(--sub2); font-size: 12px; }
.filters .fbtn {
  height: 30px; padding: 0 11px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line-strong); background: #fff; color: var(--sub);
  font-size: 12px; font-family: inherit;
}
.filters .fbtn:hover { background: #f6f7f9; color: #3d434d; }
.filters .fhint { margin-left: auto; font-size: 11.5px; color: var(--sub2); }

/* ---------------- 面板内通用 ---------------- */
.sec-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 600; color: #14181f;
  margin: 22px 0 11px;
}
.sec-title:first-child { margin-top: 0; }
.sec-title small { font-size: 11.5px; font-weight: 400; color: var(--sub2); }

/* ---------------- 设备与账号 ---------------- */
.two-col { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.dev-list { display: flex; flex-direction: column; gap: 9px; }
.dev-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px;
}
.dev-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.dev-name { font-size: 12.5px; font-weight: 500; color: #23282f; }
.dev-tag {
  margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 10px;
  background: #e9f8f0; color: #0b7a4b;
}
.dev-tag.stale { background: #fff4e5; color: #b25e09; }
.dev-tag.dead { background: #f1f3f6; color: #5b6270; }
.dev-meta { font-size: 11.5px; color: var(--sub); display: flex; gap: 10px; flex-wrap: wrap; }
.dev-meta b { color: #3d434d; font-weight: 500; }

.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 11px; }
.acc-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 9px;
}
.acc-top { display: flex; align-items: center; gap: 9px; }
.acc-ava {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: #f1f3f6; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #8a8f99; overflow: hidden;
}
.acc-ava img { width: 100%; height: 100%; object-fit: cover; }
.acc-name { font-size: 12.5px; font-weight: 500; color: #14181f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sub { font-size: 11px; color: var(--sub2); display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.acc-nums { display: flex; gap: 16px; padding-top: 3px; border-top: 1px solid var(--line); }
.acc-num span { display: block; font-size: 10.5px; color: var(--sub2); margin-bottom: 2px; }
.acc-num b { font-size: 14px; font-weight: 500; color: #23282f; font-variant-numeric: tabular-nums; }
.acc-foot { font-size: 11px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.plat-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.plat-dot.xhs { background: var(--xhs); }
.plat-dot.douyin { background: var(--dy); }

/* ---------------- 登录页 ---------------- */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #f6f7f9; padding: 24px;
}
.auth-card {
  width: 100%; max-width: 372px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 30px 28px 26px;
  box-shadow: 0 1px 2px rgba(20, 24, 32, .04), 0 12px 32px -12px rgba(20, 24, 32, .1);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-logo {
  width: 38px; height: 38px; border-radius: 10px; background: #1f6feb; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.auth-brand h1 { font-size: 15px; font-weight: 600; color: #14181f; }
.auth-brand p { font-size: 11.5px; color: var(--sub2); margin-top: 2px; }
.auth-tip {
  font-size: 11.5px; line-height: 1.7; color: #5b6270;
  background: #f6f7f9; border-radius: 8px; padding: 9px 11px; margin-bottom: 16px;
}
.auth-tip.err { background: #fdf2f2; color: #c01017; }
.auth-tip.ok { background: #e9f8f0; color: #0b7a4b; }
.field { display: block; margin-bottom: 13px; }
.field span { display: block; font-size: 11.5px; color: var(--sub); margin-bottom: 5px; }
.field input {
  width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 12px; font-size: 13px; font-family: inherit; color: #23282f; outline: none;
  background: #fff; transition: border-color .12s;
}
.field input:focus { border-color: #1f6feb; box-shadow: 0 0 0 3px rgba(31, 111, 235, .1); }
.auth-btn {
  width: 100%; height: 40px; margin-top: 6px;
  border: none; border-radius: 8px; cursor: pointer;
  background: #1f6feb; color: #fff; font-size: 13px; font-family: inherit; font-weight: 500;
  transition: background .12s;
}
.auth-btn:hover { background: #1a5fd0; }
.auth-btn:disabled { opacity: .6; cursor: default; }
.auth-foot { margin-top: 16px; font-size: 11px; color: var(--sub2); text-align: center; line-height: 1.7; }

/* ---------------- 抽屉 / 作品行 ---------------- */
.wrow { cursor: pointer; }
.wrow:hover td { background: #fafbfc; }

/* ---------------- 设置页 ---------------- */
.set-block { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.set-block h3 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.set-block p { font-size: 11.5px; color: var(--sub); line-height: 1.75; margin-bottom: 12px; }
.token-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.token-row:last-child { border-bottom: none; }
.token-val {
  font-family: Consolas, Menlo, monospace; font-size: 11.5px; color: #3d434d;
  background: #f6f7f9; border-radius: 5px; padding: 2px 6px; user-select: all;
}
.token-meta { margin-left: auto; font-size: 11px; color: var(--sub2); }
.copy-btn {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 6px;
  font-size: 11px; padding: 3px 9px; cursor: pointer; font-family: inherit; color: #5b6270;
}
.copy-btn:hover { background: #f6f7f9; }
.code-box {
  width: 100%; min-height: 120px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 10px 12px; font-family: Consolas, Menlo, monospace; font-size: 12px;
  line-height: 1.6; color: #3d434d; resize: vertical; outline: none; background: #fbfcfd;
}
.code-box:focus { border-color: #9aa3b0; }

/* ---------------- 空状态 ---------------- */
.empty-hint {
  text-align: center; padding: 60px 20px; color: var(--sub2); font-size: 12.5px; line-height: 2;
}
.empty-hint b { color: #5b6270; font-weight: 500; }
.empty-hint .mini-btn {
  margin-top: 12px; height: 30px; padding: 0 14px; border-radius: 7px;
  border: 1px solid var(--line-strong); background: #fff; cursor: pointer;
  font-size: 12px; font-family: inherit; color: #3d434d;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .main { padding: 14px 14px 0; }
  .topbar { padding: 0 14px; gap: 8px; }
  .nav { padding: 0 14px; top: 56px; }
  .tb-title span { display: none; }
  .tb-mid .tb-chip:nth-child(n+3) { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 13px; }
  .topbar { height: 52px; }
  .nav { top: 52px; }
  .tb-mid { display: none; }
  .tb-btn { padding: 0 9px; font-size: 11.5px; }
  .tb-btn.hide-sm { display: none; }
  .cards { gap: 8px; }
  .card { flex: 1 0 calc(50% - 8px); min-width: 0; padding: 11px 12px; }
  .card .v { font-size: 18px; }
  .acc-grid { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .rhythm-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .filters { gap: 6px; }
  .filters .fhint { width: 100%; margin-left: 0; }
  .table-wrap { border-radius: 10px; }
  .dw-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- 补充控件 ---------------- */
.f-input {
  height: 30px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: #3d434d; font-size: 12px; font-family: inherit;
  padding: 0 10px; outline: none; width: 180px; max-width: 100%;
}
.f-input:focus { border-color: #9aa3b0; }

.pulse-row { padding-bottom: 4px; }
.pulse-row + .pulse-row { border-top: 1px solid var(--line); padding-top: 13px; }

@media (max-width: 640px) {
  .f-input { width: 100%; }
  .token-row { flex-wrap: wrap; }
  .token-meta { margin-left: 0; width: 100%; }
  .period-row { grid-template-columns: 62px 1fr auto; }
  .period-row .pv { display: none; }
}
