:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --panel: #fffdf9;
  --panel-soft: #ffffff;
  --line: rgba(31, 36, 48, 0.16);
  --text: #161b24;
  --muted: #4f5662;
  --brand: #23463f;
  --accent: #23463f;
  --accent-warm: #dd7d4f;
  --accent-soft: #dfe9e5;
  --shadow: 0 10px 28px rgba(28, 34, 44, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(35, 70, 63, 0.12), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(226, 120, 73, 0.12), transparent 18%),
    linear-gradient(180deg, #f3ede4 0%, #f8f6f2 34%, #f7f7f4 100%),
    var(--bg);
  font-family: "LXGW WenKai Screen", "霞鹜文楷屏幕阅读版", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

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

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

.app-shell {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 54px 18px 22px;
  background: rgba(255, 253, 249, 0.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  display: grid;
  place-items: center;
  gap: 8px;
  margin-bottom: 28px;
  text-align: center;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  background: #23463f;
  border-radius: 50%;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(35, 70, 63, 0.16);
}

.brand strong {
  font-size: 13px;
}

.brand small {
  max-width: 88px;
  color: #4f5662;
  font-size: 12px;
  line-height: 1.45;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-link {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 7px 8px;
  color: #4f5662;
  border-radius: 7px;
  font-size: 13px;
}

.side-link svg,
.section h2 svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.side-link:hover,
.side-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.main {
  padding: 52px clamp(22px, 5vw, 76px) 76px;
}

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

.page-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 7px 0 0;
  color: #4f5662;
  font-size: 14px;
}

.admin-link,
.primary,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  color: var(--accent);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(28, 34, 44, 0.05);
  cursor: pointer;
}

.primary {
  color: #fff;
  background: #23463f;
  border-color: rgba(35, 70, 63, 0.2);
}

.section {
  scroll-margin-top: 32px;
  margin-top: 34px;
}

.section h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

.site-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 62px;
  padding: 13px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.site-card:hover {
  transform: translateY(-2px);
  border-color: rgba(35, 70, 63, 0.24);
  box-shadow: 0 14px 34px rgba(28, 34, 44, 0.11);
}

.site-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--mark-color);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.site-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.site-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.site-copy small {
  overflow: hidden;
  color: #4f5662;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-shell {
  min-height: 100vh;
  padding: 34px clamp(18px, 4vw, 56px);
}

.admin-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-panel,
.workspace-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-panel {
  position: sticky;
  top: 24px;
  padding: 18px;
}

.workspace-panel {
  padding: 22px;
}

.panel-title {
  margin: 0 0 14px;
  font-size: 15px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

textarea {
  min-height: 190px;
  padding: 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(35, 70, 63, 0.32);
  box-shadow: 0 0 0 3px rgba(35, 70, 63, 0.1);
}

.stack {
  display: grid;
  gap: 13px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.admin-tabs {
  display: grid;
  gap: 8px;
}

.admin-tab {
  justify-content: space-between;
  width: 100%;
}

.admin-tab.is-active {
  color: #fff;
  background: #23463f;
  border-color: rgba(35, 70, 63, 0.2);
}

.admin-tab small {
  color: currentColor;
  opacity: 0.68;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 96px 90px;
  gap: 12px;
}

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

.editor-list {
  display: grid;
  gap: 14px;
}

.editor-card {
  padding: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.editor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.editor-head strong {
  flex: 1;
}

.icon-button {
  width: 30px;
  min-height: 30px;
  padding: 0;
  color: #8b97a8;
  font-size: 18px;
}

.json-panel {
  margin-top: 22px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .brand {
    justify-items: start;
    grid-template-columns: 34px 1fr;
    text-align: left;
    margin-bottom: 16px;
  }

  .brand small {
    grid-column: 2;
    max-width: none;
  }

  .side-nav {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

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

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 24px 16px 48px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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