:root {
  --sidebar-w: 236px;
  --sidebar-bg: #ffffff;
  --sidebar-text: #4a5b57;
  --sidebar-active: #ccfbf1;
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-2: #f7fbfa;
  --border: #e2eae8;
  --border-strong: #c8d5d2;
  --text: #0a1f1b;
  --text-2: #41524e;
  --muted: #8a9a96;
  --primary: #0d9488;
  --primary-strong: #0f766e;
  --primary-soft: #ccfbf1;
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-strong: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --info: #0284c7;
  --info-soft: #f0f9ff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(10, 31, 27, 0.04), 0 8px 24px -16px rgba(10, 31, 27, 0.16);
  --shadow-lg: 0 20px 56px -24px rgba(10, 31, 27, 0.34);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 10px; }

img { max-width: 100%; border: 0; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
select, textarea {
  font: inherit;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 38px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  max-width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(:disabled):hover,
select:not(:disabled):hover,
textarea:not(:disabled):hover {
  border-color: #a9bcb8;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):disabled,
select:disabled,
textarea:disabled {
  background-color: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2341524e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 13px;
  cursor: pointer;
}

select::-ms-expand { display: none; }

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--primary);
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex: none;
}

textarea { min-height: 90px; resize: vertical; }

::placeholder { color: #9aa8a5; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.app.no-side { grid-template-columns: minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 60;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-head {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.sidebar .brand:hover { color: var(--primary); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #2dd4bf);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  flex: none;
}

.brand-text { letter-spacing: 0.02em; }

.sidebar .nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-label {
  padding: 0 12px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.sidebar .nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar .nav a:hover {
  background: rgba(13, 148, 136, 0.08);
  color: var(--primary-strong);
}

.sidebar .nav a.active {
  background: var(--sidebar-active);
  color: var(--primary-strong);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-ico {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.9;
}

.sidebar-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logout-form { display: contents; }

.logout-btn {
  margin-left: auto;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.logout-btn:hover {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.logout-btn:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 1px;
}

.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.sidebar .username {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(115deg, #0f766e 0%, #0d9488 46%, #14b8a6 100%);
  box-shadow: 0 12px 28px -20px rgba(13, 148, 136, 0.95);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  height: 76px;
}

.topbar-lead {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
}

.crumb {
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.crumb { text-decoration: none; }
a.crumb:hover { color: #ffffff; }
.crumb.current { color: rgba(255, 255, 255, 0.96); font-weight: 600; }

.crumb-sep {
  flex: none;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.5);
  border-top: 1.5px solid rgba(255, 255, 255, 0.5);
  transform: rotate(45deg);
}

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

.topbar .btn-ghost {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.topbar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.8);
  color: #ffffff;
}

.topbar .btn-primary {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--primary-strong);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.35);
}

.topbar .btn-primary:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.88);
  color: var(--primary-strong);
}

.nav-toggle {
  display: none;
  font-size: 20px;
  line-height: 1;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
}

body.guest .shell {
  background:
    radial-gradient(1000px 520px at 12% -12%, rgba(13, 148, 136, 0.12), transparent 62%),
    radial-gradient(880px 460px at 96% -4%, rgba(45, 212, 191, 0.14), transparent 58%),
    var(--bg);
}

.container {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(20px, 2.2vw, 34px) clamp(16px, 2.4vw, 40px) 46px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  background: var(--surface);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head h1 {
  font-size: 22px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; }

.lead { color: var(--text-2); font-size: 14.5px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }

.empty {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  padding: 40px 16px !important;
}

.empty::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 15px;
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a9a96' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(15px, 1.5vw, 22px) clamp(16px, 1.7vw, 24px);
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2, .card-head h3 { font-size: 16px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.grid-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1100px) {
  .grid-side { grid-template-columns: minmax(0, 1fr); }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--border-strong);
}

.stat-card.accent-blue::before { background: var(--primary); }
.stat-card.accent-green::before { background: var(--success); }
.stat-card.accent-amber::before { background: var(--warn); }
.stat-card.accent-red::before { background: var(--danger); }
.stat-card.accent-indigo::before { background: #0891b2; }
.stat-card.accent-slate::before { background: #64748b; }

.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
  white-space: nowrap;
  user-select: none;
  text-align: center;
}

.btn:hover { border-color: #8a9a96; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.35);
}

.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover { background: var(--danger-strong); border-color: var(--danger-strong); color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }

.btn-sm { padding: 5px 11px; font-size: 12.5px; min-height: 30px; }
.btn-lg { padding: 11px 22px; font-size: 15px; min-height: 44px; }
.btn-block { width: 100%; }

.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn:not(.btn-primary):not(.btn-danger).is-loading::after {
  border-color: var(--border-strong);
  border-top-color: var(--text-2);
}

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

.flash {
  position: relative;
  padding: 11px 40px 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #bfdbfe;
  background: var(--info-soft);
  color: #075985;
  margin-bottom: 16px;
  font-weight: 500;
}

.flash-success { border-color: #bbf7d0; background: var(--success-soft); color: #166534; }
.flash-error { border-color: #fecaca; background: var(--danger-soft); color: #991b1b; }
.flash-info { border-color: #bae6fd; background: var(--info-soft); color: #075985; }

.flash-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
}

.flash-close:hover { opacity: 1; }

.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.filter-form input, .filter-form select {
  min-width: 150px;
  min-height: 38px;
  padding: 6px 11px;
}

.filter-form .btn { min-height: 38px; }

.filter-row { margin-bottom: 16px; }

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.bulk-count { color: var(--text-2); font-size: 13px; }
.bulk-count b { color: var(--text); font-variant-numeric: tabular-nums; }

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

.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}

.table th:first-child { border-top-left-radius: var(--radius-sm); }
.table th:last-child { border-top-right-radius: var(--radius-sm); }

.table-hover tbody tr:hover { background: #f2f9f8; }

.table td a { font-weight: 600; }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
}

.col-check { width: 36px; text-align: center !important; }
.col-check input { vertical-align: middle; }

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

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.pagination a:hover { border-color: var(--primary); color: var(--primary); }

.pagination a.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: block;
}

.thumb-cell { width: 64px; }

.site-ico {
  position: relative;
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.site-ico-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.site-ico-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2);
}

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin: 0 0 0 4px; }
.actions-cell .btn:first-child { margin-left: 0; }

