:root {
  --brand:#00547c;
  --ink:#1f3645;
  --muted:#687c8a;
  --line:#e2e9ee;
  --bg:#edf1f4;
  --orange:#b97a35;
  --radius:16px;
  font-family:Arial,"Noto Sans TC","Microsoft JhengHei",sans-serif;
  color:var(--ink);
  font-synthesis:none
}

* {
  box-sizing:border-box
}

html {
  scroll-behavior:smooth;
  scroll-padding-top:88px;
  background:var(--bg)
}

body {
  margin:0;
  min-width:280px;
  font-size:14px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased
}

button,input,select,textarea {
  font:inherit
}

button,a,input,select,textarea,summary {
  -webkit-tap-highlight-color:transparent
}

button,a {
  touch-action:manipulation
}

button {
  cursor:pointer
}

button:disabled {
  cursor:default;
  opacity:.42
}
[aria-disabled="true"] {
  pointer-events:none;
  opacity:.42
}

a {
  color:var(--brand);
  text-decoration:none
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline:3px solid #87bcd3;
  outline-offset:3px
}

[hidden] {
  display:none!important
}

h1,h2,h3,p {
  margin:0
}

h1 {
  font-size:30px;
  line-height:1.3;
  letter-spacing:-.045em
}

h2 {
  font-size:17px;
  font-weight:700;
  letter-spacing:-.025em
}

h3 {
  font-size:14px
}

.sr-only,.skip-link:not(:focus) {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap
}

.skip-link:focus {
  position:fixed;
  z-index:100;
  background:#fff;
  padding:12px
}

.topbar {
  position:sticky;
  top:0;
  z-index:30;
  background:#233e50;
  color:white;
  border-bottom:1px solid #ffffff12
}

.topbar-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  max-width:1280px;
  height:66px;
  margin:auto;
  padding:0 28px
}

.brand {
  display:flex;
  align-items:center;
  gap:10px;
  color:white;
  flex-shrink:0
}

.brand-icon {
  position:relative;
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border-radius:10px;
  background:var(--brand);
  font-size:20px;
  font-weight:700
}

.brand-icon img {
  position:absolute;
  inset:0;
  width:36px;
  height:36px;
  object-fit:contain;
  border-radius:10px
}

.brand strong,.brand small {
  display:block;
  line-height:1.35
}

.brand strong {
  font-size:16px;
  letter-spacing:.06em
}

.brand small {
  color:#c2d1dc;
  font-size:10px;
  letter-spacing:.07em
}

.desktop-nav {
  display:flex;
  gap:28px;
  margin-right:auto;
  margin-left:36px
}

.desktop-nav a {
  color:#c5d2dc;
  font-size:13px;
  padding:20px 0
}

.desktop-nav a:hover {
  color:#fff
}

.refresh-button {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:38px;
  padding:0 13px;
  color:white;
  border:1px solid #ffffff32;
  background:#ffffff08;
  border-radius:8px;
  font-size:12px
}

.refresh-button svg {
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round
}

.refresh-button.is-loading svg {
  animation:spin 1s linear infinite
}

main {
  max-width:1280px;
  margin:auto;
  padding:30px 28px 24px
}

.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:22px
}

.page-heading p {
  margin-top:5px;
  color:var(--muted);
  font-size:13px
}

.page-heading .page-date {
  font-size:12px
}

.overview {
  display:grid;
  grid-template-columns:1.65fr 1fr 1fr;
  overflow:hidden;
  border:1px solid #d6e1e8;
  border-radius:var(--radius);
  background:white;
  margin-bottom:22px;
  box-shadow:0 4px 18px #233e5005
}

.overview-main {
  padding:24px 28px 22px
}

.overview-label {
  display:flex;
  align-items:center;
  gap:14px
}

.overview-label h2 {
  font-size:13px;
  color:#4e6777;
  font-weight:500
}

.level-badge {
  padding:2px 8px;
  border-radius:5px;
  background:#eef2f4;
  color:#687c8a;
  font-size:11px;
  font-weight:500
}

.level-badge--comfortable {
  background:#e7f2ed;
  color:#3b715b
}

.level-badge--lively {
  background:#fbf0d9;
  color:#8f6d27
}

.level-badge--busy {
  background:#f7e9e4;
  color:#9a573e
}

.current-number {
  display:flex;
  align-items:baseline;
  gap:9px;
  margin:7px 0 5px
}

.current-number strong {
  font-size:54px;
  line-height:1.12;
  letter-spacing:-.05em;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  color:var(--brand)
}

