/* Shared interface for the report and server-rendered pages. */
:root {
  color-scheme: dark;
  --page: #0a0a0a;
  --surface: #18181b;
  --chip: #27272a;
  --chip-on: #c2410c;
  --ink: #ededed;
  --ink-2: #d4d4d8;
  --muted: #a1a1aa;
  --grid: #27272a;
  --axis: #3f3f46;
  --ring: #27272a;
  --series-1: #fb923c;
  --series-1-wash: #47280e;
  --up: #4ade80;
  --down: #fb7185;
  --accent: #fb923c;
  --other: #52525b;
  --hover-row: var(--page);
  --sel-row: #30271f;
  --tip-ink: #09090b;
  --table-head: #09090b;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--page);
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  color: var(--ink);
  font:
    15px / 1.65 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    "PingFang TC",
    sans-serif;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--axis);
  border-radius: 8px;
}
button,
select {
  min-height: 38px;
  padding: 7px 12px;
}
button {
  cursor: pointer;
}
button:hover {
  border-color: var(--accent);
}
button:disabled,
select:disabled {
  cursor: default;
  opacity: 0.5;
}
input,
textarea {
  padding: 9px 12px;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
textarea {
  width: 100%;
  max-width: 40rem;
  display: block;
  margin-top: 8px;
  resize: vertical;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none;
}
.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}
h1 {
  font-size: 34px;
  line-height: 1.35;
  letter-spacing: -0.035em;
  margin: 8px 0;
  font-weight: 700;
}
h2 {
  font-size: 20px;
  line-height: 1.4;
}
h3 {
  font-size: 16px;
}
.dek {
  color: var(--ink-2);
  margin: 6px 0 0;
  max-width: 48em;
  font-size: 14px;
}
.note {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 12px;
  max-width: 60em;
}
p.body {
  color: var(--ink-2);
  max-width: 52em;
}
.muted {
  color: var(--muted);
}
.up,
.delta.up {
  color: var(--up);
}
.down,
.delta.down {
  color: var(--down);
}
.delta {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 550;
}
.delta.na {
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  transform: translateY(-150%);
  padding: 8px 16px;
  background: var(--surface);
  z-index: 50;
  border-radius: 6px;
}
.skip-link:focus {
  transform: none;
}
/* Navigation: primary reading destinations, with utilities in a menu. */
.site {
  background: var(--page);
  border-bottom: 1px solid var(--grid);
}
.site-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 44px;
}
.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
  width: 26px;
  height: 26px;
  padding: 3px 0;
}
.brand-mark i {
  width: 6px;
  border-radius: 2px;
  background: var(--accent);
  height: 55%;
}
.brand-mark i:nth-child(2) {
  height: 100%;
}
.brand-mark i:nth-child(3) {
  height: 75%;
  opacity: 0.55;
}
.site-nav {
  display: flex;
  gap: 26px;
  align-self: stretch;
  align-items: stretch;
}
.site-nav a {
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  padding: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}
.site-nav a.on {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.site-tools {
  margin-left: auto;
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 13px;
}
.site-tools .who {
  color: var(--muted);
}
.site-tools .who:empty {
  display: none;
}
.site-tools .who a {
  color: var(--ink-2);
}
.site-tools .who small {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.site-tools form {
  display: inline;
}
/* Every page: a title with one line on what it is for and its actions on the
   right, then one row of filters. */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 24px;
  padding: 0 0 20px;
}
main.wrap {
  padding-top: 24px;
}
.page-head h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}
.page-head .dek {
  max-width: 60rem;
}
.page-head .sep {
  margin: 0 8px;
}
.method-link {
  white-space: nowrap;
}
.page-head .dek {
  margin: 4px 0 0;
  color: var(--muted);
}
.page-head .dek .tags {
  margin-left: 12px;
  vertical-align: 1px;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px;
  white-space: nowrap;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
}
.toolbar-form {
  display: contents;
}
.toolbar .search-field {
  flex: 1 1 260px;
}
.select-field {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding-left: 12px;
  border: 1px solid var(--axis);
  border-radius: 8px;
  background: var(--surface);
}
.select-field:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.select-field span {
  flex: none;
  font-size: 12px;
  color: var(--muted);
}
.select-field select {
  min-width: 0;
  max-width: 260px;
  min-height: 38px;
  padding: 7px 10px 7px 8px;
  border: 0;
  background: transparent;
}
.select-field select:focus-visible {
  outline: none;
}
.page-head + .block,
.toolbar + .block {
  padding-top: 0;
}
.results-line {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 13px;
}
.search-field {
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  min-width: 0;
  flex: 1;
  border: 1px solid var(--axis);
  border-radius: 8px;
  color: var(--muted);
}
.search-field:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.search-field svg {
  flex: none;
}
.search-field input {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 8px 0;
  background: transparent;
  border: 0;
  outline: none;
}
.search-field input::-webkit-search-cancel-button {
  display: none;
}
.search-field button {
  flex: none;
  border: 0;
  padding: 0;
  min-height: 32px;
  width: 30px;
  color: var(--muted);
}
.search-field button:hover {
  color: var(--accent);
}
button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--sel-row);
}
button.quiet {
  color: var(--ink-2);
  border-color: var(--grid);
  font-size: 12px;
  white-space: nowrap;
  min-height: 32px;
  padding: 4px 10px;
}
button.primary {
  color: var(--surface);
  background: var(--accent);
  border-color: var(--accent);
  padding-inline: 20px;
  font-weight: 600;
}
/* Compact shared tables. Keep the columns readable at every screen width. */
.table-frame {
  position: relative;
  isolation: isolate;
  max-width: 100%;
  border: 1px solid var(--grid);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.table-frame::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 40px;
  background: linear-gradient(to right, transparent, #09090b80);
  pointer-events: none;
  z-index: 6;
  opacity: 0;
}
.table-frame[data-scroll-x="start"]::after,
.table-frame[data-scroll-x="middle"]::after {
  opacity: 1;
}
.scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--axis) var(--surface);
  scrollbar-width: thin;
}
.scroll:focus-visible {
  outline-offset: -3px;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
  background: var(--surface);
}
tbody tr:last-child td {
  border-bottom: 0;
}
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  background: var(--table-head);
}
.table-head-follow {
  position: relative;
  z-index: 5;
  transform: translateY(var(--head-offset, 0px));
}
th button {
  padding: 0;
  font: inherit;
  color: inherit;
  min-height: 24px;
  background: transparent;
  border: 0;
  white-space: nowrap;
}
th button:hover {
  color: var(--ink);
}
th .arrow {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
}
th .arrow.active {
  color: var(--accent);
}
td.l,
th.l {
  text-align: left;
}
td.rank,
th.rank,
.table-rank {
  text-align: center;
  padding-inline: 4px;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  color: var(--muted);
}
.table-rank,
.table-lead {
  position: sticky;
  left: 0;
  z-index: 2;
}
.with-rank .table-lead {
  left: 40px;
}
.table-lead-box {
  display: block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scroll[data-scroll-x="middle"] .table-lead,
.scroll[data-scroll-x="end"] .table-lead {
  box-shadow: 6px 0 8px -6px #000000cc;
}
tbody tr[data-site] {
  cursor: pointer;
}
tbody tr:hover td {
  background: var(--hover-row);
}
tbody tr.hl td {
  background: var(--sel-row);
}
.site-identity {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
/* The site icon sits on a tile with the name's first letter, which shows where there is no icon. */
.favicon {
  position: relative;
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: -2px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--chip);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.favicon::before {
  content: attr(data-letter);
}
.favicon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface);
}
.page-head .dek .favicon {
  margin-right: 8px;
  vertical-align: -3px;
}
.site-name {
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
  flex-shrink: 0;
}
button.site-name {
  font: inherit;
  font-weight: 500;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 0;
  text-align: left;
  white-space: nowrap;
}
.site-name:hover {
  color: var(--accent);
}
.site-domain {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 3;
}
.tag {
  display: inline-block;
  flex-shrink: 0;
  font-size: 10px;
  line-height: 16px;
  color: var(--muted);
  background: var(--page);
  border: 1px solid var(--grid);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 6px;
  font-weight: 400;
}
.site-identity .tag {
  margin-left: 0;
}
/* Tags stay on the row's one line; the cell's title lists them all. */
.tags {
  display: inline-flex;
  gap: 4px;
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
}
.tags .tag {
  margin-left: 0;
}
.radar {
  color: var(--ink-2);
  font-size: 12px;
}
.ranking-table {
  min-width: 640px;
}
.ranking-table .traffic-cell {
  font-weight: 500;
}
.unit {
  margin-left: 1px;
  font-size: 0.85em;
  font-weight: 400;
  color: var(--muted);
}
.trend-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.trend-cell .delta {
  min-width: 64px;
}
.spark-cell {
  display: inline-flex;
  width: 64px;
  height: 24px;
  flex: 0 0 64px;
}
.spark-cell .line {
  stroke-width: 1.5;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 18px;
  white-space: normal;
}
.empty strong {
  display: block;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 16px;
}
.empty p {
  margin: 8px 0 16px;
  font-size: 13px;
}
.loading-state {
  padding: 64px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 100%;
  background: var(--accent);
}
.data-stamp {
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  margin: 14px 0 0;
}
/* Ranking history stays visible below the table. */
.trajectory {
  border-width: 1px 0 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.trajectory {
  padding-bottom: 16px;
}
/* Server-rendered views and forms. */
section.block {
  padding: 24px 0 8px;
}
section.block > h2,
section.block > header h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
section.block > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
section.block h2 small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 10px;
}

