/* ============================================================
   站群控制台 · iOS 风格设计系统
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --blue: #007aff;
  --blue-soft: rgba(0, 122, 255, .12);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, .14);
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, .14);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, .12);
  --purple: #af52de;
  --purple-soft: rgba(175, 82, 222, .14);
  --teal: #30b0c7;

  --bg: #f2f2f7;
  --bg-elevated: rgba(255, 255, 255, .82);
  --card: #ffffff;
  --card-2: #f7f7fa;
  --label: #000000;
  --label-2: rgba(60, 60, 67, .60);
  --label-3: rgba(60, 60, 67, .36);
  --sep: rgba(60, 60, 67, .16);
  --fill: rgba(120, 120, 128, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .06);
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 12px;
  --nav-h: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-decoration: none; }
h1, h2, h3, p, ul, ol, li, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
code { font-family: var(--mono); font-size: .86em; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ============================ 布局 ============================ */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 262px;
  height: 100vh;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--sep);
  background: var(--bg-elevated);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

.side-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; }
.brand-dot {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(160deg, #4facfe, #007aff 60%, #5e5ce6);
  box-shadow: 0 4px 12px rgba(0, 122, 255, .35);
  position: relative;
}
.brand-dot::after {
  content: ""; position: absolute; inset: 9px;
  border-radius: 4px; border: 2px solid rgba(255, 255, 255, .9);
  border-bottom-color: transparent; border-right-color: transparent;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: -.2px; }
.brand-text span { font-size: 11.5px; color: var(--label-2); }

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--label); font-size: 15px; font-weight: 500;
  transition: background .18s ease, transform .18s ease;
}
.side-item .ico { width: 19px; height: 19px; color: var(--label-2); }
.side-item:hover { background: var(--fill); }
.side-item.is-active { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(0, 122, 255, .28); }
.side-item.is-active .ico { color: #fff; }

.side-foot { margin-top: auto; }
.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 14px; background: var(--card);
  box-shadow: var(--shadow);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #8e8e93, #3a3a3c);
  color: #fff; font-weight: 600; font-size: 15px;
}
.side-user-meta { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.side-user-meta strong { font-size: 13.5px; }
.side-user-meta span { font-size: 11.5px; color: var(--label-2); }
.mini-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--label-2); }
.mini-btn:hover { background: var(--fill); color: var(--red); }

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

.navbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg-elevated);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--sep);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; min-height: var(--nav-h);
  padding: 10px 22px; display: flex; align-items: center; gap: 14px;
}
.nav-titles { flex: 1; min-width: 0; }
.nav-titles h1 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.nav-titles p { font-size: 12.5px; color: var(--label-2); margin-top: 1px; }
.nav-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; border: 0; border-radius: 10px;
  display: grid; place-items: center; background: var(--fill);
  color: var(--label); cursor: pointer; transition: transform .16s ease, background .16s ease;
}
.icon-btn:hover { background: var(--sep); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ico { width: 18px; height: 18px; }

.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 22px 56px; }

/* ============================ 通用组件 ============================ */

.ico { width: 20px; height: 20px; flex: none; }
.ico.big { width: 34px; height: 34px; }

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.card-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -.2px; }

.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--blue); font-size: 13.5px; font-weight: 500;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border: 0; border-radius: 12px;
  font-size: 14.5px; font-weight: 550; cursor: pointer;
  background: var(--fill); color: var(--label);
  transition: transform .15s ease, filter .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(0, 122, 255, .28); }
