:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --surface-3: #f1f3f9;
  --border: #e7e9f1;
  --border-strong: #d8dbe7;
  --text: #151827;
  --text-2: #4c5266;
  --text-3: #7d8398;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-soft: #eef0ff;
  --red: #e11d48;
  --red-soft: #fff1f4;
  --amber: #b45309;
  --amber-soft: #fff7e8;
  --green: #047857;
  --green-soft: #e9fbf5;
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, 0.05);
  --shadow-md: 0 10px 30px rgba(20, 24, 40, 0.07);
  --shadow-lg: 0 28px 70px rgba(20, 24, 40, 0.18);
  --radius: 16px;
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 560px at 8% -12%, #e6e8ff 0%, rgba(230, 232, 255, 0) 62%),
    radial-gradient(900px 500px at 102% -6%, #e2f7f2 0%, rgba(226, 247, 242, 0) 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

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

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.align-right {
  text-align: right;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  word-break: break-all;
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease,
    color 0.16s ease, border-color 0.16s ease;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.filter-pill:focus-visible,
.stat-card:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.28);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #5b52f0 0%, #4338ca 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.24);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.3);
}

.btn-ghost {
  color: var(--text-2);
}

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

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

.btn-soft:hover:not(:disabled) {
  background: #e4e7ff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef335c 0%, #d31340 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.22);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-lg {
  height: 48px;
  padding: 0 21px;
  border-radius: 13px;
  font-size: 15px;
}

.btn-sm {
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.btn.is-loading,
.icon-btn.is-loading {
  pointer-events: none;
  color: transparent !important;
}

.btn.is-loading .icon,
.btn.is-loading .btn-label,
.icon-btn.is-loading .icon {
  opacity: 0;
}

.btn.is-loading::after,
.icon-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(79, 70, 229, 0.24);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.btn-primary.is-loading::after,
.btn-danger.is-loading::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

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

.icon-btn.is-danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

.icon-btn.is-disabled {
  opacity: 0.32;
  cursor: default;
}

.icon-btn.is-disabled:hover {
  background: transparent;
  color: var(--text-3);
}

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

/* ---------- 品牌 ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.28);
}

.brand-mark .icon {
  width: 21px;
  height: 21px;
  stroke-width: 1.7;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.brand-text small {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.08em;
}

.brand-lg .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.brand-lg .brand-mark .icon {
  width: 26px;
  height: 26px;
}

.brand-lg .brand-text strong {
  font-size: 18px;
}

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

.login-view {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 40px 20px 64px;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 70vh;
  background:
    radial-gradient(closest-side at 32% 38%, rgba(99, 102, 241, 0.22), transparent 70%),
    radial-gradient(closest-side at 72% 26%, rgba(13, 148, 136, 0.18), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.login-copy {
  margin: 30px 0 24px;
}

.login-copy h1 {
  font-size: 29px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.login-copy p {
  margin-top: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form .btn {
  margin-top: 3px;
}

.login-help {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
}

.login-help summary {
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.login-help summary::-webkit-details-marker {
  display: none;
}

.login-help summary::after {
  content: "+";
  float: right;
  color: var(--text-3);
  font-weight: 500;
}

.login-help[open] summary::after {
  content: "−";
}

.login-help ol {
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.login-foot {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  color: var(--text-3);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-align: center;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
}

.field-hint {
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.55;
}

.req {
  color: var(--red);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: #a6abbd;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--primary);
  flex: none;
}

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

.input-row input {
  flex: 1;
  min-width: 0;
}

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

.quick-dates {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.quick-dates button {
  height: 26px;
  padding: 0 9px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--text-3);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.quick-dates button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}

.check strong {
  display: block;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
}

.check small {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11.5px;
}

.form-error {
  padding: 9px 11px;
  border: 1px solid #fecdd3;
  border-radius: 9px;
  background: var(--red-soft);
  color: #be123c;
  font-size: 12.5px;
  line-height: 1.5;
}

.file-input {
  padding: 9px 10px;
  font-size: 12.5px;
}

.file-input::file-selector-button {
  margin-right: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.file-input::file-selector-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.import-result {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.import-summary {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
}

.import-errors {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(231, 233, 241, 0.9);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1240px, 100%);
  height: 68px;
  margin: 0 auto;
  padding: 0 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- 页面 ---------- */

.page {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 34px 24px 60px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 6px 0 26px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.19em;
}

.hero h1 {
  font-size: 33px;
  font-weight: 790;
  letter-spacing: -0.035em;
  line-height: 1.14;
}

.hero-sub {
  margin-top: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.65;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 700;
}

.hero-meta {
  display: block;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11.5px;
}

/* ---------- 统计卡 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.stat-card.is-active {
  border-color: rgba(79, 70, 229, 0.45);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: none;
}

.stat-icon .icon {
  width: 20px;
  height: 20px;
}

.tone-indigo {
  background: var(--primary-soft);
  color: var(--primary);
}

.tone-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tone-red {
  background: var(--red-soft);
  color: #dc2626;
}

.tone-rose {
  background: #fff1f4;
  color: #be123c;
}

.tone-green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  overflow: hidden;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  margin: 2px 0 1px;
  font-size: 25px;
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.stat-sub {
  overflow: hidden;
  color: var(--text-3);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 主面板 ---------- */

.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
}

