:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --ink: #161914;
  --muted: #6d7168;
  --line: #c8cbc1;
  --signal: #d74a2c;
  --signal-dark: #a9321b;
  --green: #2e704e;
  --panel: rgba(252, 251, 247, 0.82);
  --shadow: 0 24px 70px rgba(36, 42, 32, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(36, 42, 32, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 42, 32, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family:
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--ink);
}

.brand-mark i {
  width: 8px;
  height: 8px;
  background: var(--ink);
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(3) {
  background: var(--signal);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.repo-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.repo-link:hover {
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(480px, 1.2fr);
  gap: clamp(36px, 6vw, 92px);
  align-items: end;
  padding: clamp(64px, 10vw, 118px) 0 54px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 14px;
  color: var(--signal);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1 {
  max-width: 6em;
  margin: 0;
  font-family: "Songti SC", "SimSun", serif;
  font-size: clamp(3.7rem, 7vw, 6.6rem);
  font-weight: 600;
  letter-spacing: -0.08em;
  line-height: 0.94;
}

.intro {
  max-width: 34rem;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.85;
}

.lookup-form {
  padding: 25px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.lookup-form > label,
.mark-form label,
.custom-mark-field label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  border: 1px solid var(--ink);
  background: #fff;
}

.country-code {
  display: grid;
  place-items: center;
  width: 52px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.search-row input {
  min-width: 0;
  height: 60px;
  padding: 0 18px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.search-row input::placeholder {
  color: #9a9d95;
}

.search-row input:focus-visible {
  box-shadow: inset 0 0 0 2px var(--signal);
}

.search-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 116px;
  border: 0;
  color: #fff;
  background: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.search-row button:hover {
  background: var(--signal);
}

.search-row button span {
  font-size: 1.2rem;
}

.form-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 22px;
  margin: 10px 0 0;
}

.form-meta p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
}

.form-error {
  color: var(--signal-dark);
  font-weight: 600;
}

.privacy-note {
  margin-left: auto !important;
  color: var(--muted);
  text-align: right;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.72rem;
}

.examples button {
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.68rem;
}

.examples button:hover {
  border-color: var(--signal);
  color: var(--signal-dark);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  border: 1px solid var(--ink);
  background: #fbfaf6;
  box-shadow: var(--shadow);
}

.lookup-result {
  min-height: 360px;
  padding: clamp(28px, 5vw, 56px);
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 250px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border: 1px dashed var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: "Songti SC", serif;
  font-size: 1.8rem;
}

.empty-state p {
  margin: 0 0 8px;
  font-weight: 700;
}

.empty-state small {
  color: var(--muted);
}

.result-topline {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

[data-state="yellow_page"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(46, 112, 78, 0.12);
}

[data-state="local_mark"] .status-dot {
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(215, 74, 44, 0.12);
}

.result-number {
  margin-left: auto;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: none;
}

.lookup-result h2 {
  max-width: 12em;
  margin: 28px 0 38px;
  font-family: "Songti SC", "SimSun", serif;
  font-size: clamp(2.2rem, 4.6vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1.02;
}

[data-state="none"] h2 {
  color: #858980;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.facts div {
  padding: 18px 20px 18px 0;
}

.facts div + div {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.facts span,
.facts strong {
  display: block;
}

.facts span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.7rem;
}

.facts strong {
  font-size: 1rem;
  font-weight: 600;
}

.source-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.6;
}

.network-marks {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.network-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.network-heading .panel-kicker {
  margin-bottom: 6px;
}

.network-heading h3 {
  margin: 0;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 1.7rem;
  font-weight: 600;
}

.network-cache {
  flex: none;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.62rem;
}

.network-summary {
  margin: 16px 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.platform-card {
  min-height: 92px;
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
}

.platform-card.is-marked {
  background: rgba(215, 74, 44, 0.075);
}

.platform-card.is-unknown {
  background: #f0f1ed;
}

.platform-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.platform-card-top strong {
  font-size: 0.88rem;
}

.platform-card-top span {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.6rem;
}

.platform-card.is-marked .platform-card-top span {
  color: var(--signal-dark);
  font-weight: 700;
}

.platform-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.platform-card.is-marked p {
  color: var(--signal-dark);
  font-weight: 600;
}

.network-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.6;
}

.manual-query {
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed var(--line);
  background: #f6f5ef;
}

.manual-query strong {
  font-size: 0.82rem;
}

.manual-query p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.6;
}

.manual-query-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.manual-query-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.62rem;
  font-weight: 700;
}

.manual-query input {
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: #fff;
}

.manual-query input:focus {
  border-color: var(--ink);
}

.manual-query button {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
}

.manual-query button:hover {
  border-color: var(--signal);
  background: var(--signal);
}

.manual-query .manual-query-message {
  min-height: 1.1em;
}

.mark-panel {
  padding: clamp(26px, 4vw, 42px);
  border-left: 1px solid var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(215, 74, 44, 0.1), transparent 38%),
    #eeece5;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.panel-index {
  padding-top: 3px;
  color: var(--signal);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.7rem;
}

.panel-kicker {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.62rem;
}

.panel-heading h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 1.65rem;
  font-weight: 600;
}

.panel-copy {
  margin: 26px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.8;
}

.mark-form select,
.custom-mark-field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: #fff;
}

.mark-form select:focus,
.custom-mark-field input:focus {
  border-color: var(--ink);
}

.custom-mark-field {
  margin-top: 16px;
}