/* Summary cards and the section pills follow tag.observe.tw/media/. */
.subnav {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  margin: 0 0 20px;
  border-radius: 8px;
  background: var(--surface);
  overflow-x: auto;
}
.subnav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.subnav a:hover {
  color: var(--ink);
  text-decoration: none;
}
.subnav a[aria-current="page"] {
  background: #3f3f46;
  color: #fff;
  font-weight: 500;
}
.chip-rows {
  margin: 0 0 20px;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.chip-filter,
.chip-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}
.chip-filter span {
  color: var(--muted);
}
.chip-filter:hover,
.chip-more:hover {
  color: #fff;
  text-decoration: none;
}
.chip-filter[aria-current="true"],
.chip-filter[aria-pressed="true"] {
  background: var(--chip-on);
  color: #fff;
}
.chip-filter[aria-current="true"] span,
.chip-filter[aria-pressed="true"] span {
  color: #ffffffcc;
}
.chip-filter.excluded {
  background: #7f1d1d;
  color: #fecaca;
}
.chip-filter.excluded span {
  color: #fecacacc;
}
.chip-note {
  align-self: center;
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}
.chip-more {
  display: none;
  background: transparent;
  color: var(--accent);
}
.js .chip-more {
  display: inline-flex;
}
.js .chip-row:not(.open) > .extra {
  display: none;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.stats > div {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 12px;
  padding: 16px;
}
.stats span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.stats b {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.stats b small {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.stats b .delta {
  font-size: inherit;
}
.stats > div > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.chart-box {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 10px;
  padding: 20px 18px 12px;
}
.chart-box h3 {
  margin: 0;
  font-size: 14px;
}
.chart-box .note {
  margin: 0 0 8px;
}
svg .dot.sheet {
  fill: var(--surface);
  stroke: var(--series-1);
  stroke-width: 1.5;
}
svg .hit {
  fill: transparent;
  cursor: crosshair;
}
.flash {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
form.inline {
  display: inline;
}
.form {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 12px;
  padding: 24px;
  margin: 16px 0 0;
  max-width: 48rem;
}
.form .row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  margin-top: 18px;
  font-size: 14px;
}
.form label {
  font-size: 14px;
  color: var(--ink-2);
  max-width: 100%;
}
.form input {
  max-width: 100%;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
}
/* Tags pages: a cloud sized by cumulative visits or site count, and chips. */
.cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding: 20px 22px;
  border: 1px solid var(--grid);
  border-radius: 12px;
  line-height: 1.25;
}
.cloud a {
  --k: var(--v);
  font-size: calc(13px + var(--k) * 26px);
  font-weight: calc(400 + var(--k) * 300);
  color: color-mix(in srgb, var(--accent) calc(var(--k) * 100%), var(--muted));
  white-space: nowrap;
  transition: font-size 0.2s;
}
.cloud[data-by="sites"] a {
  --k: var(--s);
}
.cloud a small {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  vertical-align: super;
}
.cloud a:hover {
  color: var(--ink);
  text-decoration: none;
}
.seg {
  display: inline-flex;
}
.seg button {
  min-height: 30px;
  padding: 2px 12px;
  font-size: 12px;
  border-radius: 0;
}
.seg button:first-child {
  border-radius: 6px 0 0 6px;
}
.seg button:last-child {
  margin-left: -1px;
  border-radius: 0 6px 6px 0;
}
.chips a {
  font-size: 13px;
  border: 1px solid var(--grid);
  border-radius: 999px;
  padding: 4px 12px;
  color: var(--ink-2);
}
.chips a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.chips a small {
  margin-left: 6px;
  color: var(--muted);
}
.links-inline {
  display: inline-flex;
  gap: 16px;
}
.leaders {
  display: block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.leaders a {
  color: var(--ink-2);
}
.stats b a {
  color: inherit;
}
.stats b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* API documentation, laid out like tag.observe.tw/api/: content with a sticky outline on the right. */
.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 8px;
}
.doc-links a {
  padding: 4px 12px;
  border: 1px solid var(--axis);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
}
.doc-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 48px;
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 8px 0 8px 14px;
  border-left: 1px solid var(--grid);
  font-size: 13px;
}
.doc-toc p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.doc-toc a {
  display: block;
  padding: 3px 0;
  color: var(--ink-2);
}
.doc-toc a.sub {
  padding-left: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.doc-toc a:hover {
  color: var(--accent);
  text-decoration: none;
}
.doc-main code,
.doc-main pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.doc-main :not(pre) > code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--chip);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.doc-main pre {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--grid);
  border-radius: 8px;
  background: var(--surface);
  overflow-x: auto;
  line-height: 1.6;
}
.doc-rules {
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.9;
}
.doc-endpoint {
  padding: 18px 0 14px;
  border-top: 1px solid var(--grid);
  scroll-margin-top: 16px;
}
.doc-endpoint h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 16px;
}
.doc-endpoint .method {
  padding: 1px 8px;
  border-radius: 4px;
  background: #14532d;
  color: #bbf7d0;
  font-size: 12px;
  font-weight: 700;
}
.doc-endpoint .path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}
.doc-summary {
  margin: 0 0 6px;
  color: var(--ink);
}
.doc-table {
  width: 100%;
  margin: 8px 0 12px;
  border: 1px solid var(--grid);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 13px;
}
.doc-table th,
.doc-table td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}
.doc-table td:first-child {
  white-space: nowrap;
}
.doc-table td small {
  margin-left: 6px;
  color: var(--muted);
}
.doc-example a {
  font-size: 13px;
}
.doc-fields {
  margin-top: 10px;
}
.doc-fields summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: 14px;
}
.doc-fields summary span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }
  .doc-toc {
    display: none;
  }
}
/* The method note opens on demand; the footer holds the secondary pages. */
details.method {
  margin-top: 40px;
  border-top: 1px solid var(--grid);
  font-size: 13px;
  color: var(--muted);
}
details.method summary {
  cursor: pointer;
  padding: 16px 0;
  color: var(--ink-2);
  font-weight: 600;
}
details.method p {
  max-width: 65em;
  line-height: 1.9;
  margin: 0 0 12px;
}
details.method[open] {
  padding-bottom: 12px;
}
.site-footer {
  margin-top: 24px;
  background: #111113;
  border-top: 1px solid var(--grid);
  font-size: 14px;
  color: var(--muted);
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px 48px;
  padding: 40px 0 32px;
}
.footer-about {
  max-width: 26rem;
}
.footer-about p {
  margin: 14px 0 0;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 64px;
}
.footer-nav h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.footer-nav a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
}
.footer-nav a:hover,
.footer-nav a.on {
  color: var(--accent);
  text-decoration: none;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px 0 28px;
  border-top: 1px solid var(--grid);
  font-size: 12px;
}
.footer-bottom a {
  color: var(--muted);
}
/* Long tables show 50 rows; 「瀏覽更多」 then keeps adding rows while scrolling. */
.table-more {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 12px;
  color: var(--muted);
}
.table-more[hidden] {
  display: none;
}
.table-more button {
  min-height: 34px;
  padding: 5px 16px;
  font-size: 13px;
}
.chart-narrow {
  display: none;
}

