:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --paper: #ffffff;
  --paper-soft: #fafaf6;
  --panel: #ffffff;
  --panel-soft: #fafaf6;
  --surface: #ffffff;
  --surface-soft: #fafaf6;
  --line: #d9d9d0;
  --line-soft: #e7e7df;
  --thin: #e7e7df;
  --soft: #e7e7df;
  --text: #202123;
  --muted: #6f6f64;
  --slate: #3f403b;
  --accent: #10a37f;
  --accent-strong: #0d8f70;
  --blue: #10a37f;
  --teal: #19c37d;
  --amber: #8a6f3d;
  --danger: #d70015;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(32, 33, 35, 0.06);
  --shadow-soft: 0 10px 28px rgba(32, 33, 35, 0.045);
  --shadow-hover: 0 24px 56px rgba(32, 33, 35, 0.09);
  --focus-ring: 0 0 0 4px rgba(16, 163, 127, 0.16);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  letter-spacing: 0;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(16, 163, 127, 0.08), transparent 280px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 247, 242, 0) 260px);
}

::selection {
  color: #fff;
  background: var(--accent);
}

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

a,
button {
  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.mark,
.site-nav-mark {
  border-radius: var(--radius);
  background: #202123;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 12px 24px rgba(0, 0, 0, 0.12);
}

.btn,
.open-link,
.admin-link,
.save-user,
.delete-user,
.restore-btn,
.site-nav-button,
.text-link,
.text-button {
  border-radius: 999px;
  min-height: 34px;
  font-weight: 700;
}

.btn,
.open-link {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(16, 163, 127, 0.2);
}

.btn:hover,
.open-link:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn.ghost,
.btn.link,
.admin-link,
.save-user,
.restore-btn,
.site-nav-button,
.text-link {
  border-color: rgba(16, 163, 127, 0.28);
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent);
  box-shadow: none;
}

.btn.ghost:hover,
.btn.link:hover,
.admin-link:hover,
.save-user:hover,
.restore-btn:hover,
.site-nav-button:hover,
.text-link:hover {
  border-color: rgba(16, 163, 127, 0.38);
  background: #eef8f3;
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.btn.danger,
.delete-user,
.text-button {
  border-color: rgba(215, 0, 21, 0.25);
  background: rgba(255, 255, 255, 0.9);
  color: var(--danger);
  box-shadow: none;
}

.btn.danger:hover,
.delete-user:hover,
.text-button:hover {
  background: #fff1f3;
  border-color: rgba(215, 0, 21, 0.38);
}

.input,
input,
textarea,
select,
.note-area {
  border-radius: var(--radius);
  border-color: #cbcbbf;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.input:hover,
input:hover,
textarea:hover,
select:hover {
  border-color: #b9b9ad;
}

.input:focus,
input:focus,
textarea:focus,
select:focus,
.note-area:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: var(--focus-ring);
  outline: none;
}

.field-label,
label span,
.inline-control span {
  color: var(--slate);
  font-size: 12px;
  font-weight: 700;
}

.muted,
.eyebrow,
#save-status,
#me,
.field-hint,
.panel-head p,
.section-head p,
.module-card p,
.roadmap span,
.metric-card span,
.draft-meta,
.version-meta,
.version-details {
  color: var(--muted);
}

.site-nav {
  width: 260px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(247, 247, 242, 0.86);
  backdrop-filter: saturate(160%) blur(22px);
  box-shadow: 12px 0 36px rgba(32, 33, 35, 0.04);
  padding: 18px 14px;
}

:root {
  --site-nav-width: 260px;
  --site-nav-collapsed-width: 72px;
}

body.has-site-nav {
  padding-left: var(--site-nav-width);
  transition: none;
}

body.has-site-nav.site-nav-collapsed {
  padding-left: var(--site-nav-collapsed-width);
}

body.site-nav-collapsed .site-nav {
  width: var(--site-nav-collapsed-width);
}

.site-nav-brand {
  grid-template-columns: 42px minmax(0, 1fr) 32px;
}

.site-nav-mark {
  width: 42px;
  height: 42px;
  font-size: 15px;
}

.site-nav-title strong {
  font-size: 17px;
  line-height: 23px;
}

.site-nav-toggle {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: var(--slate);
  box-shadow: var(--shadow-soft);
}

.site-nav-list {
  gap: 8px;
  padding-top: 4px;
}

.site-nav-item {
  min-height: 56px;
  border-radius: var(--radius);
  border-color: transparent;
  background: transparent;
  padding: 8px;
}

.site-nav-item:hover {
  border-color: rgba(16, 163, 127, 0.18);
  background: rgba(16, 163, 127, 0.08);
}

.site-nav-item.active {
  border-color: rgba(16, 163, 127, 0.28);
  background: rgba(16, 163, 127, 0.11);
}

.site-nav-icon {
  border-radius: var(--radius);
  background: #fff;
  color: var(--slate);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.site-nav-item.active .site-nav-icon {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(16, 163, 127, 0.22);
}

.site-nav-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.dashboard-main,
.history-page,
.account-page {
  padding: 34px clamp(22px, 3vw, 44px);
  gap: 24px;
}

.dashboard-head,
.history-head,
.account-head {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.dashboard-head h2,
.history-head h1,
.account-head h1 {
  font-size: clamp(34px, 4.8vw, 56px);
  line-height: 1.04;
  font-weight: 800;
}

.status-strip span,
.badge {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--slate);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.metric-grid {
  gap: 16px;
}

.metric-card,
.module-card,
.roadmap div,
.history-page .panel,
.account-page .panel,
.login-card,
.npc-summary,
.controls,
.sheet-card,
.detail-card,
.left-panel {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.metric-card,
.module-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 246, 0.92)),
    #fff;
}

.metric-card:hover,
.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.metric-card {
  min-height: 116px;
  padding: 20px;
}

.metric-card strong {
  font-size: 42px;
  line-height: 46px;
  font-weight: 800;
}

.dashboard-main > .panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 4px 0 0;
}

