/* ============================================================
   证书台 · Cert Console — 设计系统
   风格对齐 ys.qihanx.cn（提瓦特工具箱）：白底、锌灰、Geist、
   黑色胶囊主按钮、1px 细边框卡片、大圆角、柔和极光装饰面板。
   ============================================================ */

@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/geist-latin-wght-normal.20f3xrkj613ah.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/geist-latin-ext-wght-normal.39q78sztp1ci5.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif Accent';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/assets/fonts/instrument-serif-latin-400-normal.3_vslfxq_--4i.woff2') format('woff2');
}

:root {
  --font-sans: 'Geist Variable', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC',
    system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --bg: #ffffff;
  --bg-soft: #fafafa;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f4f4f5;

  --ink: #0a0a0a;
  --ink-2: #18181b;
  --muted: #71717a;
  --muted-2: #a1a1aa;

  --line: #e9e9eb;
  --line-2: #e4e4e7;
  --line-strong: #d4d4d8;

  --accent: #0a0a0a;
  --accent-ink: #ffffff;

  --ok: #067647;
  --ok-bg: #ecfdf3;
  --ok-line: #d1fadf;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --warn-line: #fedf89;
  --bad: #b42318;
  --bad-bg: #fef3f2;
  --bad-line: #fecdca;
  --run: #1d4ed8;
  --run-bg: #eff4ff;
  --run-line: #d1e0ff;

  --radius-card: 16px;
  --radius-inner: 12px;
  --radius-input: 10px;
  --radius-pill: 999px;

  --shadow-pop: 0 12px 40px -12px rgb(9 9 11 / 0.18), 0 2px 6px rgb(9 9 11 / 0.05);

  --container: 1120px;
  --gutter: 24px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}

::selection {
  background: #0a0a0a;
  color: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- 骨架 ---------- */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: saturate(180%) blur(8px);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  border-radius: 8px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.brand-name {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  margin-left: 2px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.nav-link {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.nav-link:hover {
  color: var(--ink);
  background: var(--surface-3);
}

.nav-link[aria-current='page'] {
  color: var(--ink);
  font-weight: 550;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  flex: 1;
}

.page {
  padding: 40px 0 72px;
  animation: page-in 0.22s var(--ease);
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 页头 ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: -0.028em;
}

.page-sub {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  max-width: 60ch;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.section-hint {
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  padding: 4px 8px 4px 6px;
  margin-left: -8px;
  border-radius: 8px;
  margin-bottom: 18px;
}

.breadcrumb:hover {
  color: var(--ink);
  background: var(--surface-3);
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease),
    transform 0.08s var(--ease);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover:not(:disabled) {
  background: #27272a;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.btn-ghost {
  color: var(--muted);
  padding: 0 11px;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-3);
}

.btn-danger {
  color: var(--bad);
  border: 1px solid var(--bad-line);
  background: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--bad-bg);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--ink);
  background: var(--surface-3);
}

.btn .arrow {
  transition: transform 0.15s var(--ease);
}

.btn:hover .arrow {
  transform: translate(1px, -1px);
}

.btn-block {
  width: 100%;
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-card);
}

.card-pad {
  padding: 22px 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 14px;
}

