:root {
  --brand: #842a36;
  --brand-dark: #63212b;
  --accent: #d77b43;
  --ink: #26272b;
  --muted: #737780;
  --line: #e5e2df;
  --canvas: #f6f4f2;
  --white: #fff;
  --success: #236b4d;
  --warning: #8a5a12;
  --danger: #a53a37;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { height: 68px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 750; letter-spacing: .02em; }
.brand-mark { color: var(--brand); font-size: 22px; font-weight: 900; letter-spacing: -.06em; }
.topbar-user { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.admin-shell { min-height: calc(100vh - 112px); display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { padding: 24px 14px; background: #fff; border-right: 1px solid var(--line); }
.sidebar-caption { padding: 0 12px 12px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.sidebar a { display: block; padding: 11px 12px; margin: 2px 0; border-radius: 8px; color: #45464b; font-size: 14px; }
.sidebar a:hover { background: #f8eeee; color: var(--brand); text-decoration: none; }
.content { min-width: 0; padding: 30px clamp(18px, 3vw, 44px); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 6px 0 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.2; }
h2 { margin: 0 0 14px; font-size: 18px; }
p { line-height: 1.7; }
.muted, .panel p { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card, .panel, .install-card, .login-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(39, 29, 27, .04); }
.stat-card { display: flex; flex-direction: column; gap: 9px; padding: 20px; color: var(--ink); }
.stat-card:hover { border-color: #d9b8bc; text-decoration: none; }
.stat-card span, .stat-card small { color: var(--muted); font-size: 13px; }
.stat-card strong { color: var(--brand); font-size: 34px; line-height: 1; }
.panel { padding: 22px; margin-bottom: 18px; }
.welcome-panel { max-width: 820px; }
.table-panel { padding: 0; overflow: hidden; }
.panel-heading { padding: 20px 22px 14px; }
.panel-heading h2 { margin-bottom: 4px; }
.panel-heading p { margin: 0; font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #575a60; background: #faf9f8; white-space: nowrap; }
td { min-width: 74px; }
.empty-cell { padding: 32px; text-align: center; color: var(--muted); }
.actions-cell { min-width: 220px; }
.inline-form { display: inline-block; margin: 0 4px 4px 0; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: var(--white); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.button:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-dark); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.small-button { padding: 6px 9px; font-size: 12px; }
.notice { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; line-height: 1.6; }
.notice.success { color: var(--success); background: #edf7f1; border-color: #cee7d8; }
.notice.warning { color: var(--warning); background: #fff7e7; border-color: #efdfbd; }
.notice.error { color: var(--danger); background: #fff0ef; border-color: #f0cfcd; }
.notice.small { font-size: 13px; }
.footer { padding: 18px; color: var(--muted); text-align: center; font-size: 12px; }
.install-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: linear-gradient(140deg, #f5efed, #f7f6f3 55%, #efe8e4); }
.install-card, .login-card { width: min(100%, 760px); padding: clamp(22px, 4vw, 40px); }
.login-card { max-width: 460px; }
.install-brand { margin-bottom: 26px; }
.install-form { margin-top: 18px; }
.install-form h2 { margin: 24px 0 12px; }
.install-form label { display: flex; flex-direction: column; gap: 7px; color: #55575c; font-size: 13px; font-weight: 700; }
.install-form input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d7d3cf; border-radius: 7px; background: #fff; color: var(--ink); font: inherit; }
.install-form input:focus { outline: 2px solid rgba(132, 42, 54, .16); border-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full-width { grid-column: 1 / -1; }
.check-panel { margin: 22px 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf9; }
.check-panel h2 { margin-bottom: 10px; }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; padding-left: 18px; color: #56585e; font-size: 13px; }
.install-form > .button { margin-top: 16px; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .topbar { height: 60px; padding: 0 16px; }
  .topbar-user { gap: 10px; font-size: 12px; }
  .admin-shell { display: block; }
  .sidebar { display: flex; gap: 4px; overflow-x: auto; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-caption { display: none; }
  .sidebar a { flex: 0 0 auto; padding: 9px 10px; white-space: nowrap; font-size: 12px; }
  .content { padding: 22px 14px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 28px; }
  .form-grid, .check-list { grid-template-columns: 1fr; }
  .install-card, .login-card { padding: 22px 18px; }
  .page-heading { margin-bottom: 18px; }
}