.panel-head {
  padding: 0;
  border-bottom: 0;
}

.panel-head h3,
.panel-head h2,
.section-head h2 {
  font-size: 24px;
  line-height: 30px;
  font-weight: 800;
}

.module-grid {
  gap: 14px;
}

.module-card {
  min-height: 166px;
  padding: 18px;
  overflow: hidden;
}

.module-card::before {
  left: 18px;
  top: 0;
  width: 52px;
  height: 4px;
  border-radius: 0 0 4px 4px;
}

.module-card.disabled {
  background: rgba(250, 250, 246, 0.72);
  box-shadow: none;
}

.module-title {
  gap: 7px;
}

.module-title strong {
  font-size: 20px;
  line-height: 26px;
}

.module-actions span,
.roadmap strong {
  color: var(--text);
}

.roadmap {
  gap: 10px;
}

.roadmap div {
  min-height: 60px;
  padding: 12px 14px;
}

.topbar {
  min-height: 74px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(247, 247, 242, 0.9);
  backdrop-filter: saturate(160%) blur(22px);
  box-shadow: 0 12px 32px rgba(32, 33, 35, 0.04);
}

.top-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.has-site-nav .topbar .mark {
  display: none;
}

body.has-site-nav .topbar .title-block {
  min-width: min(300px, 100%);
}

.top-actions .btn.link[href="/"],
.top-actions .btn.link[href="/account.html"],
.top-actions .btn.link[href="/schedule-history.html"] {
  display: none;
}

.layout {
  grid-template-columns: 240px minmax(560px, 1fr) 360px;
  gap: 16px;
  padding: 16px clamp(14px, 2vw, 24px) 28px;
}

.left-panel {
  padding: 12px;
}

.npc-cards {
  gap: 8px;
  padding-right: 2px;
}

.npc-category-tabs {
  border-radius: 999px;
  background: rgba(231, 231, 223, 0.88);
  padding: 3px;
  gap: 3px;
}

.npc-category-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--slate);
}

.npc-category-tab:hover,
.npc-category-tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.npc-card {
  border-color: rgba(0, 0, 0, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 12px;
}

.npc-card:hover,
.npc-card.active {
  border-color: rgba(16, 163, 127, 0.3);
  background: #eef8f3;
}

.npc-summary,
.controls,
.detail-card {
  overflow: hidden;
}

.npc-summary {
  min-height: 104px;
  padding: 18px 20px;
}

.npc-summary h2 {
  font-size: 30px;
  line-height: 36px;
  font-weight: 800;
}

.npc-meta {
  gap: 10px 18px;
}

.npc-meta div {
  min-width: 86px;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  padding-left: 12px;
}

.controls {
  min-height: 60px;
  padding: 12px 14px;
}

.season-tabs,
.map-scope-tabs {
  border-radius: 999px;
  background: rgba(231, 231, 223, 0.88);
  padding: 3px;
  gap: 3px;
}

.season-tab,
.map-scope-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--slate);
}

.season-tab.active,
.map-scope-tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.sheet-card {
  background: #fff;
}

