/* Taiwanese office wall calendar: holidays printed in red, leave days stamped with an indigo 「請」 seal. */
:root {
  --page: #f1f2ee;
  --card: #ffffff;
  --ink: #1b1e23;
  --muted: #5b626d;
  --line: #d9dcd4;
  --red: #c4231c;
  --red-bg: #fce9e7;
  --seal: #2f3f9e;
  --seal-ink: #ffffff;
  --work: #6b7280;
  --work-bg: #eef0f3;
  --focus: #2f3f9e;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --num: "Oswald", "Arial Narrow", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #14161a; --card: #1d2026; --ink: #e8eaee; --muted: #a0a7b3; --line: #30353e;
    --red: #ff7a70; --red-bg: #3a1f1d; --seal: #8e9cf0; --seal-ink: #121426; --work: #a0a7b3; --work-bg: #262a31;
    --focus: #8e9cf0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #14161a; --card: #1d2026; --ink: #e8eaee; --muted: #a0a7b3; --line: #30353e;
  --red: #ff7a70; --red-bg: #3a1f1d; --seal: #8e9cf0; --seal-ink: #121426; --work: #a0a7b3; --work-bg: #262a31;
  --focus: #8e9cf0; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.7 var(--font); }
a { color: var(--seal); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.site-head { background: var(--card); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .mark { width: 26px; height: 26px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }

.wrap { max-width: 860px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
main.wrap { padding-top: 28px; padding-bottom: 56px; }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.3; margin: 0 0 8px; }
h2 { font-size: 22px; line-height: 1.4; margin: 40px 0 12px; }
h3 { font-size: 17px; margin: 0; }
.lead { color: var(--muted); margin: 0 0 20px; max-width: 40em; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.form-row { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select { font: 16px var(--font); color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; min-height: 42px; }
input[type="number"] { width: 6.5em; }
input[type="date"] { min-width: 10.5em; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; min-height: 42px; }
.check input { width: 18px; height: 18px; min-height: 0; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 6px; font-size: 20px; cursor: pointer; }
.stepper input { text-align: center; width: 4em; }

.note { font-size: 14px; color: var(--muted); }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 10px; padding: 18px; color: var(--muted); }

/* Result cards */
.results { display: grid; gap: 12px; margin-top: 16px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ratio { font-family: var(--num); font-weight: 600; font-size: 28px; line-height: 1.1; letter-spacing: .01em; }
.ratio .q { color: var(--seal); }
.ratio .r { color: var(--red); }
.ratio small { font-family: var(--font); font-size: 15px; font-weight: 600; margin: 0 2px; color: var(--ink); }
.plan-meta { color: var(--muted); font-size: 15px; }
.plan-meta b { color: var(--ink); font-weight: 600; }

/* Day strip */
.strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; padding: 0; list-style: none; }
.day { width: 40px; border-radius: 6px; text-align: center; padding: 3px 0 4px; background: var(--work-bg); color: var(--work); }
.day .n { display: block; font-family: var(--num); font-size: 17px; font-weight: 600; line-height: 1.2; }
.day .w { display: block; font-size: 11px; line-height: 1.2; }
.day.off { background: var(--red-bg); color: var(--red); }
.day.leave { background: var(--seal); color: var(--seal-ink); position: relative; }
.day.leave .w::before { content: "請"; font-weight: 700; }
.day.leave .w span { display: none; }
.day.makeup { box-shadow: inset 0 0 0 2px var(--work); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.legend .l-off { background: var(--red-bg); box-shadow: inset 0 0 0 1px var(--red); }
.legend .l-leave { background: var(--seal); }
.legend .l-work { background: var(--work-bg); box-shadow: inset 0 0 0 1px var(--work); }

/* Year plan */
.yearplan { margin-top: 12px; }
.total { font-size: 17px; margin: 0 0 8px; }
.total .big { font-family: var(--num); font-size: 30px; font-weight: 600; color: var(--red); margin: 0 4px; }

/* Long-weekend table */
.breaks { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.breaks th, .breaks td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.breaks th { font-size: 14px; color: var(--muted); font-weight: 600; }
.breaks tr:last-child td { border-bottom: 0; }
.breaks .len { font-family: var(--num); font-size: 20px; font-weight: 600; color: var(--red); white-space: nowrap; }
.breaks .past td { color: var(--muted); }
.breaks .past .len { color: var(--muted); }

/* Simple calculators */
.calc + .calc { margin-top: 16px; }
.answer { margin: 14px 0 0; font-size: 17px; }
.answer .big { font-family: var(--num); font-size: 34px; font-weight: 600; color: var(--red); margin: 0 4px; }
.answer-sub { color: var(--muted); font-size: 15px; margin: 2px 0 0; }

.faq h3 { margin-top: 20px; }
.faq p { margin: 4px 0 0; }

.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-foot .wrap { padding-top: 18px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--muted); }

@media (max-width: 480px) {
  .panel { padding: 14px; }
  .day { width: calc((100% - 24px) / 7); }
  .breaks th, .breaks td { padding: 8px; font-size: 15px; }
}
@media print { .site-head, .site-foot, form { display: none; } body { background: #fff; } }
