@import url('/assets/theme.css');

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }

/* 像素風邊框 */
.px {
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 rgba(0,0,0,.35);
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 2px solid var(--line); padding: 5px 12px;
  box-shadow: 2px 2px 0 var(--line); cursor: pointer; white-space: nowrap; color: var(--ink);
}
.btn:hover { background: #fff7ea; }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); }
.btn.danger { background: var(--bad); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 2px 8px; font-size: 13px; }

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 6px 8px; background: #fffaf2; border: 2px solid var(--line); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.err { color: var(--bad); font-size: 14px; min-height: 1.4em; margin-top: 8px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* 置中卡片（登入、首次設定） */
.center-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.card { width: 100%; max-width: 380px; padding: 24px 26px; }
.card h1 { margin: 0 0 4px; font-size: 22px; }

/* 對話框 */
.modal-back { position: fixed; inset: 0; background: rgba(20,16,12,.6); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: 100%; max-width: 420px; padding: 20px 22px; }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* 額度條 */
.quota { display: flex; align-items: center; gap: 8px; }
.qbar { width: 160px; height: 14px; border: 2px solid var(--line); background: #fffaf2; position: relative; }
.qbar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); }
.qbar.mid > i { background: var(--warn); }
.qbar.high > i { background: var(--bad); }
.qtext { font-size: 13px; white-space: nowrap; }

table.grid { width: 100%; border-collapse: collapse; background: #fffaf2; }
table.grid th, table.grid td { border: 2px solid var(--line); padding: 6px 8px; text-align: left; font-size: 14px; vertical-align: middle; }
table.grid th { background: var(--panel2); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 0 6px; border: 2px solid var(--line); font-size: 12px; background: var(--panel2); }
.tag.on { background: #cfe6c3; }
.tag.off { background: #e8c3bf; }
a.btn { text-decoration: none; color: var(--ink); }

/* 像素字：標題、分頁、額度數字 */
.card h1, .modal h2, section h2 { font: 24px/1.3 var(--pixel); }
.px-font { font-family: var(--pixel); }