/* Charts */
svg.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
svg .gridline {
  stroke: var(--grid);
  stroke-width: 1;
}
svg .baseline {
  stroke: var(--axis);
  stroke-width: 1;
}
svg .tick {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
svg .line {
  fill: none;
  stroke: var(--series-1);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
svg .dot {
  fill: var(--series-1);
  stroke: var(--surface);
  stroke-width: 2;
}
svg .gapmark {
  stroke: var(--axis);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
svg .band {
  fill: var(--series-1-wash);
  opacity: 0.55;
}
svg .from {
  fill: var(--surface);
  stroke: var(--series-1);
  stroke-width: 1.5;
}
svg .cross {
  stroke: var(--ink-2);
  stroke-width: 1;
}
.spark {
  width: 64px;
  height: 24px;
}
.tip {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  background: var(--ink);
  color: var(--tip-ink);
  font-size: 12px;
  line-height: 1.5;
  padding: 6px 9px;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity 0.08s;
  max-width: 240px;
}
.tip.show {
  opacity: 1;
}
.tip b {
  font-weight: 600;
}

/* Rank trajectory (排名軌跡) */
.bump {
  margin: 6px 0 22px;
  position: relative;
}
.bump .bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.bump .bar h3 {
  font-size: 16px;
  margin: 0;
  color: var(--ink);
}
.bump .seg {
  display: inline-flex;
}
.bump .seg button {
  border-radius: 0;
  padding: 2px 10px;
  font-size: 13px;
}
.bump .seg button:first-child {
  border-radius: 6px 0 0 6px;
}
.bump .seg button:last-child {
  border-radius: 0 6px 6px 0;
  margin-left: -1px;
}
.bump .seg button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  position: relative;
}
.bump .note {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
.bump svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: pan-y;
}
.bump .bl path {
  fill: none;
  stroke: var(--other);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.bump .bl circle {
  fill: var(--other);
  stroke: var(--surface);
  stroke-width: 1.5;
}
.bump .bl.on path {
  stroke: var(--series-1);
  stroke-width: 2.5;
}
.bump .bl.on circle {
  fill: var(--series-1);
}
.bump .bl.dim {
  opacity: 0.3;
}
.bump .bl.hov path {
  stroke: var(--ink-2);
}
.bump .bl.hov circle {
  fill: var(--ink-2);
}
.bump .bl.on.hov path {
  stroke: var(--series-1);
}
.bump .bl.on.hov circle {
  fill: var(--series-1);
}
.bump .bl {
  cursor: pointer;
}
.bump text.end {
  font-size: 12px;
  fill: var(--ink-2);
}
.bump text.end.on {
  fill: var(--ink);
  font-weight: 600;
}
.bump .tick {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 800px) {
  .wrap {
    padding-inline: 24px;
  }
  .site-inner {
    gap: 26px;
  }
  .site-nav {
    gap: 18px;
  }
}
@media (max-width: 640px) {
  .wrap {
    padding-inline: 16px;
  }
  .site-inner {
    flex-wrap: wrap;
    min-height: auto;
    gap: 0;
    padding-top: 10px;
  }
  .brand {
    font-size: 18px;
  }
  .site-tools {
    order: 1;
    gap: 16px;
  }
  .site-nav {
    order: 2;
    width: 100%;
    gap: 26px;
    height: 42px;
    margin-top: 4px;
  }
  .site-nav a {
    font-size: 13px;
  }
  .site-tools .who small {
    max-width: 100px;
  }
  h1 {
    font-size: 28px;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 0 14px;
  }
  main.wrap {
    padding-top: 16px;
  }
  .page-head h1 {
    font-size: 24px;
  }
  .toolbar .search-field {
    flex-basis: 100%;
  }
  .select-field {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }
  .select-field select {
    flex: 1;
    width: 100%;
  }
  th,
  td {
    padding-inline: 8px;
  }
  th.rank,
  td.rank {
    padding-inline: 4px;
  }
  .table-lead-box {
    width: 152px;
    max-width: 152px;
    transition: max-width 0.2s;
  }
  .scroll[data-compact-lead="true"][data-scroll-x="middle"] .table-lead-box,
  .scroll[data-compact-lead="true"][data-scroll-x="end"] .table-lead-box {
    max-width: 88px;
  }
  .scroll[data-compact-lead="true"][data-scroll-x="middle"] .table-lead-extra,
  .scroll[data-compact-lead="true"][data-scroll-x="end"] .table-lead-extra {
    display: none;
  }
  .ranking-table .name-cell {
    width: auto;
  }
  .data-stamp {
    font-size: 10px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stats > div {
    padding: 15px;
  }
  .stats b {
    font-size: 22px;
  }
  .charts {
    grid-template-columns: 1fr;
  }
  .chart-wide {
    display: none;
  }
  .chart-narrow {
    display: block;
  }
  .form {
    padding: 18px;
  }
  .form .row {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cloud a,
  .tip,
  .table-lead-box {
    transition: none;
  }
}
.report-main:focus {
  outline: none;
}

.bulk-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
}
/* A site's pages (data, name and tags, Pro entries) as tabs under its title. */
/* Forms: one labelled field per block, its hint underneath. */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 22px;
  min-width: 0;
}
.field > label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.field small {
  font-size: 12px;
  color: var(--muted);
}
.field input,
.field select {
  width: 100%;
  max-width: 100%;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 18px;
}
.input-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-unit span {
  color: var(--muted);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.edit-form,
.manual-form {
  max-width: 44rem;
}
.callout {
  margin: 0 0 8px;
  padding: 12px 16px;
  border: 1px solid var(--grid);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.callout.warn {
  border-color: #7c2d12;
  background: #1c1007;
}
.callout b {
  color: var(--ink);
}
.steps {
  margin: 0 0 16px;
  padding-left: 1.4em;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.9;
}
/* Tag editor: chosen tags as removable chips, a search that suggests, and common tags. */
.tag-editor textarea[hidden] {
  display: none;
}
.tag-picked {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--sel-row);
  color: var(--ink);
  font-size: 13px;
}
.chip button {
  min-height: 26px;
  width: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.chip button:hover {
  color: var(--ink);
  background: #ffffff14;
}
.tag-field {
  position: relative;
}
.tag-field input {
  width: 100%;
}
.tag-suggest {
  position: absolute;
  z-index: 15;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #111113;
  border: 1px solid var(--axis);
  border-radius: 8px;
  box-shadow: 0 12px 30px #00000080;
}
.tag-suggest li {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.tag-suggest li[aria-selected="true"],
.tag-suggest li:hover {
  background: var(--sel-row);
  color: var(--accent);
}
.tag-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.tag-quick button {
  min-height: 28px;
  padding: 2px 10px;
  border-color: var(--grid);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
}
.tag-foot {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tag-foot .note {
  margin: 0;
}
/* A site's tag block (tagPanel): one tag per row, its source and votes, then the reader's and admin's buttons. */
.tag-votes {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.tag-votes li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.tag-votes .note {
  margin: 0;
}
.tag-vote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.tag-vote-actions form {
  display: flex;
  gap: 6px;
}
.chip-filter.muted-chip {
  opacity: 0.55;
  text-decoration: line-through;
}
.tag-propose {
  display: flex;
  gap: 8px;
  max-width: 420px;
}
.tag-propose input {
  flex: 1;
  min-width: 0;
}
/* Shares as labelled bars (similarwebSection): name and meaning, bar, percentage, visits it stands for. */
.share-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.share-list li {
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) minmax(60px, 2fr) 56px 72px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.share-list li.zero {
  opacity: 0.45;
}
.share-name small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.share-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--page);
  overflow: hidden;
}
.share-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.share-list b {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.share-visits {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.method-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-2);
}
.method-note ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
@media (max-width: 640px) {
  .share-list li {
    grid-template-columns: 1fr 52px 64px;
  }
  .share-bar {
    grid-column: 1 / -1;
    order: 2;
  }
}
/* Small multiples of traffic channels (channelTiles): one chart per channel, two or three per row. */
.channel-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.channel-tile h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.channel-tile h3 b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.channel-tile h3 .delta {
  font-size: 12px;
  font-weight: 400;
}
.channel-tile.zero {
  opacity: 0.5;
}
.shift {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
/* A switch of plain links (toggle): the label, then the choices as one segmented control. */
.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--grid);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}
.seg span {
  padding: 0 8px 0 6px;
  color: var(--muted);
  font-size: 12px;
}
.seg a {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--ink-2);
}
.seg a:hover {
  color: var(--ink);
  text-decoration: none;
}
.seg a[aria-current="true"] {
  background: #3f3f46;
  color: #fff;
  font-weight: 500;
}
.table-note {
  margin-top: 12px;
}

/* The site page's 網站技術 block: categories beside their technologies. */
.tech-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0 0 12px;
}
.tech-list dt {
  color: var(--muted);
}
.tech-list dd {
  margin: 0;
}
.tech-list .tags,
#tech-sites .tags {
  flex-wrap: wrap;
  max-width: none;
  white-space: normal;
}
