@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --bg: #eaf4f1;
  --bg-accent: #d5ebe4;
  --paper: #ffffff;
  --ink: #14303a;
  --muted: #4a6670;
  --line: #d4e5df;
  --line-strong: #8fb5aa;
  --brand: #0d9488;
  --brand-hover: #0f766e;
  --brand-soft: #e6f7f4;
  --brand-line: #99d5cc;
  --accent: #f59e0b;
  --ok: #15803d;
  --ok-soft: #e8f6ee;
  --warn: #b45309;
  --warn-soft: #fff7ed;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(13, 148, 136, 0.06), 0 10px 28px rgba(20, 48, 58, 0.07);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --text: 17px;
  --text-sm: 15px;
  --text-xs: 14px;
  --neutral-soft: #f2f8f6;
  --neutral-mid: #ddeee8;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text);
  line-height: 1.7;
  letter-spacing: 0.02em;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(245, 158, 11, 0.12), transparent 50%),
    radial-gradient(ellipse 70% 45% at 95% 0%, rgba(13, 148, 136, 0.14), transparent 55%),
    linear-gradient(180deg, #e8f5f1 0%, #eef4f6 45%, #f3f6f8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }

.wrap {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
}
.wrap-wide { width: min(1120px, calc(100% - 32px)); }

/* —— Top bar —— */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--brand);
}
.nav {
  display: flex;
  gap: 4px;
}
.nav a {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none !important;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand);
}

/* —— Surfaces —— */
.hero, .card, .ref-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero {
  padding: 28px 28px 26px;
  margin-bottom: 14px;
  background: var(--paper);
  border-left: 4px solid var(--brand);
  background-image: linear-gradient(90deg, var(--brand-soft) 0%, #fff 28%);
}
.hero h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text);
  line-height: 1.75;
  max-width: 640px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.card { padding: 24px 26px; }
.card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}
.hint {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin: 0 0 16px;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  min-height: 46px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: linear-gradient(145deg, #14b8a6 0%, #0d9488 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(145deg, #0d9488 0%, #0f766e 100%);
}
.btn-secondary {
  background: var(--neutral-soft);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--neutral-mid); }
.btn-ghost {
  background: #fff;
  color: var(--muted);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: #64748b;
}
.btn-sm { padding: 8px 14px; font-size: var(--text-xs); min-height: 40px; }
.btn-link {
  border: 1px solid var(--line-strong);
  background: var(--neutral-soft);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 6px;
  text-decoration: none;
}
.btn-link:hover { background: var(--neutral-mid); }

/* —— Form layout —— */
.form-section {
  margin: 22px 0 0;
  padding: 16px 16px 4px;
  border-top: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--brand-soft) 0%, transparent 48px);
  border: 1px solid var(--line);
}
.form-section:first-of-type {
  margin-top: 8px;
}
.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: var(--text);
  font-weight: 700;
  color: var(--ink);
}
.form-section-title span {
  font-weight: 500;
  color: var(--muted);
  font-size: var(--text-xs);
}
.form-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #14b8a6 0%, #0d9488 55%, #0f766e 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.35);
  flex-shrink: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 18px;
  align-items: start;
}
.full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: var(--text);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}
.req {
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}
.field-tip {
  display: block;
  font-weight: 400;
  color: var(--brand-hover);
  font-size: var(--text-xs);
  margin-top: 4px;
  line-height: 1.55;
}
.field-tip.after-control {
  margin-top: 8px;
  color: var(--muted);
}

input[type="text"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 48px;
  font: inherit;
  font-size: var(--text);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #7a939b; }
input:hover, select:hover, textarea:hover { border-color: var(--brand); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.22);
}

/* —— Examples on home —— */
.examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 8px;
}
.ex {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: var(--text-sm);
  line-height: 1.7;
  border: 1px solid transparent;
}
.ex strong {
  display: block;
  margin-bottom: 6px;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}
.ex-good {
  background: var(--ok-soft);
  border-color: #c6e5d2;
  color: #14532d;
}
.ex-bad {
  background: var(--warn-soft);
  border-color: #f0d7b0;
  color: #713f12;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: var(--text-sm);
  border: 1px solid transparent;
}
.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f3c4c0;
}
.alert-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: #c6e5d2;
}

/* —— Admin —— */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: end;
}
.filters .field { min-width: 140px; flex: 1; }
.filters .field.grow { flex: 2; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 14px 10px;
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  font-size: var(--text-xs);
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--neutral-mid);
  color: var(--ink);
}
.badge-high { background: #fde8e6; color: #9f1f16; }
.badge-mid { background: var(--warn-soft); color: var(--warn); }
.badge-low { background: var(--brand-soft); color: var(--brand-hover); }

.detail-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 14px;
}
.kv { margin: 0 0 14px; }
.kv dt {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.kv dd {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: var(--text);
}

.footer-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: center;
}