.search .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--text-3);
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  height: 40px;
  min-height: 40px;
  padding-left: 38px;
  border-color: transparent;
  background: var(--surface-2);
}

.search input:focus {
  border-color: var(--primary);
  background: #fff;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 620;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.filter-pill:hover {
  background: var(--surface-3);
}

.filter-pill.is-active {
  background: #1c2030;
  color: #fff;
}

.pill-count {
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(20, 24, 40, 0.07);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}

.filter-pill.is-active .pill-count {
  background: rgba(255, 255, 255, 0.18);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.select-wrap select {
  width: auto;
  min-height: 36px;
  height: 36px;
  padding: 0 28px 0 10px;
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}

/* ---------- 域名列表 ---------- */

.domain-head,
.domain-row {
  display: grid;
  grid-template-columns: minmax(230px, 2.2fr) 132px 118px minmax(110px, 1.2fr) 74px 124px;
  gap: 12px;
  align-items: center;
}

.domain-head {
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.domain-list {
  display: block;
}

.domain-row {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.14s ease;
}

.domain-row:last-child {
  border-bottom: 0;
}

.domain-row:hover {
  background: #fbfbfe;
}

.cell {
  min-width: 0;
}

.cell-label {
  display: none;
}

.domain-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.domain-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: hsl(var(--hue), 72%, 93%);
  color: hsl(var(--hue), 55%, 38%);
  font-size: 16px;
  font-weight: 780;
  flex: none;
}

.domain-main {
  min-width: 0;
}

.domain-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.domain-name {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
}

.tag-auto {
  border: 1px solid #bbf7e1;
  background: var(--green-soft);
  color: var(--green);
}

.domain-notes {
  display: -webkit-box;
  overflow: hidden;
  max-width: 360px;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.domain-notes.is-empty {
  color: #b3b8c8;
}

.date-text {
  color: var(--text-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.date-text.is-empty {
  color: var(--text-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 680;
  white-space: nowrap;
}

.badge-critical {
  background: var(--red-soft);
  color: #be123c;
}

.badge-expired {
  background: #4c0519;
  color: #fff;
}

.badge-soon {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-ok {
  background: var(--green-soft);
  color: var(--green);
}

.badge-unknown {
  background: var(--surface-3);
  color: var(--text-3);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 1px;
  opacity: 0.55;
  transition: opacity 0.14s ease;
}

.domain-row:hover .actions {
  opacity: 1;
}

.panel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11.5px;
}

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

.empty-state {
  padding: 58px 24px 64px;
  text-align: center;
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-icon .icon {
  width: 27px;
  height: 27px;
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.empty-state p {
  margin: 6px auto 18px;
  max-width: 340px;
  color: var(--text-3);
  font-size: 13px;
}

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

.page-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  color: var(--text-3);
  font-size: 11.5px;
}

.page-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-foot .icon {
  width: 14px;
  height: 14px;
}

/* ---------- 弹窗 ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 20, 35, 0.46);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease both;
}

.modal {
  width: 100%;
  max-width: 600px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-lg {
  max-width: 720px;
}

.modal-sm {
  max-width: 450px;
}

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

.modal-kicker {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.modal-head h2 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.modal .form {
  display: grid;
  gap: 16px;
  padding: 20px 24px 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 2px;
}

.confirm-text {
  padding: 18px 24px 8px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.75;
}

.confirm-text strong {
  color: var(--text);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}

/* ---------- 设置 ---------- */

.settings-section {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.settings-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.settings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-head-actions {
  display: flex;
  gap: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 620;
}

.status-pill.is-ok {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.is-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

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

.settings-actions {
  display: flex;
  gap: 8px;
}

.notification-list {
  display: grid;
  gap: 7px;
  max-height: 210px;
  overflow-y: auto;
}

.notification-list > .muted {
  padding: 6px 0;
  font-size: 12.5px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.notification-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
  flex: none;
}

.notification-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.notification-body strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-body span {
  color: var(--text-3);
  font-size: 11px;
}

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 9px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast.is-leaving {
  animation: toastOut 0.2s ease both;
}

.toast-success {
  border-left-color: #10b981;
}

.toast-error {
  border-left-color: var(--red);
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-2);
  flex: none;
}

.toast-success .toast-icon {
  background: var(--green-soft);
  color: var(--green);
}

.toast-error .toast-icon {
  background: var(--red-soft);
  color: var(--red);
}

.toast-icon .icon {
  width: 15px;
  height: 15px;
}

.toast-msg {
  flex: 1;
  padding-top: 1px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-word;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.toast-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.toast-close .icon {
  width: 14px;
  height: 14px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

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

@media (max-width: 1120px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .domain-head,
  .domain-row {
    grid-template-columns: minmax(210px, 2fr) 118px 108px minmax(90px, 1fr) 64px 118px;
  }

  .search {
    max-width: 280px;
  }
}

@media (max-width: 900px) {
  .page {
    padding: 26px 16px 48px;
  }

  .topbar-inner {
    height: 62px;
    padding: 0 16px;
  }

  .topbar .btn-label {
    display: none;
  }

  .topbar .btn {
    width: 38px;
    padding: 0;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card:last-child {
    grid-column: 1 / -1;
  }

  .toolbar {
    padding: 13px;
  }

  .search {
    flex-basis: 100%;
    max-width: none;
    order: 1;
  }

  .filters {
    order: 3;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex: none;
  }

  .toolbar-right {
    order: 2;
    margin-left: 0;
  }

  .select-wrap {
    flex: 1;
  }

  .select-wrap select {
    width: 100%;
  }

  .domain-head {
    display: none;
  }

  .domain-list {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: var(--surface-2);
  }

  .domain-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .domain-row:last-child {
    border-bottom: 1px solid var(--border);
  }

  .domain-row:hover {
    background: #fff;
  }

  .domain-cell {
    grid-column: 1 / -1;
  }

  .domain-notes {
    max-width: none;
  }

  .cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 24px;
  }

  .cell-label {
    display: inline;
    color: var(--text-3);
    font-size: 11.5px;
  }

  .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    opacity: 1;
  }

  .empty-state {
    padding: 44px 20px 48px;
  }

  .panel-footer {
    border-top: 1px solid var(--border);
  }

  .page-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .login-view {
    padding: 24px 14px 56px;
  }

  .login-card {
    padding: 25px 21px;
    border-radius: 20px;
  }

  .login-copy h1 {
    font-size: 25px;
  }

  .login-foot {
    bottom: 14px;
    font-size: 10.5px;
  }

  .page {
    padding: 22px 12px 44px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .hero-sub {
    font-size: 12.5px;
  }

  .stats {
    gap: 9px;
  }

  .stat-card {
    gap: 10px;
    padding: 12px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .stat-icon .icon {
    width: 17px;
    height: 17px;
  }

  .stat-value {
    font-size: 21px;
  }

  .stat-sub {
    display: none;
  }

  .panel {
    border-radius: 16px;
  }

  .toolbar {
    padding: 11px;
    gap: 9px;
  }

  .domain-list {
    padding: 9px;
    gap: 8px;
  }

  .domain-row {
    padding: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row .btn {
    width: 100%;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }

  .modal-head {
    padding: 18px 18px 0;
  }

  .modal-head h2 {
    font-size: 19px;
  }

  .modal .form {
    padding: 16px 18px 20px;
  }

  .confirm-text {
    padding: 14px 18px 6px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .settings-head-actions {
    width: 100%;
  }

  .settings-head-actions .btn {
    flex: 1;
  }

  .toast-root {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

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