:root {
  color-scheme: light;
  --green: #245c45;
  --green-dark: #174330;
  --sage: #eaf0e8;
  --ink: #1d2823;
  --muted: #64706a;
  --line: rgba(49, 90, 66, .10);
  --table-line: #c4d3c9;
  --table-group-line: #a9beb1;
  --paper: #fff;
  --background: #f5f7f5;
  --glass: rgba(255, 255, 255, .40);
  --glass-line: rgba(255, 255, 255, .85);
  --glass-shadow: 0 12px 32px rgba(38, 83, 59, .10), inset 0 1px 0 rgba(255, 255, 255, .9);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; padding: 28px 24px 112px; isolation: isolate; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(ellipse at 6% 12%, #e4ece580, transparent 50%), #f5f7f5; }
.workspace { max-width: 1640px; margin: auto; }
.workspace-layout { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 24px; align-items: start; }
.sidebar { position: sticky; top: 24px; align-self: start; max-height: calc(100dvh - 48px); padding: 20px 12px; overflow-y: auto; scrollbar-width: thin; border: 1px solid var(--glass-line); border-radius: 28px; background: var(--glass); box-shadow: var(--glass-shadow); backdrop-filter: blur(24px) saturate(145%); -webkit-backdrop-filter: blur(24px) saturate(145%); }
.sidebar-filters { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 10px; }
.sidebar-panel { min-width: 0; }
.age-panel { padding-left: 10px; border-left: 1px solid var(--line); }
.sidebar-title { margin: 0 10px 20px; font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--green-dark); }
.age-panel .sidebar-title { text-align: center; margin-left: 0; margin-right: 0; }
.mobile-domain-field { display: none; }
button, select { font: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: var(--green); }
button, select, summary { min-height: 44px; }
:focus-visible { outline: 3px solid #659c70; outline-offset: 4px; }
[hidden] { display: none !important; }
.page-shell { min-width: 0; background: rgba(255, 255, 255, .80); border: 1px solid var(--glass-line); border-radius: 28px; padding: 28px; box-shadow: 0 16px 48px #245c4510, inset 0 1px 0 #fff; }
.site-header { padding: 0 6px 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); text-align: center; }
.brand-logo { width: 92px; aspect-ratio: 1280 / 1400; overflow: hidden; margin: 0 auto 18px; }
.brand-logo img { display: block; width: 100%; height: auto; }
.site-header h1 { margin: 0; font-size: 30px; line-height: 1.25; letter-spacing: .02em; color: var(--green-dark); text-shadow: 0 1px 0 #ffffff90; }
.site-header p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.domain-nav { display: flex; flex-direction: column; gap: 8px; }
.domain-nav a { display: flex; align-items: center; min-height: 48px; text-decoration: none; color: #3e5b4c; font-size: 14px; padding: 10px 14px; border: 1px solid transparent; border-radius: 16px; transition: background .16s, box-shadow .16s; }
.domain-nav a[aria-current] { color: #fff; font-weight: 600; border-color: #ffffff60; background: linear-gradient(145deg, #316e55, #245c45); box-shadow: 0 4px 12px #245c451c, inset 0 1px 0 #ffffff28; }
.domain-nav a:not([aria-current]):hover { background: #ffffff80; color: var(--green-dark); }
.domain-section { padding-top: 0; padding-bottom: 40px; scroll-margin-top: 28px; }
.domain-section + .domain-section { padding-top: 32px; }
.domain-section + .domain-section { border-top: 1px solid var(--line); }
.domain-title { margin: 0 0 18px; font-size: 28px; line-height: 1.4; letter-spacing: .02em; }
.goal-overview { margin: 0 0 28px; }
.goal-overview summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border: 1px solid #ffffffb3; border-radius: 18px; background: linear-gradient(115deg, #e6f0e6b3, #d8ebdf80); box-shadow: inset 0 1px 0 #fff, 0 4px 12px #245c4505; cursor: pointer; font-size: 16px; font-weight: 600; list-style: none; }
.goal-overview summary::-webkit-details-marker { display: none; }
.goal-overview summary svg { width: 20px; height: 20px; transition: transform .16s; }
.goal-overview[open] summary svg { transform: rotate(180deg); }
.table-scroll { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid #fff; border-radius: 20px; background: #ffffff63; box-shadow: 0 4px 16px #245c4504; }
.goal-overview .table-scroll { margin-top: 12px; }
.summary-table, .detail-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.summary-table { min-width: 640px; }
th { font-weight: 600; }
.summary-table th, .detail-table th { background: #e4eee3b3; padding: 15px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); }
.summary-table td, .detail-table td { padding: 16px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td:last-child, th:last-child { border-right: 0; }
.summary-table .ability-cell { background: #edf4ed70; vertical-align: middle; width: 150px; font-weight: 600; }
.diagonal-header { min-width: 150px; }
.diagonal-header span { display: block; }
.diagonal-header .bottom-left { font-size: 12px; color: var(--muted); }
.summary-cell-item { display: block; margin-bottom: 10px; }
.summary-cell-item:last-child { margin-bottom: 0; }
.goal-link { color: var(--ink); text-decoration: none; border-radius: 3px; }
.goal-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.goal-code, .indicator-code { display: block; font-weight: 600; color: var(--green); font-size: 14px; font-variant-numeric: tabular-nums; }
.summary-table .goal-code { margin-bottom: 4px; }
.age-controls { display: flex; flex-direction: column; gap: 10px; }
.age-controls button { min-width: 0; width: 100%; min-height: 46px; border: 1px solid #ffffffc9; border-radius: 15px; padding: 8px 4px; font-size: 13px; font-weight: 500; background: #ffffff80; color: #3c5246; box-shadow: inset 0 1px 0 #fff; transition: background .16s, box-shadow .16s; }
.age-controls button[aria-pressed="true"] { background: linear-gradient(145deg, #316e55, #245c45); color: #fff; border-color: #ffffff60; box-shadow: 0 4px 12px #245c451c, inset 0 1px 0 #ffffff28; }
.age-controls button:hover { border-color: #88ad94; }
.detail-table { table-layout: fixed; min-width: 720px; }
.detail-table th, .detail-table td { border-right-color: var(--table-line); border-bottom-color: var(--table-line); }
.detail-table th { background: #dfeae1; }
.detail-table .goal-group-first:not(:first-child) > td { border-top: 3px solid var(--table-group-line); }
.detail-table.filtered { min-width: 0; }
.detail-table th:first-child { width: 150px; }
.detail-table th:not(:first-child) { text-align: center; }
.detail-table .goal-col { vertical-align: middle; background: #edf3eea6; width: 150px; scroll-margin-top: 30px; }
.detail-table .goal-col .goal-code { color: var(--green-dark); font-size: 15px; margin-bottom: 6px; }
.detail-table .goal-desc { font-weight: 400; }
.detail-table .desc-col { padding: 16px; }
.indicator-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; margin-bottom: 4px; }
.indicator-code { white-space: nowrap; margin-bottom: 4px; }
.indicator-header .indicator-code { margin-bottom: 0; }
.indicator-desc { line-height: 1.75; }
.detail-table .empty-cell { background: #e6ede68c; padding: 16px; }
.detail-table .empty-cell-joined { border-bottom-color: transparent; }
.continuation { margin: 0; }
.continuation summary { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 6px; border-radius: 10px; color: #2c8b62; font-size: 0; list-style: none; cursor: pointer; }
.continuation summary::before { content: ""; flex: 1; height: 2px; background: currentColor; }
.continuation summary::after { content: ""; width: 0; height: 0; border-left: 9px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.continuation summary::-webkit-details-marker { display: none; }
.continuation summary:hover, .continuation[open] summary { background: var(--sage); }
.continuation .indicator-desc { margin-top: 6px; }
.copy-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #dce6de; background: #ffffffb3; color: var(--green); width: 38px; height: 38px; min-height: 38px; padding: 8px; border-radius: 12px; box-shadow: inset 0 1px 0 #fff, 0 2px 6px #245c4505; }
.detail-table .copy-button { flex-shrink: 0; width: 32px; height: 32px; min-height: 32px; padding: 6px; border-radius: 10px; }
.copy-button svg { width: 18px; height: 18px; }
.copy-button:hover { background: var(--sage); border-color: #8caa92; }
.copy-button.copied { background: var(--green); color: white; }
@media (hover: hover) and (pointer: fine) {
  .detail-table .copy-button { opacity: 0; pointer-events: none; transition: opacity .15s; }
  .detail-table .desc-col:hover .copy-button,
  .detail-table .desc-col:focus-within .copy-button { opacity: 1; pointer-events: auto; }
}
.mobile-indicators { display: none; }
.mobile-age-field { display: none; }
.floating-toolbar { position: fixed; z-index: 40; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); border: 1px solid #ffffff85; border-radius: 999px; padding: 8px 12px; background: rgba(25, 80, 55, .80); color: white; box-shadow: 0 8px 28px #17433026, inset 0 1px 0 #ffffff50; backdrop-filter: blur(24px) saturate(155%); -webkit-backdrop-filter: blur(24px) saturate(155%); }
.clipboard-btn { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 148px; border: 0; border-radius: 999px; padding: 4px 18px; background: transparent; color: white; font-weight: 500; font-size: 14px; white-space: nowrap; }
.clipboard-btn svg { width: 22px; height: 22px; }
.badge { font-size: 14px; font-variant-numeric: tabular-nums; }
.nav-select { width: 100%; min-width: 0; color: var(--green-dark); background: #ffffffb3; border: 1px solid #fff; border-radius: 14px; padding: 8px 28px 8px 12px; font-size: 14px; box-shadow: inset 0 1px 0 #fff; }
body.in-iframe .floating-toolbar { bottom: calc(80px + env(safe-area-inset-bottom)); }
body.in-iframe { padding-bottom: 190px; }
.clipboard-modal, .confirm-modal { border: 1px solid #ffffffe6; border-radius: 28px; padding: 24px; max-width: calc(100vw - 32px); width: 560px; max-height: calc(100dvh - 64px); color: var(--ink); background: #f8fcf7e6; box-shadow: 0 24px 80px #17433030, inset 0 1px 0 #fff; backdrop-filter: blur(28px) saturate(140%); -webkit-backdrop-filter: blur(28px) saturate(140%); }
dialog::backdrop { background: #142b2252; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-header { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h2 { margin: 0; font-size: 22px; }
.modal-close { width: 44px; height: 44px; border: 1px solid #fff; background: #ffffffb3; border-radius: 14px; color: var(--muted); display: grid; place-items: center; }
.modal-close svg { width: 20px; height: 20px; }
.clipboard-list { max-height: 55dvh; overflow: auto; margin: 0 0 20px; padding: 0; list-style: none; }
.clipboard-item { width: 100%; display: block; border: 0; border-bottom: 1px solid var(--line); padding: 16px 0; background: transparent; color: var(--ink); text-align: left; font-size: 14px; white-space: pre-line; line-height: 1.8; }
.clipboard-item:hover { background: #f6f8f4; }
.clipboard-empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.clipboard-actions { display: flex; gap: 10px; }
.clipboard-action-btn { flex: 1; border: 1px solid #ffffff80; border-radius: 14px; padding: 10px 16px; font-size: 14px; font-weight: 600; box-shadow: inset 0 1px 0 #ffffff30; }
.copy-all-btn { background: var(--green); color: white; }
.clear-btn { background: #eef1eb; color: var(--ink); }
.confirm-modal { width: 360px; }
.confirm-modal h2 { margin: 0; font-size: 20px; }
.confirm-modal p { color: var(--muted); font-size: 14px; margin: 12px 0 24px; }
.toast { position: fixed; z-index: 100; top: calc(16px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content; background: #174330eb; color: #fff; padding: 12px 20px; border: 1px solid #ffffff70; border-radius: 18px; box-shadow: 0 6px 20px #17433020; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 14px; pointer-events: none; }
.status-message { text-align: center; padding: 60px 20px; color: var(--muted); }
.status-error { color: #a43a32; }
.retry-button { display: block; margin: 16px auto 0; background: var(--green); color: #fff; border: 0; padding: 10px 24px; border-radius: 8px; }
.highlight-goal { outline: 3px solid #9abb89; outline-offset: -3px; }
.skip-link { position: absolute; top: -100px; left: 24px; background: var(--paper); padding: 10px 16px; z-index: 101; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.site-footer { margin: 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
@media (max-width: 1180px) {
  .workspace-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
  .sidebar { padding: 16px 10px; }
  .sidebar-filters { display: flex; flex-direction: column; gap: 20px; }
  .sidebar-panel { width: 100%; }
  .age-panel { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .site-header h1 { font-size: 26px; }
  .site-header p { font-size: 11px; }
  .sidebar-title { margin-bottom: 12px; }
  .age-controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .age-controls button:first-child { grid-column: 1 / -1; }
  .domain-nav { gap: 4px; }
  .domain-nav a { min-height: 44px; font-size: 13px; padding: 8px 12px; }
  .page-shell { padding: 24px; }
}
@media (max-width: 860px) {
  body { padding: 18px 16px 104px; }
  .site-header { display: flex; align-items: center; gap: 12px; padding: 0 0 12px; margin: 0 0 12px; text-align: left; }
  .brand-logo { flex: 0 0 44px; width: 44px; margin: 0; }
  .site-header h1 { font-size: 23px; }
  .site-header p { font-size: 11px; margin-top: 3px; }
  .workspace-layout { display: block; }
  .sidebar { top: calc(8px + env(safe-area-inset-top)); z-index: 30; padding: 12px; margin-bottom: 16px; border-radius: 24px; background: #f5f8f4e6; overflow: visible; }
  .sidebar-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .age-panel { padding: 0; }
  .sidebar-panel { padding: 0; border: 0; border-radius: 0; min-height: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .domain-panel { display: block; }
  .sidebar-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .domain-nav { display: none; }
  .mobile-domain-field, .mobile-age-field { display: block; min-width: 0; }
  .age-controls { display: none; }
  .sidebar-filters .nav-select { min-height: 44px; padding-left: 10px; padding-right: 22px; font-size: 13px; }
  .page-shell { padding: 20px 16px; border-radius: 26px; background: #ffffffbf; }
  .domain-section { padding-top: 0; padding-bottom: 28px; scroll-margin-top: calc(170px + env(safe-area-inset-top)); }
  .domain-section + .domain-section { padding-top: 28px; }
  .domain-title { font-size: 23px; margin-bottom: 16px; }
  .goal-overview { margin-bottom: 24px; }
  .goal-overview summary { padding: 12px 14px; font-size: 14px; border-radius: 15px; }
  .desktop-indicators { display: none; }
  .mobile-indicators { display: block; }
  .mobile-goal { border: 1px solid var(--table-line); background: #ffffffa6; border-radius: 20px; margin-bottom: 18px; overflow: clip; box-shadow: 0 4px 14px #245c4504, inset 0 1px 0 #fff; scroll-margin-top: calc(170px + env(safe-area-inset-top)); }
  .mobile-goal h4 { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--table-line); background: #e4eee5b3; font-size: 14px; line-height: 1.7; font-weight: 600; }
  .mobile-goal h4 .goal-code { display: inline; margin-right: 10px; color: var(--ink); font-size: 14px; }
  .mobile-age-title { margin: 0; padding: 12px 16px 0; border-top: 1px solid var(--table-line); color: var(--muted); font-size: 12px; font-weight: 500; }
  .mobile-goal h4 + .mobile-age-title { border-top: 0; }
  .mobile-indicator { margin: 0 16px; padding: 16px 0; border-bottom: 1px solid var(--table-line); font-size: 13px; }
  .mobile-indicator:last-child { border-bottom: 0; }
  .mobile-indicator .copy-button { flex-shrink: 0; width: 44px; height: 44px; }
  .mobile-indicator .indicator-code { font-size: 13px; }
  .mobile-empty { margin: 0; padding: 18px 16px; color: var(--muted); font-size: 13px; }
  .floating-toolbar { bottom: calc(12px + env(safe-area-inset-bottom)); padding: 6px 10px; }
  .clipboard-btn { min-width: 132px; font-size: 13px; }
  .clipboard-modal { padding: 20px; }
  .site-footer { font-size: 12px; }
}
@media (max-width: 360px) {
  body { padding: 14px 10px 104px; }
  .page-shell { padding: 18px 12px; }
  .sidebar { padding: 10px; }
  .domain-panel { gap: 8px; }
  .nav-select { padding-left: 8px; font-size: 13px; }
  .domain-title { font-size: 21px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar-panel, .sidebar, .clipboard-modal, .confirm-modal { background-color: #edf5ed; }
  .floating-toolbar { background-color: var(--green); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  body { padding: 0; background: white; }
  .page-shell { padding: 0; border: 0; }
  body::before, .sidebar, .floating-toolbar, .age-controls, .copy-button, .domain-nav { display: none; }
  .workspace-layout { display: block; }
  .page-shell { box-shadow: none; }
  .desktop-indicators { display: block; }
  .mobile-indicators { display: none; }
  .detail-table { min-width: 0; font-size: 10px; }
  .detail-table .desc-col { padding: 8px; }
  .table-scroll { overflow: visible; }
  .domain-section { break-before: page; }
  .domain-section:first-child { break-before: auto; }
}