.current-number span {
  color:var(--muted);
  font-size:14px
}

.overview-main>p {
  color:#607787;
  font-size:12px
}

.overview-main>p b {
  color:var(--brand);
  font-weight:600
}

.overview-stat {
  align-self:center;
  display:flex;
  flex-direction:column;
  gap:3px;
  border-left:1px solid var(--line);
  padding:3px 30px
}

.overview-stat>span {
  font-size:12px;
  color:var(--muted)
}

.overview-stat strong {
  font-size:27px;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.035em;
  font-weight:600
}

.overview-stat small {
  color:#7c8f9a;
  font-size:11px
}

.overview-meta {
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:#f8fafb;
  border-top:1px solid var(--line);
  padding:9px 28px;
  font-size:11px;
  color:#738794
}

.dashboard {
  display:grid;
  grid-template-columns:minmax(0,1fr) 340px;
  align-items:start;
  gap:22px
}

.data-column,.side-column {
  display:grid;
  gap:22px;
  min-width:0
}

.panel {
  min-width:0;
  padding:23px;
  border-radius:var(--radius);
  background:white;
  border:1px solid #dfe7ec;
  box-shadow:0 2px 10px #233e5003;
  scroll-margin-top:88px
}

.panel-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px
}

.panel-heading p {
  color:var(--muted);
  font-size:12px;
  margin-top:3px
}

.unit-label,.peak-legend {
  font-size:11px;
  color:#80909b;
  white-space:nowrap
}

.peak-legend {
  display:flex;
  align-items:center;
  gap:5px
}

.peak-legend i {
  display:block;
  width:6px;
  height:6px;
  border-radius:100%;
  background:var(--orange)
}

.date-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin:17px 0 16px
}

.date-controls {
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0
}

.date-controls input {
  width:145px;
  min-width:0;
  height:38px;
  padding:5px 9px;
  background:white;
  border:1px solid #d4dfe5;
  border-radius:7px;
  color:var(--ink);
  font-size:12px
}

.date-controls input[type=month] {
  width:141px
}

.icon-button,.quiet-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:6px 12px;
  color:var(--brand);
  border:1px solid #d4dfe5;
  border-radius:7px;
  background:white;
  font-size:12px;
  font-weight:600
}

.icon-button {
  padding:0;
  width:32px;
  flex-shrink:0;
  font-size:20px;
  font-weight:400
}

.icon-button:hover:not(:disabled),.quiet-button:hover:not(:disabled) {
  background:#f1f6f8;
  border-color:#a3bbc9
}

.icon-button:disabled {
  background:#f1f4f6
}

.text-button {
  padding:5px 0;
  min-height:32px;
  background:none;
  border:0;
  color:var(--brand);
  font-size:12px;
  font-weight:500
}

.text-button:hover:not(:disabled) {
  text-decoration:underline
}

.toolbar-note {
  font-size:11px;
  color:#81939e
}

.daily-stats {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  background:#f6f8fa;
  border-radius:9px;
  padding:11px 0;
  margin-bottom:10px
}

.daily-stats>div {
  padding:0 15px;
  display:flex;
  flex-direction:column;
  gap:1px;
  border-right:1px solid #e2e9ee
}

.daily-stats>div:last-child {
  border:0
}

.daily-stats span {
  font-size:11px;
  color:#7a8d9b
}

.daily-stats strong {
  font-size:16px;
  font-weight:600;
  white-space:nowrap;
  font-variant-numeric:tabular-nums
}

.daily-stats small {
  font-size:10px;
  font-weight:400;
  color:#83939d;
  margin-left:5px
}

.chart-wrap {
  position:relative;
  height:230px;
  min-width:0
}

.monthly-panel .chart-wrap {
  height:245px
}

.chart-wrap svg {
  display:block;
  width:100%;
  height:100%;
  overflow:visible
}

.grid-line {
  stroke:#e8edf1;
  stroke-width:1
}

.axis-label {
  fill:#8495a1;
  font-family:Arial,"Microsoft JhengHei",sans-serif;
  font-size:11px
}

.chart-line {
  fill:none;
  stroke:var(--brand);
  stroke-width:2.3;
  stroke-linecap:round;
  stroke-linejoin:round
}

.chart-point {
  fill:white;
  stroke:var(--brand);
  stroke-width:1.8
}

.chart-point.is-peak {
  fill:#c69150;
  stroke:#a46d2c;
  stroke-width:2
}