.table-users th, .table-users td { white-space: nowrap; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.quota-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quota-form input {
  width: 84px;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 13px;
  text-align: right;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tag-admin { background: #f5eef9; color: #7e22ce; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.badge-ok { background: var(--success-soft); color: #15803d; }
.badge-err { background: var(--danger-soft); color: #b91c1c; }
.badge-wait { background: var(--warn-soft); color: #b45309; }
.badge-run { background: var(--primary-soft); color: var(--primary-strong); }
.badge-off { background: #eef2f1; color: #6b7c78; }

.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.chip-pass { background: var(--success-soft); color: #15803d; }
.chip-fail { background: var(--danger-soft); color: #b91c1c; }
.chip-warn { background: var(--warn-soft); color: #b45309; }

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 7px;
  border-radius: 7px;
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.score-good { background: var(--success-soft); color: #15803d; }
.score-warn, .score-mid { background: var(--warn-soft); color: #b45309; }
.score-bad { background: var(--danger-soft); color: #b91c1c; }

.score-xl {
  flex-direction: column;
  gap: 1px;
  min-width: 78px;
  height: auto;
  padding: 8px 14px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 12px;
}

.score-xl .score-big {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.progress {
  position: relative;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  min-width: 90px;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #2dd4bf);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress span.is-active {
  background-size: 200% 100%;
  animation: progress-slide 1.1s linear infinite;
  background-image: linear-gradient(270deg, #2dd4bf, var(--primary), #2dd4bf);
}

@keyframes progress-slide {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.progress-lg { height: 12px; }
.progress-cell { min-width: 130px; }

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

.upload-progress { display: none; margin-top: 16px; }
.upload-progress.show { display: block; }

.upload-progress .bar {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 7px;
}

.upload-progress .bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #2dd4bf);
  transition: width 0.2s;
}

.upload-progress .label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.upload-progress .label .pct { color: var(--primary); }

.form { display: block; }

.form > .field { margin-bottom: 14px; }
.form > .btn { margin-top: 6px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field > span:first-child, .label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
}

.field input, .field select, .field textarea { width: 100%; }

.field-wide { grid-column: 1 / -1; }

.input-wrap { position: relative; display: block; }

.input-wrap input { width: 100%; padding-right: 58px; }

.input-action {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  background: var(--surface);
}

.form-section-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 9px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}

.check:hover { border-color: var(--border-strong); background: var(--surface); }

.check input[type="checkbox"] { margin: 2px 0 0; flex: none; }

.check:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 190px;
  padding: 26px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.dropzone:hover { border-color: var(--primary); background: #f2f9f8; }

.dropzone::before {
  content: "";
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 17px;
  background-color: var(--primary-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M17 8l-5-5-5 5'/%3E%3Cpath d='M12 3v12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px;
  transition: transform 0.15s;
}

.dropzone:hover::before,
.dropzone.is-dragover::before { transform: translateY(-2px); }

.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title { font-size: 15px; font-weight: 700; color: var(--text); }
.dropzone-hint { font-size: 12.5px; color: var(--muted); }

.dropzone-file {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.dropzone-file.show { display: flex; }

.file-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 11.5px;
  font-weight: 800;
}

.file-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

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

.format-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 18px;
}

.detail-grid > div { min-width: 0; }

.detail-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

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

.kv-table th, .kv-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.kv-table th { width: 130px; color: var(--muted); font-weight: 600; }

.download-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.preview-img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: repeating-conic-gradient(#f4f9f8 0% 25%, #ffffff 0% 50%) 0 0 / 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.preview-3d {
  position: relative;
  width: 100%;
  height: clamp(320px, 44vh, 560px);
  background: repeating-conic-gradient(#f4f9f8 0% 25%, #ffffff 0% 50%) 0 0 / 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: none;
}

.preview-3d .preview-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.preview-3d .preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.preview-3d .preview-canvas:active { cursor: grabbing; }


.report-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}

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

.report-table th, .report-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.report-table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.report-table tr.row-pass td { background: transparent; }
.report-table tr.row-warn td { background: var(--warn-soft); }
.report-table tr.row-fail td { background: var(--danger-soft); }
.report-table tr.row-fail td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.report-table tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.warn-block {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
}

.warn-block h3 {
  font-size: 13.5px;
  color: #92400e;
  margin-bottom: 6px;
}

.warn-list { margin: 0; padding-left: 20px; color: #92400e; }
.warn-list li { margin-bottom: 4px; }
.warn-list li:last-child { margin-bottom: 0; }

.error-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 14px;
}

.run-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--surface);
  font-size: 13.5px;
}

.run-result.row-success { border-left: 3px solid var(--success); }
.run-result.row-failed { border-left: 3px solid var(--danger); }
.run-result.row-processing { border-left: 3px solid var(--primary); }

.msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.log-detail {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 400px;
}

.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding: 30px 16px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 34px 32px;
  text-align: center;
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #2dd4bf);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -10px rgba(13, 148, 136, 0.6);
}

.auth-title { font-size: 20px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }
.auth-hint { color: var(--muted); font-size: 12.5px; margin-top: 16px; margin-bottom: 0; }
.auth-card .field { text-align: left; margin-bottom: 14px; }
.auth-card .flash { text-align: left; }

.inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.inline-form select {
  flex: 1 1 110px;
  min-width: 0;
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.inline-form select {
  padding-right: 26px;
  background-size: 11px;
  background-position: right 8px center;
}

.inline-form .btn { flex: none; }

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.toast {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: #0a1f1b;
  color: #eef2f1;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 340px;
}

.toast.success { background: #14532d; }
.toast.error { background: #7f1d1d; }
.toast.out { opacity: 0; transform: translateY(8px); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 27, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal p { color: var(--text-2); margin-bottom: 18px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.username { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table td .muted { font-size: 12px; }

a:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.table-scroll::-webkit-scrollbar,
.card ::-webkit-scrollbar { height: 9px; width: 9px; }
.table-scroll::-webkit-scrollbar-track,
.card ::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb,
.card ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb:hover,
.card ::-webkit-scrollbar-thumb:hover { background: var(--muted); }

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

@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 31, 27, 0.45);
    z-index: 50;
  }

  .nav-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
  .container { padding: 18px 14px 32px; }
  .card { padding: 14px 14px; overflow-x: auto; }
  .stat-value { font-size: 24px; }
  .topbar-inner { padding: 0 14px; height: 62px; }
  .crumbs { display: none; }
  .footer { padding: 14px; flex-direction: column; gap: 4px; }
  .file-name { max-width: 160px; }
  .inline-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
  .inline-form select { flex: 1 1 100%; }
  .form-actions .btn { flex: 1 1 auto; }
}


/* ===== 前台首页（官网） ===== */
body.front { background: var(--bg); }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px clamp(16px, 3vw, 32px);
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--text);
}
.site-links {
  display: flex;
  gap: 20px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}
.site-links a { color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.site-links a:hover { color: var(--primary-strong); }
.site-cta { display: flex; align-items: center; gap: 8px; }

.site-main { overflow-x: hidden; }

.site-flash { max-width: 1120px; margin: 0 auto; padding: 16px clamp(16px, 3vw, 32px) 0; }

.hero {
  background:
    radial-gradient(900px 420px at 14% -10%, rgba(45, 212, 191, 0.38), transparent 62%),
    linear-gradient(115deg, #0f766e 0%, #0d9488 46%, #14b8a6 100%);
  color: #fff;
}
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) clamp(16px, 3vw, 32px) clamp(48px, 6vw, 76px);
  text-align: center;
}
.hero-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-title {
  margin: 20px 0 14px;
  font-size: clamp(34px, 5.6vw, 62px);
  line-height: 1.1;
  color: #fff;
}
.hero-title em { font-style: normal; color: #a7f3d0; }
.hero-sub {
  max-width: 680px;
  margin: 0 auto;
  font-size: clamp(14.5px, 1.6vw, 17px);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
.hero .btn-primary {
  background: #fff;
  border-color: #fff;
  color: var(--primary-strong);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.7);
}
.hero .btn-primary:hover { background: #ecfdf5; border-color: #ecfdf5; color: var(--primary-strong); }
.hero .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.08); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.18); border-color: #fff; color: #fff; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 42px;
}
.hero-stat {
  min-width: 148px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.hero-stat strong { display: block; font-size: 24px; line-height: 1.2; }
.hero-stat span { font-size: 12.5px; color: rgba(255, 255, 255, 0.82); }

/* 首页：功能特性上方的站点导航横条 */
.sites-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sites-strip-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 13px clamp(16px, 3vw, 32px);
  display: flex;
  align-items: center;
  gap: 14px;
}
.sites-strip-label {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.sites-strip-label::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}
.sites-strip-list {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.site-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px 6px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.site-pill:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: #99f6e4;
  box-shadow: 0 8px 18px -12px rgba(10, 31, 27, 0.45);
  color: var(--primary-strong);
}
.site-pill-ico {
  position: relative;
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex: none;
  border-radius: 6px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
}
/* 图标盖在首字兜底之上；加载失败时 JS 移除 img，露出首字 */
.site-pill-ico-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #fff;
}
.site-pill-letter {
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.site-pill-arrow {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.16s ease, color 0.16s ease;
}
.site-pill:hover .site-pill-arrow {
  color: var(--primary-strong);
  transform: translateX(2px);
}

@media (max-width: 760px) {
  .sites-strip-inner { flex-direction: column; align-items: flex-start; gap: 9px; }
}
.front-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(46px, 6vw, 76px) clamp(16px, 3vw, 32px);
}
.front-alt {
  max-width: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.front-alt > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.front-head { max-width: 720px; margin-bottom: 30px; }
.front-title { font-size: clamp(23px, 3vw, 32px); line-height: 1.25; }
.front-sub { margin-top: 10px; color: var(--text-2); font-size: 15px; line-height: 1.7; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.feature-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 19px;
  margin-bottom: 14px;
}
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }

.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  margin-bottom: 12px;
}
.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }
.step-arrow {
  display: flex;
  align-items: center;
  color: var(--border-strong);
  font-size: 22px;
  font-weight: 700;
}

.fmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.fmt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.fmt-head {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}
.fmt-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fmt-chips .chip { padding: 5px 11px; font-size: 13px; border: 1px solid var(--border); }
.fmt-card .muted { margin: 0; font-size: 13px; }

.cta-band {
  background:
    radial-gradient(700px 300px at 85% 20%, rgba(45, 212, 191, 0.28), transparent 60%),
    linear-gradient(115deg, #0f766e 0%, #0d9488 52%, #14b8a6 100%);
  color: #fff;
}
.cta-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(44px, 6vw, 68px) clamp(16px, 3vw, 32px);
  text-align: center;
}
.cta-inner h2 { font-size: clamp(23px, 3vw, 32px); color: #fff; }
.cta-inner p { margin-top: 10px; color: rgba(255, 255, 255, 0.86); font-size: 15px; }
.cta-band .btn-primary {
  background: #fff;
  border-color: #fff;
  color: var(--primary-strong);
}
.cta-band .btn-primary:hover { background: #ecfdf5; border-color: #ecfdf5; color: var(--primary-strong); }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.08); }
.cta-band .btn-ghost:hover { background: rgba(255, 255, 255, 0.18); border-color: #fff; color: #fff; }

.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 18px;
}
.faq-item summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--muted); font-weight: 700; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.7; }

.site-footer { background: var(--surface); border-top: 1px solid var(--border); }
.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 38px clamp(16px, 3vw, 32px) 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(140px, 1fr));
  gap: 26px;
}
.site-foot-brand .site-brand { margin-bottom: 12px; }
.site-foot-brand p { margin: 0 0 6px; font-size: 13px; }
.site-foot-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
.site-foot-col { display: flex; flex-direction: column; gap: 9px; }
.site-foot-col a { color: var(--text-2); font-size: 13.5px; }
.site-foot-col a:hover { color: var(--primary-strong); }
.site-foot-bar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px clamp(16px, 3vw, 32px) 26px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
}

@media (max-width: 900px) {
  .site-links { display: none; }
  .steps { grid-template-columns: 1fr; }
  .step-arrow { transform: rotate(90deg); justify-content: center; }
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .site-nav-inner { gap: 10px; flex-wrap: wrap; }
  .site-cta .btn-ghost { display: none; }
  .hero-stats { gap: 8px; }
  .hero-stat { min-width: calc(50% - 4px); }
  .site-footer-inner { grid-template-columns: 1fr; }
  .site-foot-bar { flex-direction: column; gap: 4px; }
}
body.front { scroll-behavior: smooth; }

.front-section[id], #features, #flow, #formats, #faq { scroll-margin-top: 76px; }


/* ===== 前台留言墙 ===== */
.msg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.msg-main { min-width: 0; }
.msg-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.msg-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.msg-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #2dd4bf);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex: none;
}
.msg-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.msg-who b { font-size: 14px; }
.msg-who .muted { font-size: 12px; }
.msg-body { color: var(--text-2); font-size: 14.5px; line-height: 1.75; word-break: break-word; }
.msg-reply {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.msg-reply b { display: block; color: var(--primary-strong); font-size: 12.5px; margin-bottom: 4px; }
.msg-reply p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.7; word-break: break-word; }

.msg-mine { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.msg-mine:last-child { border-bottom: 0; padding-bottom: 0; }
.msg-mine-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.msg-mine p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; word-break: break-word; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ===== 留言 / 订单管理 ===== */
.msg-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.msg-tabs .chip { padding: 5px 12px; border: 1px solid var(--border); }
.msg-cell {
  display: block;
  max-width: 300px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  white-space: normal;
}
.reply-box { margin-top: 8px; }
.reply-box summary { cursor: pointer; font-size: 12.5px; color: var(--primary); font-weight: 600; }
.reply-box .form { margin-top: 8px; }
.reply-box textarea { min-height: 70px; margin-bottom: 8px; }

/* ===== 充值套餐 ===== */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.pkg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 20px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.pkg-flag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warn);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pkg-name { font-size: 15px; font-weight: 700; }
.pkg-price { font-size: 30px; font-weight: 800; color: var(--primary-strong); line-height: 1.2; }
.pkg-credits { font-size: 13.5px; color: var(--text-2); }
.pkg-credits strong { font-size: 20px; color: var(--text); }
.pkg-bonus {
  display: inline-block;
  margin-left: 6px;
  background: var(--success-soft);
  color: #15803d;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.pkg-total { font-size: 12.5px; color: var(--muted); }
.pkg-remark { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.pkg-card .btn-block { display: flex; margin-top: auto; }

@media (max-width: 900px) {
  .msg-layout { grid-template-columns: minmax(0, 1fr); }
  .msg-cell { max-width: 220px; }
}