:root { color-scheme: light; --purple: #5a2870; --purple-dark: #311a3d; --gold: #e5a537; --ink: #26222a; --muted: #6f6972; --line: #ded9e1; --surface: #fff; --bg: #f5f2f6; }
* { box-sizing: border-box; }
html { font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
a { color: inherit; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 70px; }
[hidden] { display: none !important; }
.login-card { width: min(480px, 100%); margin: 7vh auto 0; padding: 36px; border-radius: 22px; background: white; box-shadow: 0 20px 70px rgba(49,26,61,.12); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--purple); color: white; font-size: 23px; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 21px; letter-spacing: .08em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
h1 { margin: 35px 0 8px; font-size: 34px; }
.login-card > p { margin: 0 0 26px; color: var(--muted); line-height: 1.7; }
label { display: block; font-weight: 800; font-size: 14px; }
input, select, textarea { width: 100%; min-height: 48px; margin-top: 7px; padding: 10px 12px; border: 1px solid #cfc8d1; border-radius: 9px; background: white; color: var(--ink); }
textarea { resize: vertical; }
button, .button { min-height: 48px; padding: 0 18px; border: 0; border-radius: 9px; background: var(--purple); color: white; font-weight: 800; text-decoration: none; display: inline-grid; place-items: center; }
button:disabled { opacity: .62; cursor: wait; }
.login-card form button { width: 100%; margin-top: 4px; }
.error { min-height: 22px; margin: 9px 0; color: #a62c2c; font-size: 14px; font-weight: 700; }
.back-link { display: block; width: max-content; margin: 24px auto 0; color: var(--muted); font-size: 14px; }
.dashboard > header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0 27px; }
.header-actions { display: flex; gap: 9px; }
.button.secondary, button.secondary { background: white; color: var(--purple); border: 1px solid var(--purple); }
.button.quiet { background: #e9e5ea; color: #4d4650; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.stats article { padding: 19px 21px; border-radius: 14px; background: white; border-left: 5px solid var(--gold); box-shadow: 0 5px 20px rgba(49,26,61,.05); }
.stats span, .stats strong { display: block; }
.stats span { color: var(--muted); font-size: 13px; font-weight: 800; }
.stats strong { margin-top: 4px; font-size: 34px; }
.filters { display: grid; grid-template-columns: 180px 1fr auto auto; gap: 12px; align-items: end; margin: 24px 0; padding: 18px; border-radius: 14px; background: white; }
.notice { min-height: 24px; margin: -8px 0 10px; color: #397049; font-weight: 700; font-size: 14px; }
.report-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.report-card { padding: 22px; border-radius: 16px; background: white; box-shadow: 0 5px 22px rgba(49,26,61,.055); }
.report-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.report-head div { display: flex; gap: 10px; align-items: center; }
.case-id { color: var(--purple); font-weight: 900; }
.category { font-size: 18px; }
.status-badge { padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.status-badge.new { background: #f7e7c6; color: #7b5108; }
.status-badge.in_progress { background: #dcecf7; color: #195979; }
.status-badge.done { background: #dcefe2; color: #24613a; }
.description { min-height: 54px; white-space: pre-wrap; line-height: 1.7; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; padding: 13px; border-radius: 10px; background: #f7f5f8; }
dl div { min-width: 0; }
dt { color: var(--muted); font-size: 12px; font-weight: 800; }
dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 700; }
.case-form { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: end; border-top: 1px solid var(--line); padding-top: 16px; }
.case-form label:last-of-type { grid-column: 2; grid-row: 1 / span 2; }
.case-form button { width: 160px; }
.save-result { min-height: 20px; color: #397049; font-size: 13px; font-weight: 700; }
.empty { padding: 55px 20px; border-radius: 15px; background: white; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  main { width: min(100% - 22px, 620px); padding-top: 14px; }
  .login-card { margin-top: 3vh; padding: 26px 20px; }
  .dashboard > header { align-items: flex-start; }
  .dashboard > header .brand small { max-width: 125px; }
  .header-actions { flex-direction: column; }
  .header-actions .button { min-height: 42px; padding-inline: 12px; font-size: 13px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stats article { padding: 15px; }
  .stats strong { font-size: 28px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 14px; gap: 10px; }
  .filters label { grid-column: 1 / -1; }
  .report-list { grid-template-columns: 1fr; }
  .report-card { padding: 18px 15px; }
  dl { grid-template-columns: 1fr; }
  .case-form { grid-template-columns: 1fr; }
  .case-form label:last-of-type { grid-column: auto; grid-row: auto; }
  .case-form button { width: 100%; }
}