.chart-hit {
  fill:transparent;
  cursor:pointer
}

.chart-hit:focus-visible {
  outline:none;
  stroke:#7ba5bc;
  stroke-width:2
}

.today-tag {
  fill:#987039;
  font-size:10px
}

.chart-tooltip {
  position:absolute;
  z-index:5;
  max-width:210px;
  padding:9px 12px;
  border-radius:8px;
  color:white;
  background:#233e50;
  font-size:11px;
  line-height:1.6;
  white-space:pre-line;
  pointer-events:none;
  box-shadow:0 4px 16px #142f4326
}

.chart-state {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:15px;
  color:#83939f;
  font-size:12px;
  background:#fff
}

.loading-bar {
  width:72%;
  height:80px;
  background:linear-gradient(90deg,#f2f5f7,#fafcfd,#f2f5f7);
  border-radius:5px;
  animation:pulse 1.5s infinite alternate
}

.chart-foot {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:32px;
  margin-top:1px
}

.chart-foot p {
  font-size:11px;
  color:#7a8e9b
}

.hourly-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:15px;
  padding-top:13px;
  border-top:1px solid var(--line)
}

.hourly-list {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:24px;
  margin-top:5px
}

.hour-row {
  display:grid;
  grid-template-columns:38px 1fr auto;
  align-items:center;
  gap:12px;
  min-height:35px;
  border-bottom:1px solid #eff3f5;
  font-size:12px
}

.hour-time {
  color:#6b8191;
  font-variant-numeric:tabular-nums
}

.mini-track {
  height:3px;
  background:#edf2f5;
  border-radius:3px;
  overflow:hidden
}

.mini-track i {
  display:block;
  height:100%;
  background:#7f9baa;
  border-radius:inherit
}

.hour-count {
  font-weight:600;
  text-align:right;
  font-variant-numeric:tabular-nums
}

.hour-count small {
  color:#8496a3;
  font-weight:400;
  font-size:10px
}

.hour-row.is-missing {
  color:#8999a4
}

.share-panel {
  padding:22px;
  border-top:3px solid var(--brand)
}

.share-symbol {
  font-size:24px;
  font-weight:400;
  color:#8ca8b8
}

.post-source {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:16px;
  border-top:1px solid var(--line);
  padding-top:10px;
  font-size:12px;
  color:#537186
}

.post-context {
  display:grid;
  gap:6px;
  margin:8px 0 12px;
  color:var(--muted);
  font-size:11px;
}

.post-context input {
  width:100%;
  min-width:0;
  min-height:38px;
  padding:7px 9px;
  border:1px solid #d7e2e9;
  border-radius:6px;
  color:var(--ink);
  background:white;
  font-size:13px;
}

.post-options {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:6px 0 12px;
  font-size:11px;
  color:var(--muted)
}

.post-options select {
  min-height:34px;
  padding:4px 6px;
  max-width:190px;
  border:1px solid #d7e2e9;
  border-radius:6px;
  color:#435e70;
  background:white;
  font-size:11px
}

textarea {
  display:block;
  width:100%;
  min-height:230px;
  resize:vertical;
  padding:13px;
  border:1px solid #d5e0e7;
  border-radius:8px;
  color:#3a5566;
  font-size:12px;
  line-height:1.85;
  background:#fcfdfe
}

textarea:disabled {
  background:#f7f9fa
}

.post-caption {
  display:flex;
  justify-content:space-between;
  gap:8px;
  color:#84939d;
  font-size:10px;
  margin:7px 0 12px
}

.primary-button {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  min-height:42px;
  padding:9px 16px;
  border:1px solid var(--brand);
  border-radius:8px;
  background:var(--brand);
  color:white;
  font-size:13px;
  font-weight:600
}

.primary-button:hover:not(:disabled) {
  background:#004667
}

.copy-button {
  width:100%
}

.share-actions {
  display:grid;
  grid-template-columns:1.15fr 1fr;
  gap:8px;
  margin-top:8px
}

.share-actions button,.share-actions a {
  font-size:11px
}

.image-preview {
  margin-top:15px;
  border-top:1px solid var(--line)
}

.image-preview summary {
  padding:11px 0;
  cursor:pointer;
  font-size:11px;
  color:#557082
}

.image-preview summary span {
  float:right;
  color:#91a0aa;
  font-size:10px
}

.image-preview canvas {
  display:block;
  width:100%;
  height:auto;
  border:1px solid var(--line);
  border-radius:5px
}