.secondary-button {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.secondary-button:hover {
  border-color: var(--signal);
  background: var(--signal);
}

.text-button {
  display: block;
  margin: 15px auto 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button:hover {
  color: var(--signal-dark);
}

.mark-message {
  min-height: 34px;
  margin: 15px 0 0;
  color: var(--signal-dark);
  font-size: 0.7rem;
  line-height: 1.6;
}

.batch-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 28px clamp(32px, 6vw, 76px);
  padding: 60px 0;
  border-top: 1px solid var(--ink);
}

.batch-copy h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", serif;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  font-weight: 600;
  letter-spacing: -0.05em;
}

.batch-copy > p:last-child {
  max-width: 28rem;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

.batch-form {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.batch-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.batch-form textarea {
  display: block;
  width: 100%;
  min-height: 142px;
  padding: 14px;
  border: 1px solid var(--ink);
  border-radius: 0;
  outline: 0;
  resize: vertical;
  color: var(--ink);
  background: #fff;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.7;
}

.batch-form textarea:focus {
  box-shadow: inset 0 0 0 2px var(--signal);
}

.batch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
}

.batch-actions span {
  color: var(--muted);
  font-size: 0.65rem;
}

.batch-actions button {
  flex: none;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.batch-actions button:hover {
  border-color: var(--signal);
  background: var(--signal);
}

.batch-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.batch-status,
.batch-results {
  grid-column: 1 / -1;
}

.batch-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.batch-progress {
  grid-column: 1 / -1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8dc;
}

.batch-progress span {
  display: block;
  width: 32%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 240ms ease;
}

.batch-progress[data-state="loading"] span {
  animation: batch-progress 1.2s ease-in-out infinite alternate;
}

.batch-progress[data-state="complete"] span {
  width: 100%;
}

@keyframes batch-progress {
  from {
    width: 18%;
  }
  to {
    width: 72%;
  }
}

.batch-results {
  min-width: 0;
}

.batch-table-title {
  margin: 6px 0 14px;
  font-size: 1.22rem;
  font-weight: 700;
}

.batch-table-hint {
  display: none;
  margin: -6px 0 10px;
  color: var(--muted);
  font-size: 0.68rem;
}

.batch-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.batch-table {
  width: 100%;
  min-width: 1088px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
  font-size: 0.76rem;
  white-space: nowrap;
}

.batch-table th,
.batch-table td {
  height: 54px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.batch-table th:last-child,
.batch-table td:last-child {
  border-right: 0;
}

.batch-table tbody tr:last-child td {
  border-bottom: 0;
}

.batch-table th {
  color: #263029;
  background: #f5f7f3;
  font-weight: 700;
}

.batch-table th:nth-child(1) {
  width: 48px;
}

.batch-table th:nth-child(2) {
  width: 104px;
}

.batch-table th:nth-child(3) {
  width: 140px;
}

.batch-table tbody tr:nth-child(even) {
  background: #fafbf8;
}

.batch-table tbody tr.has-mark {
  background: #fff4f1;
}

.batch-table .batch-index {
  width: 48px;
  color: #6b7068;
  background: #f9faf7;
}

.batch-table .batch-time {
  color: #797e76;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.68rem;
}

.batch-table .batch-number {
  background: #f9faf7;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.batch-table tr.has-mark .batch-index,
.batch-table tr.has-mark .batch-number {
  background: #fff7f4;
}

.batch-cell-badge {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border-radius: 4px;
  color: #fff;
  background: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
}

.batch-table td.is-marked .batch-cell-badge {
  min-width: 46px;
  background: var(--signal);
}

.batch-table td.is-unknown .batch-cell-badge {
  background: #9a9e96;
}

.batch-invalid {
  padding: 14px 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.7rem;
}

.method {
  padding: 54px 0 64px;
}

.method-heading {
  margin-bottom: 26px;
}

.method ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.method li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 24px 26px 24px 0;
  border-bottom: 1px solid var(--line);
}

.method li + li {
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.method li span {
  color: var(--signal);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.65rem;
}

.method li p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.method li strong {
  color: var(--ink);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 26px 0 38px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.7;
}

footer p {
  max-width: 720px;
  margin: 0;
}

footer a {
  text-underline-offset: 3px;
}

footer span {
  flex: none;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.08em;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 34px;
    padding-top: 65px;
  }

  h1 {
    max-width: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .mark-panel {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .method ol {
    grid-template-columns: 1fr;
  }

  .batch-section {
    grid-template-columns: 1fr;
  }

  .method li + li {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    padding: 20px 0;
  }

  .repo-link {
    font-size: 0;
  }

  .repo-link span {
    font-size: 1rem;
  }

  .hero {
    padding-top: 50px;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 4rem);
    line-height: 0.98;
  }

  .lookup-form {
    padding: 16px;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .country-code {
    display: none;
  }

  .search-row input {
    height: 54px;
    padding: 0 12px;
    font-size: 0.95rem;
  }

  .search-row button {
    min-width: 82px;
  }

  .manual-query-controls {
    grid-template-columns: 1fr;
  }

  .form-meta {
    display: block;
  }

  .privacy-note {
    margin-top: 4px !important;
    text-align: left;
  }

  .lookup-result,
  .mark-panel {
    padding: 24px 20px;
  }

  .lookup-result h2 {
    margin: 24px 0 30px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  .batch-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-actions button {
    width: 100%;
  }

  .batch-table-hint {
    display: block;
  }

  .facts div + div {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .result-topline {
    flex-wrap: wrap;
  }

  .result-number {
    width: 100%;
    margin: 4px 0 0;
  }

  footer {
    display: block;
  }

  footer span {
    display: block;
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #basic-result[data-state]:not([data-state="empty"]) {
    animation: reveal 220ms ease-out;
  }

  @keyframes reveal {
    from {
      opacity: 0.25;
      transform: translateY(5px);
    }
  }
}