.btn-ghost { background: var(--fill); color: var(--label); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; height: 46px; font-size: 16px; font-weight: 600; border-radius: 14px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.flash {
  border-radius: 14px; padding: 12px 15px; margin-bottom: 14px;
  font-size: 14px; font-weight: 500;
  background: var(--green-soft); color: #1c7a35;
  border: 1px solid rgba(52, 199, 89, .22);
  animation: dropIn .3s cubic-bezier(.32, .72, 0, 1);
}
.flash-err { background: var(--red-soft); color: #c4291f; border-color: rgba(255, 59, 48, .22); }

@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .1px;
}
.badge-soft { background: var(--fill); color: var(--label-2); }
.badge-off { background: var(--red-soft); color: var(--red); }
.pill-count {
  min-width: 28px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}

.muted-sm { font-size: 12.5px; color: var(--label-2); }

/* ============================ 概览 ============================ */

.stat-grid {
  display: grid; gap: 12px; margin-bottom: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat-card {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: var(--radius-lg);
  padding: 16px 16px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-card::before {
  content: ""; position: absolute; right: -26px; top: -30px;
  width: 84px; height: 84px; border-radius: 50%; opacity: .16;
  background: currentColor;
}
.stat-card.accent-blue { color: var(--blue); }
.stat-card.accent-green { color: var(--green); }
.stat-card.accent-purple { color: var(--purple); }
.stat-card.accent-orange { color: var(--orange); }
.stat-label { font-size: 12.5px; color: var(--label-2); font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; color: var(--label); line-height: 1.15; }
.stat-foot { font-size: 11.5px; color: var(--label-3); }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.chart-bar {
  width: 100%; max-width: 54px; margin: 0 auto; border-radius: 8px 8px 5px 5px;
  background: linear-gradient(180deg, var(--blue), rgba(0, 122, 255, .45));
  min-height: 3px; transition: height .5s cubic-bezier(.32, .72, 0, 1);
}
.chart-n { font-size: 11px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.chart-x { font-size: 11px; color: var(--label-3); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.two-col > .card { margin-bottom: 16px; }

.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px; cursor: pointer;
  border-bottom: 1px solid var(--sep);
}
.list-row:last-child { border-bottom: 0; }
.list-row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-size: 14.5px; font-weight: 550; display: flex; align-items: center; gap: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub { font-size: 12px; color: var(--label-2); margin-top: 1px; }
.dot-site { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.chev { color: var(--label-3); }
.chev .ico { width: 16px; height: 16px; }
.rank {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--fill); color: var(--label-2);
}
.list-row:nth-child(1) .rank { background: var(--orange-soft); color: var(--orange); }

.empty { padding: 34px 12px; text-align: center; color: var(--label-2); font-size: 13.5px; }
.empty.small { padding: 18px; }
.empty-ico {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px;
  display: grid; place-items: center; background: var(--fill); color: var(--label-2);
}
.empty-ico .ico { width: 24px; height: 24px; }
.empty p { margin-bottom: 14px; line-height: 1.55; }

.hint-card h2 { font-size: 15.5px; margin-bottom: 10px; }
.steps { display: flex; flex-direction: column; gap: 9px; counter-reset: s; }
.steps li {
  counter-increment: s; position: relative; padding-left: 30px;
  font-size: 13.5px; color: var(--label-2); line-height: 1.55;
}
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 6px; background: var(--blue-soft);
  color: var(--blue); font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center;
}
.steps b { color: var(--label); font-weight: 600; }
.steps code { background: var(--fill); padding: 1px 5px; border-radius: 5px; word-break: break-all; overflow-wrap: anywhere; font-size: .92em; }

/* ============================ 站点 ============================ */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar.compact { margin-bottom: 10px; }

.seg {
  display: inline-flex; padding: 3px; border-radius: 12px; background: var(--fill); gap: 2px;
}
.seg-item {
  border: 0; background: transparent; cursor: pointer;
  height: 32px; padding: 0 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 550; color: var(--label-2);
  transition: background .18s ease, color .18s ease;
}
.seg-item span { opacity: .6; font-weight: 500; }
.seg-item.is-active {
  background: var(--card); color: var(--label);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.site-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 440px)); min-width: 0; }
.site-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.site-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.site-name { font-size: 16px; font-weight: 650; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; }
.site-host { font-size: 12px; color: var(--label-2); margin-top: 3px; }
.site-kpi { text-align: right; }
.site-kpi strong { font-size: 22px; font-weight: 700; letter-spacing: -.6px; }
.site-kpi span { font-size: 11px; color: var(--label-2); margin-left: 2px; }

.snippet-box {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--card-2); border: 1px solid var(--sep);
  border-radius: var(--radius-sm); padding: 9px 9px 9px 12px;
}
.snippet-box code {
  flex: 1; min-width: 0; font-size: 11.5px; color: var(--label-2); line-height: 1.4;
  max-height: 2.8em; overflow: hidden; word-break: break-all;
}
.site-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--label-3); gap: 8px; }
.site-meta code { color: var(--label-2); }
.site-actions { display: flex; gap: 8px; }
.site-actions .btn { flex: 1; height: 34px; font-size: 13px; }