.image-preview p,.share-note {
  margin:5px 0 0;
  font-size:10px;
  color:#91a0aa
}

.share-note {
  margin-top:1px
}

.ranking-list {
  list-style:none;
  padding:0;
  margin:14px 0 0;
  counter-reset:ranking
}

.ranking-row {
  counter-increment:ranking
}

.rank-button {
  display:grid;
  grid-template-columns:23px 1fr auto;
  gap:8px;
  align-items:center;
  width:100%;
  min-height:58px;
  padding:8px 0;
  background:none;
  border:0;
  border-top:1px solid var(--line);
  text-align:left;
  color:var(--ink)
}

.rank-button:hover {
  background:#f6f9fa
}

.rank-number::before {
  content:counter(ranking,decimal-leading-zero);
  font-size:11px;
  font-weight:600;
  color:#8ea0aa
}

.ranking-row:first-child .rank-number::before {
  color:var(--brand)
}

.rank-date {
  font-size:12px;
  font-weight:500
}

.rank-date small {
  display:block;
  font-size:10px;
  color:#8b9ca6;
  font-weight:400
}

.rank-button>strong {
  font-size:14px;
  font-weight:600;
  letter-spacing:-.02em
}

.rank-button>strong small {
  font-size:10px;
  font-weight:400;
  color:#8a9ba7
}

.ranking-status {
  font-size:11px;
  color:#8696a0;
  margin-top:9px
}

.source-footer {
  display:flex;
  justify-content:space-between;
  gap:35px;
  margin-top:26px;
  padding:0 3px;
  font-size:11px;
  color:#7c8e9b
}

.source-footer>div:first-child {
  max-width:660px
}

.source-footer strong {
  font-size:11px;
  font-weight:600;
  color:#627b8c
}

.source-footer p {
  margin-top:3px
}

.source-footer>div:last-child {
  text-align:right;
  flex-shrink:0
}

.source-footer a {
  color:#627b8c
}

.mobile-actions {
  display:none
}

.toast {
  position:fixed;
  z-index:100;
  left:50%;
  bottom:24px;
  transform:translate(-50%,12px);
  max-width:calc(100% - 32px);
  width:max-content;
  background:#213b4e;
  color:white;
  padding:11px 18px;
  border-radius:9px;
  font-size:12px;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s,transform .2s;
  box-shadow:0 5px 18px #122e4526
}

.toast.show {
  opacity:1;
  transform:translate(-50%,0)
}

@keyframes spin {
  to {
    transform:rotate(360deg)
  }
}

@keyframes pulse {
  to {
    opacity:.4
  }
}

@media(min-width:1400px) {
  .chart-wrap {
    height:240px
  }
  .monthly-panel .chart-wrap {
    height:255px
  }
}

@media(max-width:1050px) {
  main {
    padding-inline:20px
  }
  .topbar-inner {
    padding-inline:20px
  }
  .dashboard {
    grid-template-columns:minmax(0,1fr) 300px;
    gap:18px
  }
  .panel {
    padding:18px
  }
  .data-column,.side-column {
    gap:18px
  }
  .daily-stats>div {
    padding:0 10px
  }
  .daily-stats small {
    display:block;
    margin:0
  }
  .hourly-list {
    column-gap:16px
  }
  .hour-row {
    gap:7px
  }
  .overview-stat {
    padding-inline:24px
  }
}

@media(max-width:800px) {
  .dashboard {
    grid-template-columns:1fr
  }
  .side-column {
    grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);
    align-items:start
  }
  .desktop-nav {
    margin-left:10px;
    gap:18px
  }
  .daily-stats small {
    display:inline;
    margin-left:5px
  }
  .overview-main {
    padding:22px
  }
  .overview-stat {
    padding-inline:20px
  }
  .current-number strong {
    font-size:48px
  }
  .overview-stat strong {
    font-size:25px
  }
  .source-footer {
    flex-direction:column;
    gap:12px
  }
  .source-footer>div:last-child {
    text-align:left
  }
}

