:root {
  color-scheme: light;
  --bg: #f6f4ed;
  --surface: #fffefb;
  --jade: #587965;
  --jade-soft: #e9f0ea;
  --ink: #20342d;
  --muted: #6f7c73;
  --line: #e4e2da;
  --gold: #c9ad76;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --safe-top: max(12px, env(safe-area-inset-top));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--jade); }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }

.app {
  position: relative;
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow-x: hidden;
}

.app::before {
  content: "";
  position: absolute;
  top: 36px;
  right: 0;
  width: 120px;
  height: 120px;
  pointer-events: none;
  opacity: 0.8;
  background: url("/decor/leaf.png") right top / contain no-repeat;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 52px;
  padding: var(--safe-top) 4px 8px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}

.bar-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg { width: 22px; height: 22px; display: block; }

main {
  position: relative;
  z-index: 1;
  padding: 4px 20px calc(28px + var(--safe-bottom));
}

h1 {
  margin: 4px 0 12px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
}

h2 {
  margin: 28px 0 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 650;
}

p { margin: 0 0 12px; }

.mark {
  color: #c0392b;
  font-weight: 700;
  font-size: 17px;
}

.sheet {
  margin: 8px 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

th, td {
  min-width: 7.5em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--jade-soft);
  font-weight: 650;
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }
