:root {
  --ink: #172033; --muted: #6d7890; --line: #e8ebf1; --surface: #fff; --canvas: #f5f7fb;
  --navy: #101a33; --blue: #4c6fff; --green: #21a16b; --orange: #ec8a42; --purple: #7c5bdd;
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  color: var(--ink); background: var(--canvas); font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.app-shell { max-width: 1440px; margin: 0 auto; padding: 46px 54px 60px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 33px; }
h1 { margin: 0; color: var(--navy); font-size: clamp(16px, 2vw, 22px); line-height: 1.2; letter-spacing: -.04em; }
.source-link { display: inline-flex; align-items: center; gap: 9px; padding: 12px 17px; border: 1px solid #dfe4ed; border-radius: 10px; color: #45516a; background: rgba(255,255,255,.65); font-size: 13px; font-weight: 600; text-decoration: none; transition: .2s ease; }
.source-link:hover { border-color: #b9c5ff; color: var(--blue); background: var(--surface); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 25px; }
.summary-card { position: relative; min-height: 142px; padding: 22px 23px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 18px rgba(31,45,74,.035); }
.summary-card::after { position: absolute; right: -28px; bottom: -53px; width: 118px; height: 118px; border: 17px solid #f5f6fb; border-radius: 50%; content: ""; }
.summary-card-primary { border-color: #dfe4ff; background: linear-gradient(135deg, #f7f8ff, #fff); }
.summary-card-primary::after { border-color: #e8ebff; }
.summary-label { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.summary-card strong { display: block; margin: 8px 0 1px; color: var(--navy); font-size: 32px; line-height: 1.1; letter-spacing: -.04em; }
.summary-caption { color: #a0a8b9; font-size: 12px; }
.leaderboard-panel { margin-bottom: 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 24px rgba(31,45,74,.04); }
.leaderboard-panel h2 { margin: 0; }
.leaderboard-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 24px 26px; border: 0; color: var(--navy); background: transparent; font-size: 20px; font-weight: 700; text-align: left; }
.leaderboard-toggle:hover { color: var(--blue); }
.leaderboard-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: -4px; border-radius: 16px; }
.leaderboard-chevron { flex: none; width: 9px; height: 9px; margin-right: 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.leaderboard-toggle[aria-expanded="true"] .leaderboard-chevron { transform: rotate(225deg); }
.leaderboard-content { padding: 0 26px 28px; }
.leaderboard-list { display: grid; gap: 30px; max-width: 840px; margin: 0; padding: 0; list-style: none; }
.leaderboard-track { position: relative; width: 100%; height: 32px; }
.leaderboard-track:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.leaderboard-fill { position: absolute; top: 7px; left: 0; width: var(--score-percent); height: 18px; border-radius: 999px; background: #5e7cff; }
.leaderboard-item:nth-child(2) .leaderboard-fill { background: #8198f6; }
.leaderboard-item:nth-child(n+3) .leaderboard-fill { background: #a1b0eb; }
.leaderboard-surnames { position: absolute; top: 0; left: clamp(0px, calc(var(--score-percent) - var(--name-half)), calc(100% - var(--name-width))); display: flex; align-items: center; justify-content: center; width: var(--name-width); height: 32px; border: 2px solid #d1d9f6; border-radius: 999px; color: var(--navy); background: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 6px rgba(31,45,74,.08); }
.leaderboard-tooltip { position: absolute; top: calc(100% + 5px); left: 50%; z-index: 1; padding: 5px 9px; border-radius: 6px; color: #fff; background: var(--navy); font-size: 12px; font-weight: 500; white-space: nowrap; box-shadow: 0 4px 12px rgba(16,26,51,.18); opacity: 0; visibility: hidden; transform: translateX(-50%); pointer-events: none; }
.leaderboard-track:hover .leaderboard-tooltip, .leaderboard-track:focus-visible .leaderboard-tooltip { opacity: 1; visibility: visible; }
.leaderboard-empty { color: var(--muted); font-size: 13px; }
.workspace-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 24px rgba(31,45,74,.04); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px 21px; border-bottom: 1px solid var(--line); }
.toolbar-heading { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
h2 { margin: 0; color: var(--navy); font-size: 20px; letter-spacing: -.03em; }
.result-count { color: #9aa3b4; font-size: 12px; font-weight: 500; }
.toolbar-controls { display: flex; align-items: center; justify-content: flex-end; gap: 9px; width: 100%; }
.search-box { position: relative; display: block; width: min(250px, 25vw); }
.search-box svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; fill: none; stroke: #9ca6b7; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transform: translateY(-50%); pointer-events: none; }
.search-box input, select { height: 38px; border: 1px solid #e2e6ee; border-radius: 8px; color: #515d74; outline: none; background: #fbfcfe; font-size: 12px; transition: .2s ease; }
.search-box input { width: 100%; padding: 0 12px 0 35px; }
select { min-width: 112px; padding: 0 29px 0 11px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9aa4b4 50%), linear-gradient(135deg, #9aa4b4 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 11px) 16px; background-repeat: no-repeat; background-size: 4px 4px, 4px 4px; }
.search-box input:focus, select:focus { border-color: #aebaff; box-shadow: 0 0 0 3px #f0f2ff; background: #fff; }
.refresh-button { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border: 1px solid #dfe4ff; border-radius: 8px; color: var(--blue); background: #f5f6ff; font-size: 12px; font-weight: 700; transition: .2s ease; }
.refresh-button:hover { background: #ebeeff; }
.refresh-button:disabled { opacity: .65; cursor: wait; }
.refresh-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.refresh-button.is-loading svg { animation: spin .9s linear infinite; }
.status-message { margin: 18px 26px 0; padding: 11px 14px; border: 1px solid #ffd9d9; border-radius: 8px; color: #a44848; background: #fff6f6; font-size: 13px; }
.table-section + .table-section { border-top: 1px solid var(--line); }
.table-section-heading { display: flex; align-items: baseline; gap: 10px; padding: 20px 26px 12px; }
.table-section-title { margin: 0; color: var(--navy); font-size: 15px; font-weight: 700; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.table-section table { min-width: 1280px; }
th { height: 47px; padding: 0 18px; border-bottom: 1px solid var(--line); color: #9aa3b3; background: #fbfcfe; font-size: 12px; font-weight: 600; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 26px; }
.sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: 600; white-space: nowrap; }
.sort-button:hover, .sort-button:focus-visible { color: var(--blue); outline: none; }
.sort-indicator { width: 0; height: 0; border-right: 4px solid transparent; border-left: 4px solid transparent; opacity: .35; }
.sort-button.is-active .sort-indicator { opacity: 1; }
.sort-button.is-active .sort-indicator[data-direction="asc"] { border-bottom: 5px solid currentColor; }
.sort-button.is-active .sort-indicator[data-direction="desc"] { border-top: 5px solid currentColor; }
td { height: 70px; padding: 12px 18px; border-bottom: 1px solid #f0f2f6; color: #69748b; font-size: 13px; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fafbff; }
.status-column { width: 112px; } .service-count-column, .computer-count-column { width: 88px; } .colleague-column { width: 90px; } .title-column { width: 30%; } .assignee-column { width: 150px; } .date-column { width: 130px; }
.title-cell { color: #28344d; font-weight: 600; } .department-cell { color: #5d6980; }
.service-count-cell, .computer-count-cell { color: #5d6980; font-variant-numeric: tabular-nums; text-align: center; }
.date-cell { color: #7f899c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.assignee-list { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.assignee-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid #cfd7f3; border-radius: 50%; color: var(--blue); background: #f3f5ff; font-size: 13px; font-weight: 700; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-processing { color: var(--orange); background: #fff3e9; } .status-open { color: var(--blue); background: #eef1ff; }
.status-closed { color: var(--green); background: #eaf8f1; } .status-other { color: var(--purple); background: #f2edff; }
.category-tag { display: inline-block; padding: 4px 9px; border: 1px solid #eceef3; border-radius: 5px; color: #788398; background: #fafbfc; font-size: 11px; }
.loading-state, .empty-state { padding: 70px 20px; color: #9aa3b4; text-align: center; font-size: 13px; }
.empty-state { color: #79849a; } .empty-state h3 { margin: 12px 0 5px; color: #536078; font-size: 15px; } .empty-state p { margin: 0; font-size: 12px; }
.empty-icon { margin: 0 auto; width: 42px; height: 42px; border-radius: 50%; color: var(--blue); background: #f0f2ff; font-size: 26px; line-height: 39px; }
.spinner { display: inline-block; width: 15px; height: 15px; margin-right: 7px; border: 2px solid #e4e8f5; border-top-color: var(--blue); border-radius: 50%; vertical-align: -3px; animation: spin .8s linear infinite; }
.panel-footer { display: flex; justify-content: space-between; gap: 18px; padding: 17px 26px; color: #a0a8b8; font-size: 11px; }
.privacy-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); vertical-align: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; } @keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 920px) {
  .app-shell { padding: 32px 24px 45px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-controls { justify-content: flex-start; flex-wrap: wrap; }
  .search-box { width: min(100%, 280px); }
}
@media (max-width: 760px) {
  .app-shell { padding: 28px 20px 42px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .summary-card { min-height: 118px; padding: 18px; }
  .summary-card strong { font-size: 30px; }
  .table-section-heading { padding-right: 18px; padding-left: 18px; }
}
@media (max-width: 620px) {
  .app-shell { padding: 25px 14px 35px; }
  .hero { align-items: flex-start; flex-direction: column; margin-bottom: 25px; }
  .toolbar, .panel-footer { padding-right: 17px; padding-left: 17px; }
  .leaderboard-toggle { padding: 20px 17px; font-size: 17px; }
  .leaderboard-content { padding: 0 17px 24px; }
  .toolbar-controls { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .search-box { grid-column: 1 / -1; width: 100%; }
  .select-wrap, select { width: 100%; }
  .refresh-button { justify-content: center; }
  th:first-child, td:first-child { padding-left: 17px; }
  th, td { padding-right: 14px; padding-left: 14px; }
  .title-column { min-width: 230px; }
  .assignee-column { min-width: 120px; }
  .panel-footer { align-items: flex-start; flex-direction: column; gap: 7px; }
}
@media (max-width: 560px) {
  .summary-grid { grid-template-columns: 1fr; gap: 10px; }
  .summary-card { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 16px; min-height: 88px; padding: 15px 17px; }
  .summary-card::after { right: -42px; bottom: -66px; transform: scale(.75); opacity: .55; }
  .summary-label { grid-column: 1; grid-row: 1; font-size: 12px; }
  .summary-caption { grid-column: 1; grid-row: 2; font-size: 11px; }
  .summary-card strong { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 30px; }
  .table-section-title { font-size: 14px; }
}