.sheet-title,
.day-head,
.weather-head {
  background: #fafaf6;
  color: var(--text);
}

.sheet-title {
  min-height: 42px;
  font-size: 18px;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.day-head,
.weather-head {
  min-height: 38px;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.day-column,
.weather-column {
  border-right-color: rgba(0, 0, 0, 0.08);
}

.entry-row {
  min-height: 78px;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.entry-row:nth-child(3n) {
  background: #fafaf6;
}

.entry-row.active {
  outline: 2px solid var(--accent);
  background: #eef8f3;
}

.entry-task-badge {
  border-color: rgba(191, 91, 0, 0.22);
  background: #fff7ed;
  color: #9a4b00;
}

.entry-time {
  border-right-color: rgba(0, 0, 0, 0.06);
}

.entry-add {
  min-height: 40px;
  background: #fafaf6;
}

.trajectory-summary {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.trajectory-item,
.old-point {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.detail-head {
  padding: 14px;
  background: #fafaf6;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.detail-grid {
  gap: 12px;
  padding: 14px;
}

.action-field {
  grid-template-columns: minmax(0, 1.25fr) minmax(170px, .75fr);
}

.map-picker {
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius);
  background: #fafaf6;
  padding: 10px;
}

.map-picker-grid {
  gap: 8px;
}

.sleep-badge {
  background: #fff6d6;
  color: #8a4100;
}

.check-line {
  min-height: 40px;
  align-items: center;
  border-radius: var(--radius);
  background: #fafaf6;
  padding: 8px 10px;
  margin-top: 0;
}

.old-point-list,
.trajectory-list,
.right-panel {
  scrollbar-color: #c7c7cc transparent;
}

.history-page .layout {
  grid-template-columns: 360px minmax(0, 1fr);
  padding: 0;
}

.history-page .panel,
.account-page .panel {
  overflow: hidden;
}

.history-page .panel-head,
.account-page .section-head {
  background: #fafaf6;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.account-page .panel > h2 {
  padding: 0 0 12px;
}

.account-page .grid-form {
  padding: 0;
}

.user-row {
  border-color: rgba(0, 0, 0, 0.08);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.permission-field,
.permission-check {
  border-color: rgba(0, 0, 0, 0.09);
}

.permission-check {
  background: #fafaf6;
}

.draft-item,
.version-item {
  border-bottom-color: rgba(0, 0, 0, 0.07);
}

.draft-item:hover,
.draft-item.active {
  background: #eef8f3;
  border-left-color: var(--accent);
}

.login-page {
  background:
    radial-gradient(circle at 50% 0%, rgba(16, 163, 127, 0.08), transparent 280px),
    linear-gradient(180deg, #fafaf6 0%, #f7f7f2 58%, #ffffff 100%);
}

.login-card {
  padding: 36px;
}

.login-card h1 {
  font-size: 36px;
  line-height: 42px;
  font-weight: 800;
}

.login-card .btn {
  min-height: 42px;
}

.toast {
  border-radius: var(--radius);
  background: rgba(29, 29, 31, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: 250px minmax(620px, 1fr);
  }
}

@media (max-width: 900px) {
  .dashboard-main,
  .history-page,
  .account-page {
    padding: 24px 16px;
  }

  .layout,
  .history-page .layout {
    grid-template-columns: 1fr;
  }

  .npc-meta {
    text-align: left;
  }

  .npc-meta div {
    border-left: 0;
    padding-left: 0;
  }

  .npc-summary h2 {
    font-size: 26px;
    line-height: 32px;
    overflow-wrap: anywhere;
  }

  .npc-meta {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    text-align: left;
  }

  .action-field {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --site-nav-collapsed-width: 64px;
  }

  body.has-site-nav {
    padding-left: var(--site-nav-collapsed-width);
  }

  .site-nav {
    width: var(--site-nav-collapsed-width);
  }

  .topbar {
    padding: 12px;
  }

  body.has-site-nav .topbar .title-block {
    min-width: 0;
  }

  .topbar h1 {
    font-size: 18px;
    line-height: 23px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .top-actions .btn {
    min-height: 34px;
    padding: 6px 10px;
  }

  .layout {
    padding: 12px;
  }

  .left-panel,
  .npc-summary,
  .controls,
  .sheet-card,
  .detail-card {
    border-radius: var(--radius);
  }

  .npc-summary {
    padding: 16px;
  }

  .npc-summary h2 {
    font-size: 24px;
    line-height: 30px;
  }
}