/* ============================ 记录 ============================ */

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--sep);
}
.search .ico { width: 17px; height: 17px; color: var(--label-3); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 14.5px; color: var(--label); font-family: inherit;
}
.select {
  height: 40px; padding: 0 10px; border-radius: 12px; font-size: 13.5px;
  background: var(--card); border: 1px solid var(--sep); color: var(--label);
  font-family: inherit; outline: none; max-width: 100%;
}

.log-list {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.log-table-head { display: none; }
.log-row {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 15px; cursor: pointer;
  border-bottom: 1px solid var(--sep);
}
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: var(--card-2); }
.log-row.is-unread::before {
  content: ""; position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--blue);
}
.lg-cred { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.lg-user { font-size: 15px; font-weight: 600; letter-spacing: -.2px; word-break: break-all; }
.lg-pass {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--fill); border-radius: 8px; padding: 1px 4px 1px 8px;
  font-family: var(--mono); font-size: 12px; color: var(--label-2);
  max-width: 100%; overflow: hidden;
}
.pw-real { word-break: break-all; color: var(--label); }
.eye { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--label-3); display: grid; place-items: center; }
.eye .ico { width: 15px; height: 15px; }
.eye:hover { color: var(--blue); }

.lg-site, .lg-host, .lg-ip { display: none; font-size: 12px; color: var(--label-2); }
.lg-time {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  margin-left: auto; font-size: 12px; color: var(--label-2); line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.lg-ago { font-size: 10.5px; color: var(--label-3); }
.lg-chev { color: var(--label-3); display: none; }
.lg-chev .ico { width: 16px; height: 16px; }

@media (min-width: 780px) {
  .log-table-head {
    display: grid; grid-template-columns: 26px 1.55fr .78fr 1.4fr .7fr .78fr 24px;
    gap: 12px; padding: 11px 16px; font-size: 11.5px; font-weight: 600;
    color: var(--label-3); text-transform: uppercase; letter-spacing: .4px;
    border-bottom: 1px solid var(--sep); background: var(--card-2);
  }
  .log-row {
    display: grid; grid-template-columns: 26px 1.55fr .78fr 1.4fr .7fr .78fr 24px;
    gap: 12px; align-items: center;
  }
  .lg-cred { flex: none; }
  .lg-host, .lg-ip { display: inline-flex; }
  .lg-site { display: block; }
  .lg-time { margin-left: 0; flex-direction: column; align-items: flex-start; }
  .lg-chev { display: block; }
  .lg-pass .pw-mask, .lg-pass .pw-real { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 0; }

/* ============================ 表单 ============================ */

.form-stack { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--label-2); font-weight: 500; padding-left: 2px; }
.field input, .field textarea {
  height: 44px; padding: 0 14px; border-radius: 12px; font-size: 15px;
  background: var(--card-2); border: 1px solid transparent; color: var(--label);
  outline: none; font-family: inherit; transition: border-color .16s ease, background .16s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--blue); background: var(--card); }
.field input::placeholder { color: var(--label-3); }
.form-tip { font-size: 12px; color: var(--label-2); line-height: 1.55; }

.kv { display: flex; flex-direction: column; }
.kv li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--sep); font-size: 13.5px;
}
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--label-2); }
.kv b { font-weight: 550; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px; font-size: 14.5px; cursor: pointer;
}
.switch-row input { display: none; }
.switch {
  width: 46px; height: 28px; border-radius: 999px; background: var(--sep);
  position: relative; transition: background .22s ease; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
  transition: transform .22s cubic-bezier(.32, .72, 0, 1);
}
.switch-row input:checked + .switch { background: var(--green); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }

.field-readonly {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card-2); border-radius: 12px; padding: 10px 12px;
}
.field-readonly > span { font-size: 12px; color: var(--label-2); }
.field-readonly code { font-size: 11.5px; color: var(--label-2); word-break: break-all; }