/* —— Reference panel —— */
.ref-panel {
  margin-bottom: 14px;
  position: sticky;
  top: 10px;
  z-index: 20;
  overflow: hidden;
}
.ref-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--neutral-soft);
  border-bottom: 1px solid var(--line);
}
.ref-panel.collapsed .ref-panel-head { border-bottom: none; }
.ref-panel-head strong {
  display: block;
  font-size: var(--text);
  color: var(--ink);
}
.ref-panel-sub {
  display: block;
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--muted);
}
.ref-panel-body { padding: 12px 16px 14px; }
.ref-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.ref-tab {
  border: none;
  border-right: 1px solid var(--line);
  background: #fff;
  border-radius: 0;
  padding: 10px 16px;
  min-height: 44px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
}
.ref-tab:last-child { border-right: none; }
.ref-tab.active {
  background: linear-gradient(145deg, #14b8a6, #0d9488);
  color: #fff;
}
.ref-tab:not(.active):hover { background: var(--neutral-soft); color: var(--ink); }
.ref-scene { display: none; }
.ref-scene.active { display: block; }
.ref-steps {
  margin: 0 0 12px;
  padding: 12px 14px 12px 32px;
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--ink);
  background: var(--neutral-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
}
.ref-steps b {
  color: var(--ink);
  font-weight: 700;
}

.field-block {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
}
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  min-height: 40px;
}
.field-head label { margin-bottom: 0; flex: 1; }

.file-box {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 0 !important;
  font-weight: 400;
}
.file-box input[type="file"] {
  width: 100%;
  min-height: 0;
  padding: 10px 0;
  border: none;
  box-shadow: none;
  background: transparent;
}
.file-box input[type="file"]:hover,
.file-box input[type="file"]:focus {
  border: none;
  box-shadow: none;
}

/* 常驻示例：左边线，不抢输入框注意力 */
.field-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-text {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  padding: 8px 4px;
  min-height: 40px;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-text:hover,
.btn-text.is-on { color: var(--brand); }

.sample-stay {
  background: var(--neutral-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: #1e293b;
}
.tool-extra {
  margin-top: 4px;
}
.tool-extra[hidden] { display: none !important; }
.sample-stay.compact {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: var(--text-xs);
}
.sample-stay p { margin: 0 0 2px; }
.sample-stay p:last-child { margin-bottom: 0; }
.sample-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--muted);
  margin-right: 6px;
  letter-spacing: 0.02em;
}
.sample-alt {
  color: var(--muted);
  font-size: var(--text-xs);
}
.just-filled {
  border-color: var(--ok) !important;
  box-shadow: 0 0 0 3px rgba(27, 107, 58, 0.14) !important;
  background: #f7fcf8 !important;
}

/* 底部提交条 */
.submit-bar {
  position: sticky;
  bottom: 12px;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.submit-bar .tip {
  font-size: var(--text-sm);
  color: var(--muted);
}

@media (max-width: 760px) {
  .grid, .examples, .detail-grid { grid-template-columns: 1fr; }
  .hero { padding: 20px 18px; }
  .card { padding: 16px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .field-head { flex-direction: column; align-items: flex-start; }
  .ref-panel { position: static; }
  .submit-bar {
    flex-direction: column;
    align-items: stretch;
    position: static;
  }
  .ref-tabs { display: flex; width: 100%; }
  .ref-tab { flex: 1; text-align: center; padding: 8px 6px; }
}

/* —— 管理端：常规密度，不必大字 —— */
body.skin-admin {
  --text: 14px;
  --text-sm: 13px;
  --text-xs: 12px;
  --brand: #0f766e;
  letter-spacing: 0;
  line-height: 1.5;
  background: #eef2f1;
}
body.skin-admin .brand { font-size: 15px; }
body.skin-admin .nav a {
  font-size: 13px;
  padding: 6px 10px;
  min-height: 0;
  font-weight: 500;
}
body.skin-admin .card { padding: 18px 20px; }
body.skin-admin .card h2 { font-size: 16px; margin-bottom: 10px; }
body.skin-admin .hint { font-size: 12px; margin-bottom: 12px; }
body.skin-admin label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}
body.skin-admin input[type="text"],
body.skin-admin input[type="date"],
body.skin-admin input[type="password"],
body.skin-admin select,
body.skin-admin textarea {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
  border-width: 1px;
}
body.skin-admin textarea { min-height: 88px; }
body.skin-admin .btn {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
}
body.skin-admin .btn-sm {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}
body.skin-admin table { font-size: 13px; }
body.skin-admin th,
body.skin-admin td { padding: 8px 8px; }
body.skin-admin th { font-size: 12px; font-weight: 600; }
body.skin-admin .badge {
  font-size: 12px;
  padding: 2px 7px;
  font-weight: 600;
}
body.skin-admin .kv dt { font-size: 12px; }
body.skin-admin .kv dd { font-size: 13px; line-height: 1.5; }
body.skin-admin .filters { gap: 8px; margin-bottom: 12px; }
body.skin-admin .alert { font-size: 13px; padding: 9px 12px; }
