:root {
  --ink: #1d2129;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --gold: #b9822b;
  --gold-deep: #8a5a16;
  --green: #0f8f43;
  --red: #c24135;
  --blue: #1d4ed8;
  --shadow: 0 12px 30px rgba(28, 31, 35, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Inter", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.app {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #fbfaf7;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(251, 250, 247, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, .8);
}

.brand { font-weight: 800; letter-spacing: 0; }
.toplink { color: var(--gold-deep); text-decoration: none; font-size: 13px; font-weight: 700; }

.content { padding: 18px; display: grid; gap: 14px; }
.hero {
  background: linear-gradient(135deg, #1f2933 0%, #3a3123 58%, #b88633 100%);
  color: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.22; letter-spacing: 0; }
.hero p { margin: 0; color: rgba(255,255,255,.78); line-height: 1.55; font-size: 13px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(20, 20, 20, .03);
}

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.row { display: grid; gap: 8px; margin-bottom: 10px; }
label { font-size: 12px; color: var(--muted); font-weight: 700; }
input, select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(185, 130, 43, .18); border-color: #d6a14c; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  height: 42px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  color: #1f1608;
  background: #d6a14c;
  font-weight: 800;
  font-size: 15px;
}
.btn.secondary { background: #f1eadf; color: var(--gold-deep); }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn.compact { width: auto; height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .55; }
.link-button { display: grid; place-items: center; text-decoration: none; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tab {
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}
.tab.active { color: var(--gold-deep); background: #fff4df; border-color: #e8c17a; }

.list { display: grid; gap: 10px; }
.item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.item-main { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.item-title { font-weight: 800; }
.meta { color: var(--muted); font-size: 12px; line-height: 1.55; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.tag { display: inline-flex; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 800; }
.tag.green { color: var(--green); background: #e9f9ef; }
.tag.gold { color: var(--gold-deep); background: #fff4df; }
.tag.red { color: var(--red); background: #fff0ed; }
.tag.gray { color: var(--muted); background: #f3f4f6; }

.notice {
  display: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
}
.notice.show { display: block; }
.notice.ok { color: var(--green); background: #e9f9ef; }
.notice.err { color: var(--red); background: #fff0ed; }
.notice.info { color: var(--blue); background: #eef4ff; }

.bottom-nav {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: #fff;
}
.bottom-nav a {
  height: 54px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}
.bottom-nav a.active { color: var(--gold-deep); }

@media (max-width: 360px) {
  .content { padding: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
}