.danger-zone { border: 1px solid rgba(255, 59, 48, .25); }
.sheet-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sheet-btn-row .btn { flex: 1; }

/* ============================ 登录页 ============================ */

.plain-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 18px;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(0, 122, 255, .16), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(175, 82, 222, .14), transparent 60%),
    var(--bg);
}
.auth-wrap { width: 100%; display: flex; justify-content: center; }
.auth-card {
  width: min(400px, 100%);
  background: var(--card); border-radius: 26px; padding: 30px 24px 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05), 0 24px 60px rgba(0, 0, 0, .12);
  border: 1px solid var(--sep);
  animation: authIn .45s cubic-bezier(.32, .72, 0, 1);
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.auth-icon {
  width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 14px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, #4facfe, #007aff 62%, #5e5ce6);
  box-shadow: 0 10px 24px rgba(0, 122, 255, .32);
}
.auth-card h1 { font-size: 22px; text-align: center; letter-spacing: -.4px; }
.auth-sub { text-align: center; font-size: 13px; color: var(--label-2); margin: 4px 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .field input { height: 46px; }
.auth-foot { text-align: center; font-size: 11.5px; color: var(--label-3); margin-top: 16px; }

/* ============================ Sheet / Toast ============================ */

.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-mask {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .34);
  backdrop-filter: blur(2px); animation: fadeIn .22s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--card); border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .22);
  animation: sheetUp .34s cubic-bezier(.32, .72, 0, 1);
  -webkit-overflow-scrolling: touch;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grab { width: 38px; height: 5px; border-radius: 99px; background: var(--sep); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.sheet-form { display: flex; flex-direction: column; gap: 12px; }
.sheet-body .detail { display: flex; flex-direction: column; gap: 2px; }
.detail-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--sep);
}
.detail-row:last-child { border-bottom: 0; }
.detail-k { width: 76px; flex: none; font-size: 12.5px; color: var(--label-2); padding-top: 2px; }
.detail-v { flex: 1; min-width: 0; font-size: 14px; word-break: break-all; }
.detail-v code { font-size: 12.5px; }
.detail-v .big-val { font-size: 16px; font-weight: 600; }
.mini-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.mini-actions .btn { flex: 1; min-width: 120px; }

.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: rgba(30, 30, 32, .94); color: #fff;
  padding: 10px 18px; border-radius: 14px; font-size: 13.5px; font-weight: 500;
  z-index: 200; opacity: 0; transition: opacity .22s ease, transform .22s ease;
  backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================ 底部标签栏 ============================ */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; align-items: stretch;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--bg-elevated);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--sep);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; border-radius: 12px; color: var(--label-3);
  font-size: 10.5px; font-weight: 500;
}
.tab .ico { width: 22px; height: 22px; }
.tab.is-active { color: var(--blue); }

/* ============================ 响应式 ============================ */

@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .tabbar { display: flex; }
  .page { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); }
  .nav-inner { padding: 8px 16px; min-height: 52px; }
  .nav-titles h1 { font-size: 20px; }
  .nav-titles p { font-size: 12px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px 14px 12px; border-radius: 18px; }
  .stat-value { font-size: 26px; }
  .card { border-radius: 18px; padding: 16px 15px 14px; }
  .site-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 8px; }
  .search { min-width: 100%; }
  .select { flex: 1 1 44%; }
  .log-list { border-radius: 18px; }
  .log-row { padding: 13px 15px; }
  .lg-time { font-size: 11px; }
  .site-actions .btn { height: 36px; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 24px; }
  .toolbar .btn-primary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* 打印/滚动细节 */
::selection { background: rgba(0, 122, 255, .22); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--sep); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }


/* ============ 移动端细节修正（后置覆盖） ============ */
@media (max-width: 900px) {
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
  .filter-bar .search { grid-column: 1 / -1; min-width: 0; }
  .filter-bar .select { width: 100%; min-width: 0; max-width: none; flex: none; }
  .filter-bar .btn { height: 40px; }
  .log-row { gap: 6px 10px; }
  .lg-cred { flex: 1 1 100%; }
  .lg-time { margin-left: 0; flex-direction: row; align-items: center; gap: 6px; font-size: 11.5px; }
  .lg-ago::before { content: "· "; }
  .chart { height: 128px; }
  .chart-bar.is-zero { background: var(--fill); }
}

.two-col > * { min-width: 0; }
.chart-bar.is-zero { background: var(--fill); border-radius: 6px; }
pre, code { max-width: 100%; }





/* ---- 接入代码卡片里的域名/上报地址行 ---- */
.site-meta { flex-wrap: wrap; min-width: 0; }
.site-meta span { min-width: 0; }
.site-meta code { word-break: break-all; overflow-wrap: anywhere; }
.card > .snippet-box { margin-top: 12px; }

/* ---- 长 URL / 代码换行优化 ---- */
.snippet-box code { word-break: break-word; }
.lg-host { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 移动端记录行：显示来源域名 ---- */
@media (max-width: 779px) {
  .lg-site { display: inline-flex; margin: -2px 0 0; }
  .lg-site .badge { font-size: 11px; background: var(--fill); color: var(--label-2); }
}



/* ---- 域名标签不换行 ---- */
.lg-site .badge { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }

/* ============================================================
 *  本地字体图标（assets/icons.css）尺寸修正 —— 覆盖原 SVG 规则
 * ========================================================== */
i.ico {
  width: auto; height: auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; line-height: 1; flex: none;
}
.ico.big { font-size: 31px; }
.side-item .ico { font-size: 19px; }
.icon-btn .ico { font-size: 18px; }
.mini-btn .ico { font-size: 15px; }
.chev .ico, .lg-chev .ico { font-size: 15px; }
.empty-ico .ico { font-size: 23px; }
.search .ico { font-size: 17px; }
.eye .ico { font-size: 15px; }
.tab .ico { font-size: 21px; }
.auth-icon .ico { font-size: 30px; }
.brand-dot {
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.brand-dot::after { display: none; }
.brand-dot .ico { font-size: 17px; }

.stat-ico { position: absolute; right: 18px; top: 19px; font-size: 17px; line-height: 1; opacity: .9; }
.stat-ico .ico { font-size: 17px; }


@media (min-width: 780px) { .lg-time { white-space: nowrap; } .lg-time .lg-ago { white-space: nowrap; } }

/* ============================================================
 *  记录：多选 + 单条/批量删除
 * ========================================================== */
.log-row.is-picked { background: rgba(0, 122, 255, .07); }
.log-row.is-picked:hover { background: rgba(0, 122, 255, .11); }
.pick-cell { display: flex; align-items: center; justify-content: center; flex: none; }
.pick-cell input[type="checkbox"] {
  width: 17px; height: 17px; margin: 0; cursor: pointer;
  accent-color: var(--blue);
}
.log-table-head .pick-cell { justify-content: center; }
.log-table-head input[type="checkbox"] { margin: 0; }
.row-del {
  border: 0; background: none; padding: 3px; cursor: pointer;
  color: var(--label-3); display: grid; place-items: center;
  border-radius: 7px; transition: color .16s ease, background .16s ease;
}
.row-del:hover { color: var(--red); background: var(--red-soft); }
.row-del .ico { font-size: 15px; }

.bulk-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: min(660px, calc(100% - 28px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; z-index: 60;
  background: var(--card); border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .18);
  animation: bulkIn .18s ease;
}
.bulk-bar[hidden] { display: none; }
.bulk-count { font-size: 13.5px; color: var(--label-2); padding-left: 4px; }
.bulk-count b { color: var(--blue); font-size: 15px; margin: 0 2px; }
.bulk-actions { display: flex; gap: 8px; }
.bulk-actions .btn { height: 36px; padding: 0 15px; font-size: 14px; }
@keyframes bulkIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 899px) {
  .pick-cell { margin-right: 2px; }
  .lg-cred { flex: 1 1 calc(100% - 34px); min-width: 0; }
  .row-del { margin-left: auto; }
  .bulk-bar { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  .bulk-count { font-size: 13px; }
  .bulk-actions .btn { height: 34px; padding: 0 12px; font-size: 13.5px; }
}


/* 批量操作条出现时给列表留出底部空间 */
body.bulk-on .page { padding-bottom: 96px; }
@media (max-width: 899px) { body.bulk-on .page { padding-bottom: 150px; } }