.card-title {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.card-body {
  padding: 0 24px 20px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 6px;
  padding: 3px 2px;
  transition: color 0.15s var(--ease);
}

.link-arrow:hover {
  color: var(--ink);
}

/* ---------- KPI 条 ---------- */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.kpi {
  padding: 20px 24px 18px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.kpi:first-child {
  border-left: 0;
}

.kpi-label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-unit {
  font-size: 13px;
  color: var(--muted);
  font-weight: 450;
}

/* ---------- 极光装饰卡（品牌元素，来自参考站） ---------- */

.aurora {
  position: relative;
  border-radius: 20px;
  padding: 26px;
  min-height: 252px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 12% -10%, #f9d7ea 0%, rgb(249 215 234 / 0) 58%),
    radial-gradient(110% 95% at 92% 0%, #cfe2ff 0%, rgb(207 226 255 / 0) 55%),
    radial-gradient(120% 110% at 78% 108%, #fff2bd 0%, rgb(255 242 189 / 0) 62%),
    linear-gradient(155deg, #fbe9f4 0%, #e8f0fe 46%, #fdf7dd 100%);
}

.aurora-card {
  background: var(--surface);
  border-radius: var(--radius-inner);
  width: 100%;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgb(9 9 11 / 0.04);
}

.aurora-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.aurora-title {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.018em;
}

.aurora-desc {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  max-width: 34ch;
}

.aurora-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.aurora-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
}

.aurora-mini span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- 状态徽标 ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
}

.pill-warn {
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
}

.pill-bad {
  color: var(--bad);
  background: var(--bad-bg);
  border: 1px solid var(--bad-line);
}

.pill-run {
  color: var(--run);
  background: var(--run-bg);
  border: 1px solid var(--run-line);
}

.pill-neutral {
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
}

.dot-pulse {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ---------- 表格 ---------- */

.table-wrap {
  overflow-x: auto;
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 0 16px 10px;
  white-space: nowrap;
}

.table th:first-child,
.table td:first-child {
  padding-left: 24px;
}

.table th:last-child,
.table td:last-child {
  padding-right: 24px;
}

.table td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.12s var(--ease);
}

.table tbody tr.clickable {
  cursor: pointer;
}

.table tbody tr.clickable:hover {
  background: var(--surface-2);
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cell-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cell-name {
  font-weight: 550;
  letter-spacing: -0.008em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-sub {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.mask {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.days-left {
  font-size: 12.5px;
  color: var(--muted);
}

.days-left.is-warn {
  color: var(--warn);
}

.days-left.is-bad {
  color: var(--bad);
}

/* ---------- 标签页 ---------- */

.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.tab {
  position: relative;
  padding: 10px 1px 11px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s var(--ease);
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected='true'] {
  color: var(--ink);
  font-weight: 550;
}

.tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.tab .count {
  margin-left: 5px;
  font-size: 12px;
  color: var(--muted-2);
}

/* ---------- 表单 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field + .field {
  margin-top: 18px;
}

.label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}

.label .req {
  color: var(--bad);
  margin-left: 2px;
}

.hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-input);
  font-size: 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.textarea {
  height: auto;
  min-height: 104px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.55;
  font-family: var(--font-mono);
  font-size: 13px;
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(9 9 11 / 0.08);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid .field + .field {
  margin-top: 0;
}

.form-grid .field-full {
  grid-column: 1 / -1;
}

.field-error {
  font-size: 12.5px;
  color: var(--bad);
}

/* 分段控制 */

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: var(--radius-input);
  height: 38px;
}

.segmented button {
  padding: 0 14px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.segmented button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  box-shadow: 0 1px 2px rgb(9 9 11 / 0.06);
}

/* 开关 */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-track {
  width: 36px;
  height: 21px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
  position: relative;
  transition: background 0.15s var(--ease);
  flex-shrink: 0;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(9 9 11 / 0.2);
  transition: transform 0.15s var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--ink);
}

.switch input:checked + .switch-track::after {
  transform: translateX(15px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.switch-label {
  font-size: 14px;
}

/* ---------- 详情键值行 ---------- */

.kv {
  display: grid;
  grid-template-columns: minmax(92px, 132px) 1fr;
  gap: 10px 16px;
  font-size: 14px;
}

.kv dt {
  color: var(--muted);
  font-size: 13.5px;
}

.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv dd.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ---------- 日志 ---------- */

.log {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-inner);
  padding: 14px 16px;
  max-height: 340px;
  overflow: auto;
}

.log-line {
  display: flex;
  gap: 10px;
  padding: 1px 0;
  animation: log-in 0.16s var(--ease);
}

@keyframes log-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.log-time {
  color: var(--muted-2);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.log-msg {
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-line.level-success .log-msg {
  color: var(--ok);
}

.log-line.level-warn .log-msg {
  color: var(--warn);
}

.log-line.level-error .log-msg {
  color: var(--bad);
}

.log-line.level-debug .log-msg {
  color: var(--muted-2);
}

.log-empty {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
}

/* ---------- 空状态 ---------- */

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--muted);
  margin-bottom: 4px;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
}

.empty-desc {
  font-size: 13px;
  color: var(--muted);
  max-width: 44ch;
}

.empty .btn {
  margin-top: 8px;
}

/* ---------- 模态框 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgb(9 9 11 / 0.32);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 20px 40px;
  overflow: auto;
  animation: overlay-in 0.15s var(--ease);
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 520px;
  animation: modal-in 0.18s var(--ease);
}

.modal-wide {
  max-width: 640px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 4px;
}

.modal-title {
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.modal-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.modal-body {
  padding: 18px 24px 8px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 22px;
}

/* ---------- 提示浮层 ---------- */

.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 13.5px;
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.2s var(--ease);
  max-width: 380px;
}

.toast.is-error {
  background: var(--bad);
}

.toast.is-success {
  background: #054f31;
}

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

/* ---------- 登录页 ---------- */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(80% 60% at 20% 0%, #fbe9f4 0%, rgb(251 233 244 / 0) 60%),
    radial-gradient(70% 50% at 88% 6%, #e6efff 0%, rgb(230 239 255 / 0) 55%), #ffffff;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 32px 30px 30px;
  box-shadow: 0 30px 60px -40px rgb(9 9 11 / 0.25);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.auth-title {
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.auth-desc {
  margin-top: 6px;
  margin-bottom: 22px;
  font-size: 13.5px;
  color: var(--muted);
}

.auth-error {
  margin-top: 14px;
  font-size: 13px;
  color: var(--bad);
}

.auth-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted-2);
}

/* ---------- 网格布局 ---------- */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.grid-main-side {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.grow {
  flex: 1;
  min-width: 0;
}

/* ---------- 活动列表 ---------- */

.activity {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 11px 24px;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.activity-item:first-child {
  border-top: 0;
}

.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.level-success {
  background: var(--ok);
}

.activity-dot.level-error {
  background: var(--bad);
}

.activity-dot.level-warn {
  background: var(--warn);
}

.activity-main {
  min-width: 0;
  flex: 1;
}

.activity-text {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.activity-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- 证书详情 ---------- */

.domain-title {
  font-size: 26px;
  font-weight: 620;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.domains-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.domain-chip {
  font-size: 12.5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
}

.pem-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pem-actions .btn {
  justify-content: flex-start;
  padding-left: 13px;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-inner);
  font-size: 13px;
  line-height: 1.55;
}

.notice-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: #7a2e0e;
}

.notice-info {
  background: var(--run-bg);
  border: 1px solid var(--run-line);
  color: #1e3a8a;
}

.notice-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.manual-box {
  margin-top: 14px;
  border-radius: var(--radius-inner);
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  padding: 14px 16px;
}

.manual-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #7a2e0e;
  margin-bottom: 8px;
}

.manual-record {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid rgb(181 71 8 / 0.15);
}

.manual-record:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.manual-label {
  font-size: 12px;
  color: #93370d;
}

.manual-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #511b06;
  overflow-wrap: anywhere;
}

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 32px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 22px var(--gutter) 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- 响应式 ---------- */

@media (max-width: 980px) {
  .grid-main-side {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .nav-inner {
    gap: 16px;
  }
  .nav-links {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 16px;
    --nav-h: 58px;
  }
  .page {
    padding: 28px 0 56px;
  }
  .page-title {
    font-size: 25px;
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .page-actions {
    flex-wrap: wrap;
  }
  .kpi-strip {
    grid-template-columns: 1fr 1fr;
  }
  .kpi {
    padding: 16px 18px;
  }
  .kpi:nth-child(3) {
    border-left: 0;
  }
  .kpi:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .brand-tag {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .kv {
    grid-template-columns: 1fr;
    gap: 3px 0;
  }
  .kv dd {
    margin-bottom: 10px;
  }
  .pem-actions {
    grid-template-columns: 1fr;
  }
  .table th:nth-child(4),
  .table td:nth-child(4) {
    display: none;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 520px) {
  .page-title {
    font-size: 23px;
  }
  .table th,
  .table td {
    padding-left: 10px;
    padding-right: 10px;
  }
  .table th:first-child,
  .table td:first-child {
    padding-left: 16px;
  }
  .table th:last-child,
  .table td:last-child {
    padding-right: 16px;
  }
  .table th:nth-child(5),
  .table td:nth-child(5) {
    display: none;
  }
}

/* 输入中的错误状态 */
.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: var(--bad);
}

/* 复制的小反馈 */
.copied {
  color: var(--ok) !important;
}

/* 行内小工具 */
.mono {
  font-family: var(--font-mono);
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 细节修正（响应式与表单） ---------- */

.segmented button {
  white-space: nowrap;
}

.stack-sm .field + .field {
  margin-top: 0;
}

.grid-2 > *,
.grid-main-side > *,
.stack > * {
  min-width: 0;
}

.card {
  min-width: 0;
}

@media (max-width: 760px) {
  .nav {
    position: sticky;
  }
  .nav-inner {
    height: auto;
    padding: 10px var(--gutter) 8px;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .nav-links {
    order: 3;
    width: 100%;
    gap: 2px;
    padding-bottom: 2px;
  }
  .nav-link {
    padding: 6px 9px;
    font-size: 13.5px;
  }
  .nav-actions .btn-primary {
    display: none;
  }
  .nav-actions {
    gap: 2px;
  }
  .card-head {
    padding: 16px 18px 12px;
    flex-wrap: wrap;
  }
  .card-body,
  .card-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
  .table th:first-child,
  .table td:first-child {
    padding-left: 18px;
  }
  .table th:last-child,
  .table td:last-child {
    padding-right: 18px;
  }
  .table {
    font-size: 13.5px;
  }
  .table td {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .page-head .btn {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .segmented {
    width: 100%;
    overflow-x: auto;
  }
  .segmented button {
    flex: 1;
  }
  .kpi-value {
    font-size: 22px;
  }
}

@media (max-width: 760px) {
  .table {
    table-layout: fixed;
  }
  .table th:nth-child(6),
  .table td:nth-child(6) {
    display: none;
  }
  .table th:nth-child(1),
  .table td:nth-child(1) {
    width: 44%;
  }
  .table th:nth-child(2),
  .table td:nth-child(2) {
    width: 30%;
  }
  .table th:nth-child(3),
  .table td:nth-child(3) {
    width: 26%;
  }
  .cell-name,
  .cell-sub {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .footer-inner {
    font-size: 12px;
  }
  .footer-inner span:last-child {
    font-size: 11.5px;
  }
}
