:root {
  --bg: #f4f2ec;
  --bg-2: #eceae3;
  --surface: #fbfaf6;
  --ink: #23211c;
  --ink-soft: #4f4a41;
  --muted: #8c8578;
  --line: #e4ddd0;
  --gold: #a8894f;
  --jade: #6f8f7c;
  --danger: #b4553f;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(50, 44, 32, 0.07), 0 2px 8px rgba(50, 44, 32, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(circle at 50% -10%, rgba(168, 137, 79, 0.06), transparent 60%);
}

a { color: var(--jade); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- layout ---------------- */
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 24px; }

header.top {
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .enso { width: 30px; height: 30px; }
.brand .name {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.16em;
  color: var(--ink);
}
header.top nav a {
  margin-left: 22px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
header.top nav a:hover { color: var(--ink); text-decoration: none; }

main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 0 60px; }

footer.bot {
  padding: 24px 0 34px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------------- hero ---------------- */
.hero { text-align: center; padding: 40px 0; }
.hero .enso-lg { width: 92px; height: 92px; opacity: 0.9; margin-bottom: 26px; }
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
  line-height: 1.35;
}
.hero p.lead {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 2;
  max-width: 520px;
  margin: 0 auto 34px;
}
.hero .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------- card / auth ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 38px 34px 34px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}
.card h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0 0 6px;
}
.card .sub { font-size: 13px; color: var(--muted); margin: 0 0 24px; line-height: 1.8; }

.tabs { display: flex; gap: 6px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.tabs button {
  appearance: none;
  background: none;
  border: none;
  padding: 10px 4px 12px;
  margin-right: 20px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tabs button.active { color: var(--ink); border-color: var(--gold); }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(168, 137, 79, 0.12);
}
.field.row-2 { display: flex; gap: 10px; align-items: flex-end; }
.field.row-2 .grow { flex: 1; }

.btn {
  appearance: none;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
  color: #f7f3ea;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s, background 0.2s, opacity 0.2s;
}
.btn:hover { background: #39352d; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: rgba(0,0,0,0.03); }
.btn.block-sm { width: auto; padding: 12px 18px; white-space: nowrap; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
a.btn { display: inline-block; width: auto; }

.msg { font-size: 13px; line-height: 1.8; padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; display: none; }
.msg.show { display: block; }
.msg.ok { background: rgba(111,143,124,0.12); color: #446a54; border: 1px solid rgba(111,143,124,0.28); }
.msg.err { background: rgba(180,85,63,0.10); color: #93402e; border: 1px solid rgba(180,85,63,0.26); }

.altrow { margin-top: 22px; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------------- dashboard ---------------- */
.panel { max-width: 620px; margin: 0 auto; }
.panel .hey {
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.kv { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-top: 22px; }
.kv .row { display: flex; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv .row:last-child { border-bottom: none; }
.kv .row .k { color: var(--muted); letter-spacing: 0.06em; }
.kv .row .v { color: var(--ink); }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.badge.on { background: rgba(111,143,124,0.15); color: #446a54; }
.badge.off { background: rgba(140,133,120,0.15); color: var(--muted); }

.hide { display: none !important; }
.center { text-align: center; }
.mt24 { margin-top: 24px; }

@media (max-width: 520px) {
  .card { padding: 30px 22px 26px; }
  header.top nav a { margin-left: 14px; }
}
