:root {
  --primary: #334155;
  --primary-dark: #1e293b;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --radius: 10px;
  --danger: #b91c1c;
  --header-h: 60px;
  --tabbar-h: 64px;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(15, 23, 42, 0.08);
  --overlay: rgba(255, 255, 255, 0.90);
  --lh: 1.125;
  --font-body: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: transparent; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--lh);
  color: var(--text-main);
}
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.page-bg {
  position: fixed; inset: 0; z-index: 50;
  background: #e2e8f0 center / cover no-repeat;
}
.page-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: var(--overlay); pointer-events: none;
}
.site-header {
  position: sticky; top: 0; z-index: 90; height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.site-header.is-scrolled {
  background: rgba(255,255,255,0.92);
  border-bottom-color: var(--glass-border);
}
.header-inner {
  width: 100%; max-width: 720px; margin: 0 auto; padding: 0 1rem;
  height: var(--header-h); display: flex; align-items: center;
  justify-content: space-between; gap: 0.75rem;
}
.brand {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--text-main);
}
.brand-logo { width: 28px; height: 28px; object-fit: contain; display: block; }
.brand-name {
  font-weight: 700; font-style: italic; font-size: 1.25rem; color: var(--primary);
}
.header-actions { display: flex; align-items: center; gap: 0.4rem; }
.content-shell {
  position: relative; z-index: 100; width: 100%;
  min-height: calc(100vh - var(--header-h));
  border-top: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding-bottom: calc(var(--tabbar-h) + 1.25rem);
}
.container { max-width: 720px; margin: 0 auto; padding: 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.4rem 0.85rem; border-radius: 8px; border: none;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn:hover, .btn:active { background: var(--primary-dark); color: #fff; }
.btn-secondary {
  background: #fff; color: var(--text-main); border: 1px solid var(--border);
}
.btn-sm { padding: 0.25rem 0.55rem; font-size: 0.85rem; }
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem;
}
input, select, textarea {
  width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; margin-bottom: 0.55rem; background: #fff;
}
.label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.badge {
  display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.45rem;
  border-radius: 999px; background: #dbeafe; color: #1e40af;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  height: var(--tabbar-h); display: flex; justify-content: space-around;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--glass-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar-item {
  flex: 1; max-width: 120px; border: none; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 0.72rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.15rem; cursor: pointer;
}
.tabbar-item .tab-icon { width: 22px; height: 22px; }
.tabbar-item .tab-icon svg { width: 100%; height: 100%; fill: currentColor; }
.tabbar-item.active { color: var(--primary); }
.ad-line {
  position: relative; z-index: 100; text-align: center; font-size: 0.85rem;
  color: var(--text-muted); padding: 0.55rem 1rem; border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
}
.ad-line a { color: var(--primary); text-decoration: none; }
.help-toggle {
  position: fixed; bottom: calc(var(--tabbar-h) + 0.75rem); right: 1rem; z-index: 120;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; color: var(--primary); font-size: 1.2rem; font-weight: 700; cursor: pointer;
}
.help-panel {
  display: none; position: fixed; bottom: calc(var(--tabbar-h) + 4rem); right: 1rem;
  width: min(320px, calc(100vw - 2rem)); z-index: 120; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; padding: 1rem;
  box-shadow: 0 12px 28px rgba(0,0,0,0.12); font-size: 0.92rem;
}
.help-panel.open { display: block; }
.help-panel h3 { color: var(--primary); margin-bottom: 0.4rem; }
.help-panel ol { padding-left: 1.1rem; color: var(--text-muted); }
