:root {
  --paper: #f7f5ef;
  --paper-2: #efece4;
  --ink: #1b1e21;
  --ink-2: #4b5157;
  --ink-3: #838b92;
  --line: rgba(27, 30, 33, 0.1);
  --accent: #31576f;
  --seal: #b23a2e;
  --up: #3f8f5f;
  --off: #c0392b;
  --card: rgba(255, 255, 255, 0.62);
  --shadow: 0 1px 2px rgba(20, 24, 28, 0.05), 0 18px 40px -26px rgba(20, 24, 28, 0.4);
  --radius: 16px;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131519;
    --paper-2: #191c21;
    --ink: #ecebe6;
    --ink-2: #b7bcc2;
    --ink-3: #8a9199;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #93b6cb;
    --seal: #d4635a;
    --up: #5fbf87;
    --off: #e07363;
    --card: rgba(255, 255, 255, 0.035);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 50px -30px rgba(0, 0, 0, 0.8);
  }
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 520px at 10% -12%, rgba(49, 87, 111, 0.13), transparent 62%),
    radial-gradient(760px 460px at 94% -4%, rgba(178, 58, 46, 0.1), transparent 60%);
  background-attachment: fixed;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

.shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

/* ---------------------------------------------------------------- 导航 */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.08em;
}

.seal {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--seal);
  color: #fbf8f2;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 6px 16px -8px rgba(178, 58, 46, 0.8);
}

.nav-links {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(8px);
}

.nav-links a {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.active {
  background: var(--ink);
  color: var(--paper);
}

/* ---------------------------------------------------------------- 前台 */

.hero {
  padding: 84px 0 44px;
  animation: rise 0.6s ease both;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--ink-3);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(56px, 11vw, 104px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0.08em;
}

.lede {
  max-width: 640px;
  margin: 22px 0 0;
  font-size: 17px;
  color: var(--ink-2);
}

.lede b {
  font-weight: 600;
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(27, 30, 33, 0.24);
  box-shadow: var(--shadow);
}

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

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
}

.btn.ghost:hover {
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 60vh;
  color: var(--ink-3);
  font-size: 14px;
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: 72vh;
  padding: 40px 0;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.auth-card h1 {
  margin: 4px 0 6px;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.auth-form .btn {
  justify-content: center;
  width: 100%;
}

.btn.small {
  padding: 7px 14px;
  font-size: 13px;
}

.btn.tiny {
  padding: 4px 12px;
  font-size: 12px;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

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

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  font-size: 13px;
  color: var(--ink-3);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  box-shadow: 0 0 0 3px rgba(131, 139, 146, 0.16);
  flex: none;
}

.dot.up {
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(63, 143, 95, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}

.dot.off {
  background: var(--off);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.16);
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
  animation: rise 0.6s ease both;
}

.card:nth-child(2) {
  animation-delay: 0.06s;
}

.card:nth-child(3) {
  animation-delay: 0.12s;
}

.card:nth-child(4) {
  animation-delay: 0.18s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(27, 30, 33, 0.22);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.card h2 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  flex: 1;
}

.card-link {
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent);
}

.card-link:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- 工作台 */

.console-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 64px 0 24px;
  animation: rise 0.5s ease both;
}

.console-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.panel {
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  animation: rise 0.6s ease both;
}

.panel h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.muted {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

.status-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.status-list li:last-child {
  border-bottom: 0;
}

.svc-name {
  min-width: 140px;
}

.svc-code,
.svc-ms {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.svc-ms {
  margin-left: auto;
}

.snap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.snap div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.04);
}

.snap dt {
  font-size: 12px;
  color: var(--ink-3);
}

.snap dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

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

input[type="text"],
input[type="password"],
input[type="url"],
input:not([type]),
select {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 87, 111, 0.14);
}

.login,
.note-add {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.login input,
.note-add input {
  flex: 1 1 220px;
}

.module-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.module-form .btn {
  justify-content: center;
}

.err {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--off);
}

.notes {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.notes li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.notes li label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.notes input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 5px;
  accent-color: var(--accent);
  flex: none;
}

.notes li.done span {
  color: var(--ink-3);
  text-decoration: line-through;
}

.icon {
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 8px;
}

.icon:hover {
  color: var(--off);
  background: rgba(192, 57, 43, 0.1);
}

.admin-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease both;
  z-index: 10;
}

.banner {
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(192, 57, 43, 0.35);
  border-radius: 12px;
  background: rgba(192, 57, 43, 0.07);
  color: var(--off);
  font-size: 13px;
}

footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

/* ---------------------------------------------------------------- 动效 */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(63, 143, 95, 0.18);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(63, 143, 95, 0.06);
  }
}

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

@media (max-width: 720px) {
  .shell {
    padding: 0 18px 56px;
  }

  .hero {
    padding: 56px 0 32px;
  }

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

  .console-head {
    padding-top: 44px;
  }

  .console-head h1 {
    font-size: 32px;
  }

  .svc-name {
    min-width: 0;
  }

  .svc-code {
    display: none;
  }
}