@media(max-width:600px) {
  html {
    scroll-padding-top:78px
  }
  body {
    font-size:14px
  }
  .topbar-inner {
    height:60px;
    padding:0 16px;
    gap:10px
  }
  .brand-icon,.brand-icon img {
    width:33px;
    height:33px
  }
  .brand strong {
    font-size:15px
  }
  .desktop-nav {
    display:none
  }
  .refresh-button {
    min-height:38px
  }
  main {
    padding:23px 14px calc(100px + env(safe-area-inset-bottom))
  }
  h1 {
    font-size:27px
  }
  h2 {
    font-size:16px
  }
  .page-heading {
    margin-bottom:18px;
    align-items:flex-start;
    flex-direction:column;
    gap:2px
  }
  .page-heading .page-date {
    font-size:11px;
    margin-top:2px
  }
  .page-heading>div>p {
    display:none
  }
  .overview {
    grid-template-columns:1fr 1fr;
    margin-bottom:16px;
    border-radius:13px
  }
  .overview-main {
    grid-column:1/-1;
    padding:20px 20px 15px
  }
  .current-number strong {
    font-size:52px
  }
  .overview-stat {
    padding:0 20px;
    margin:0 0 18px
  }
  .overview-stat:nth-child(2) {
    border:0
  }
  .overview-stat strong {
    font-size:22px
  }
  .overview-meta {
    padding:9px 20px;
    flex-wrap:wrap;
    gap:1px 15px;
    font-size:10px
  }
  .overview-meta>span {
    display:block
  }
  .dashboard,.data-column,.side-column {
    gap:16px
  }
  .panel {
    padding:18px 15px;
    border-radius:13px;
    scroll-margin-top:76px
  }
  .panel-heading {
    gap:6px
  }
  .panel-heading p {
    font-size:11px
  }
  .date-toolbar {
    margin:14px 0;
    gap:3px
  }
  .date-controls {
    gap:6px;
    width:100%
  }
  .date-controls input,.date-controls input[type=month] {
    flex:1;
    width:100%;
    height:44px;
    font-size:14px;
    padding:6px
  }
  .icon-button {
    width:40px;
    min-height:44px
  }
  .quiet-button {
    min-height:44px
  }
  .date-toolbar>.text-button,.date-toolbar>.toolbar-note {
    margin-top:5px;
    font-size:11px
  }
  .daily-stats {
    margin-top:0;
    padding:10px 0
  }
  .daily-stats>div {
    padding:0 9px
  }
  .daily-stats strong {
    font-size:15px
  }
  .daily-stats small {
    display:block;
    margin:1px 0 0
  }
  .chart-wrap {
    height:208px
  }
  .monthly-panel .chart-wrap {
    height:220px
  }
  .chart-foot {
    align-items:flex-start
  }
  .chart-foot p {
    padding-top:6px;
    max-width:80%
  }
  .chart-foot .text-button {
    flex-shrink:0
  }
  .hourly-list {
    grid-template-columns:1fr
  }
  .hour-row {
    min-height:39px;
    grid-template-columns:42px 1fr auto;
    gap:14px
  }
  .hourly-heading {
    margin-top:10px
  }
  .side-column {
    display:flex;
    flex-direction:column
  }
  .side-column>* {
    width:100%
  }
  .ranking-panel {
    order:-1
  }
  .share-panel {
    padding:20px
  }
  .post-options select {
    min-height:40px;
    font-size:12px
  }
  .post-context input {
    min-height:44px;
    font-size:16px;
  }
  textarea {
    font-size:16px;
    min-height:270px;
    line-height:1.8
  }
  .share-actions button,.share-actions a {
    font-size:12px
  }
  .primary-button {
    min-height:46px
  }
  .post-caption,.share-note,.image-preview p {
    font-size:11px
  }
  .source-footer {
    font-size:11px;
    margin-top:22px
  }
  .mobile-actions {
    position:fixed;
    z-index:25;
    inset:auto 0 0;
    display:grid;
    grid-template-columns:1fr 1.3fr;
    align-items:center;
    gap:14px;
    padding:10px 18px calc(10px + env(safe-area-inset-bottom));
    background:#fffffffa;
    border-top:1px solid #d9e3e9;
    box-shadow:0 -4px 20px #203e4d06
  }
  .mobile-actions a {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:44px;
    font-size:13px
  }
  .mobile-actions button {
    font-size:12px;
    min-height:42px
  }
  .toast {
    bottom:calc(83px + env(safe-area-inset-bottom))
  }
}

@media(max-width:350px) {
  main {
    padding-inline:10px
  }
  .panel {
    padding-inline:12px
  }
  .date-controls {
    gap:4px
  }
  .icon-button {
    width:34px
  }
  .date-controls .quiet-button {
    padding-inline:9px
  }
  .daily-stats strong {
    font-size:14px
  }
  .overview-meta {
    padding-inline:15px
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior:auto!important;
    animation:none!important;
    transition:none!important
  }
}
