:root {
  --paper: #f2eee5;
  --sheet: #fffdf7;
  --ink: #191c1a;
  --blue: #8eb8ef;
  --blue-dark: #3f6f9f;
  --blue-soft: #dceafb;
  --lime: #d8ef74;
  --orange: #ff9c5a;
  --violet: #a995e8;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); }
button, input, select, textarea { color: inherit; font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.paper-noise {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
}

.tool-header,
main,
.tool-footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
main { display: flex; flex-direction: column; }
.tool-header { display: flex; min-height: 84px; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--ink); }
.tool-brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; font-weight: 950; }
.tool-brand__mark { display: grid; width: 42px; height: 42px; place-items: center; border: 2px solid var(--ink); border-radius: 9px 13px 8px 15px; background: var(--blue); box-shadow: 3px 3px 0 var(--ink); font-size: 20px; }
.tool-brand small { display: block; margin-top: 2px; font-size: 8px; letter-spacing: .12em; }
.tool-header nav { display: flex; gap: 10px; }
.tool-header nav a,
.tool-footer a { padding: 8px 11px; border: 1.5px dashed var(--ink); color: inherit; font-size: 11px; font-weight: 900; text-decoration: none; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 20px; color: #4f514b; font-size: 10px; font-weight: 850; }
.breadcrumb a { color: inherit; }
.kicker { font-size: 10px; font-weight: 950; letter-spacing: .17em; text-transform: uppercase; }

.time-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); gap: clamp(44px, 8vw, 100px); align-items: center; padding: clamp(62px, 9vw, 112px) 0 92px; }
.time-hero h1 { margin: 18px 0 26px; font-size: clamp(70px, 10vw, 126px); line-height: .96; letter-spacing: -.06em; }
.time-hero__copy > p { max-width: 670px; margin: 0; font-size: clamp(17px, 2vw, 23px); font-weight: 800; line-height: 1.65; }
.hero-note { display: grid; gap: 5px; max-width: 660px; margin-top: 30px; padding: 14px 16px; border: 2px solid var(--ink); border-left-width: 8px; background: var(--blue-soft); box-shadow: 4px 4px 0 var(--ink); transform: rotate(-.4deg); }
.hero-note b { font-size: 10px; letter-spacing: .12em; }
.hero-note span { font-size: 13px; font-weight: 850; line-height: 1.55; }
.hero-action { display: inline-block; margin-top: 22px; padding: 11px 15px; border: 2px solid var(--ink); background: var(--lime); box-shadow: 4px 4px 0 var(--ink); color: inherit; font-size: 11px; font-weight: 950; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.hero-action:hover,
.hero-action:focus-visible { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }

.now-ticket { position: relative; overflow: hidden; padding: 25px; border: 3px solid var(--ink); border-radius: 31px 8px 38px 12px; background: var(--blue); box-shadow: 12px 12px 0 var(--ink); transform: rotate(1.2deg); }
.now-ticket::before { position: absolute; width: 230px; height: 230px; right: -105px; top: -105px; border: 2px dashed rgba(25,28,26,.55); border-radius: 50%; content: ""; animation: ticket-orbit 18s linear infinite; }
.now-ticket header { position: relative; display: flex; gap: 20px; align-items: start; justify-content: space-between; margin-bottom: 27px; }
.now-ticket header span { font-size: 9px; font-weight: 950; letter-spacing: .15em; }
.now-ticket h2 { margin: 5px 0 0; font-size: 18px; }
.live-badge { display: inline-flex; gap: 6px; align-items: center; padding: 6px 8px; border: 2px solid var(--ink); background: var(--lime); white-space: nowrap; }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: #267348; animation: live-pulse 1.2s ease-in-out infinite; }
.live-badge.is-paused { background: var(--sheet); }
.live-badge.is-paused i { background: var(--orange); animation: none; }
.number-row { position: relative; display: grid; width: 100%; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 11px; padding: 15px 16px; border: 2px solid var(--ink); background: var(--sheet); text-align: left; transition: transform .15s ease, box-shadow .15s ease; }
.number-row:hover,
.number-row:focus-visible { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--ink); }
.number-row span { font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.number-row strong { grid-column: 1 / -1; overflow: hidden; font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(24px, 4vw, 42px); letter-spacing: -.055em; text-overflow: ellipsis; }
.number-row em { position: absolute; top: 12px; right: 13px; font-size: 9px; font-style: normal; font-weight: 950; }
.ticket-actions { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-top: 18px; }
.ticket-actions button { padding: 8px 10px; border: 2px solid var(--ink); background: var(--lime); font-size: 10px; font-weight: 950; }
.ticket-actions span { font-size: 9px; font-weight: 800; }

.section-heading h2 { margin: 11px 0 0; font-size: clamp(44px, 6vw, 76px); line-height: .9; letter-spacing: -.07em; }
.section-heading > p { max-width: 580px; margin: 16px 0 0; font-size: 13px; font-weight: 750; line-height: 1.7; }

.moment-lab { order: 3; padding: 86px 0 105px; border-top: 3px solid var(--ink); }
.moment-lab > .section-heading { display: grid; grid-template-columns: .75fr 1.25fr; column-gap: 40px; align-items: end; }
.moment-lab > .section-heading .kicker { grid-column: 1 / -1; }
.moment-stage { position: relative; margin-top: 52px; padding: 54px 32px 30px; border: 3px solid var(--ink); background: var(--sheet); box-shadow: 10px 10px 0 var(--ink); }
.moment-core { position: relative; z-index: 3; display: grid; width: min(430px, 88%); min-height: 140px; place-items: center; align-content: center; margin: 0 auto -22px; border: 3px solid var(--ink); border-radius: 50%; background: var(--lime); box-shadow: 6px 7px 0 var(--ink); text-align: center; }
.moment-core::before,
.moment-core::after { position: absolute; border: 2px solid var(--ink); border-radius: 50%; content: ""; pointer-events: none; }
.moment-core::before { inset: -13px; opacity: .28; }
.moment-core::after { inset: -26px; opacity: .12; }
.moment-core span,
.moment-core small { font-size: 9px; font-weight: 950; letter-spacing: .14em; }
.moment-core strong { margin: 8px 0 5px; font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(27px, 5vw, 50px); letter-spacing: -.05em; }
.clock-rail { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-top: 88px; }
.clock-rail::before { position: absolute; z-index: 0; top: 53px; left: 10%; width: 80%; height: 3px; background: var(--ink); content: ""; }
.clock-rail::after { position: absolute; z-index: 2; top: 43px; left: 10%; width: 19px; height: 19px; border: 2px solid var(--ink); border-radius: 50%; background: var(--orange); box-shadow: 2px 2px 0 var(--ink); content: ""; animation: rail-travel 5.5s ease-in-out infinite alternate; }
.clock-card { position: relative; z-index: 1; min-width: 0; padding: 20px; border: 2px solid var(--ink); background: var(--blue-soft); }
.clock-card::before { position: absolute; top: -37px; left: 50%; width: 2px; height: 37px; background: var(--ink); content: ""; }
.clock-card--beijing { background: var(--blue); transform: translateY(-8px) rotate(-.6deg); }
.clock-card--local { background: #e6dcfb; transform: rotate(.7deg); }
.clock-card span,
.clock-card strong,
.clock-card small { display: block; }
.clock-card span { min-height: 26px; font-size: 9px; font-weight: 950; letter-spacing: .08em; }
.clock-card strong { margin: 23px 0 7px; font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(27px, 4vw, 46px); line-height: 1; letter-spacing: -.04em; }
.clock-card small { font-size: 10px; font-weight: 800; }
.moment-caption { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: center; margin: 26px 0 0; text-align: center; }
.moment-caption b { font-size: 13px; }
.moment-caption span { font-size: 10px; font-weight: 750; }

.converter { order: 2; padding: 88px 0 110px; border-top: 3px solid var(--ink); }
.converter-heading { display: grid; grid-template-columns: .75fr 1.25fr; column-gap: 40px; align-items: end; }
.converter-heading .kicker { grid-column: 1 / -1; }
.mode-tabs { display: flex; gap: 9px; margin-top: 40px; }
.mode-tabs button { min-height: 52px; padding: 11px 18px; border: 2px solid var(--ink); background: transparent; font-size: 13px; font-weight: 950; }
.mode-tabs button.is-active { background: var(--lime); box-shadow: 4px 4px 0 var(--ink); }
.converter-panel { display: grid; grid-template-columns: minmax(0, .9fr) minmax(390px, 1.1fr); margin-top: 16px; border: 3px solid var(--ink); background: var(--sheet); box-shadow: 9px 9px 0 var(--ink); }
.converter-panel[hidden] { display: none; }
.converter-input,
.converter-output { min-width: 0; min-height: 445px; padding: clamp(22px, 4vw, 42px); }
.converter-output { border-left: 2px dashed var(--ink); background: #edf4fc; }
.converter-input > label,
.batch-workbench label { display: block; margin: 18px 0 8px; font-size: 11px; font-weight: 950; }
.converter-input > label:first-child { margin-top: 0; }
.converter-input input,
.converter-input select,
.batch-workbench textarea { width: 100%; min-height: 54px; padding: 12px 14px; border: 2px solid var(--ink); background: var(--paper); font-weight: 800; }
.input-line { display: grid; grid-template-columns: minmax(0, 1fr) 155px; }
.input-line input { border-right: 0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 16px; }
.input-line select { min-width: 0; }
.input-help { display: flex; gap: 12px; align-items: start; justify-content: space-between; margin-top: 9px; color: #4e514e; font-size: 9px; font-weight: 800; line-height: 1.5; }
.input-help button { flex: 0 0 auto; padding: 0; border: 0; border-bottom: 1px solid; background: transparent; font-size: 9px; font-weight: 950; }
.field-note { margin: 10px 0 0; padding: 10px 12px; border-left: 5px solid var(--blue-dark); background: var(--blue-soft); font-size: 10px; font-weight: 750; line-height: 1.6; }
.primary-action { min-height: 50px; margin-top: 20px; padding: 11px 17px; border: 2px solid var(--ink); background: var(--blue); box-shadow: 4px 4px 0 var(--ink); font-size: 12px; font-weight: 950; }
.primary-action:hover,
.primary-action:focus-visible { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.form-error { margin: 15px 0 0; padding: 10px 12px; border: 2px solid var(--ink); background: #ffc7b3; font-size: 11px; font-weight: 850; line-height: 1.55; }
.empty-output { display: grid; min-height: 350px; place-items: center; align-content: center; text-align: center; }
.empty-output b { font-size: 65px; line-height: 1; }
.empty-output strong,
.empty-output span { display: block; }
.empty-output span { max-width: 360px; margin-top: 8px; font-size: 10px; font-weight: 750; line-height: 1.6; }
.result-stack { display: grid; gap: 10px; }
.result-intro { padding: 12px 14px; border: 2px solid var(--ink); background: var(--lime); }
.result-intro strong,
.result-intro span { display: block; }
.result-intro strong { font-size: 14px; }
.result-intro span { margin-top: 4px; font-size: 9px; font-weight: 750; line-height: 1.5; }
.result-row { position: relative; display: grid; gap: 4px; min-width: 0; padding: 11px 48px 11px 12px; border: 1.5px solid var(--ink); background: var(--sheet); }
.result-row span { font-size: 8px; font-weight: 950; letter-spacing: .08em; }
.result-row strong { overflow-wrap: anywhere; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.55; }
.result-row button { position: absolute; top: 10px; right: 10px; padding: 4px 6px; border: 1.5px solid var(--ink); background: var(--blue-soft); font-size: 8px; font-weight: 950; }
.result-warning { margin: 0; padding: 9px 11px; border-left: 5px solid var(--orange); background: #fff0dd; font-size: 9px; font-weight: 800; line-height: 1.6; }

.batch-lab { order: 4; padding: 88px 0 110px; border-top: 3px solid var(--ink); }
.batch-lab > .section-heading { display: grid; grid-template-columns: .75fr 1.25fr; column-gap: 40px; align-items: end; }
.batch-lab > .section-heading .kicker { grid-column: 1 / -1; }
.batch-workbench { display: grid; grid-template-columns: minmax(310px, .75fr) minmax(0, 1.25fr); margin-top: 40px; border: 3px solid var(--ink); background: var(--sheet); box-shadow: 9px 9px 0 var(--ink); }
.batch-workbench > div { min-width: 0; padding: clamp(22px, 4vw, 38px); }
.batch-workbench > div + div { border-left: 2px dashed var(--ink); background: #edf4fc; }
.batch-workbench textarea { min-height: 240px; resize: vertical; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; line-height: 1.65; }
.batch-table-wrap { max-height: 430px; overflow: auto; border: 2px solid var(--ink); background: var(--sheet); }
.batch-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.batch-toolbar strong { font-size: 12px; }
.batch-toolbar button { padding: 7px 9px; border: 2px solid var(--ink); background: var(--lime); font-size: 9px; font-weight: 950; }
.batch-table { width: 100%; border-collapse: collapse; font-size: 9px; text-align: left; }
.batch-table th { position: sticky; z-index: 1; top: 0; background: var(--blue); }
.batch-table th,
.batch-table td { padding: 9px 10px; border-bottom: 1px solid #bbb; vertical-align: top; }
.batch-table td:first-child { max-width: 170px; overflow-wrap: anywhere; font-family: monospace; }
.batch-table tr:last-child td { border-bottom: 0; }
.batch-table .is-error { color: #9e2f24; font-weight: 900; }

.misunderstandings { order: 5; padding: 88px 0 100px; border-top: 3px solid var(--ink); }
.mistake-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 38px; }
.mistake-grid article { position: relative; min-height: 235px; padding: 22px; border: 2px solid var(--ink); background: var(--sheet); }
.mistake-grid article:nth-child(2) { background: var(--blue); transform: translateY(12px) rotate(.5deg); }
.mistake-grid article:nth-child(3) { background: #e7ddfa; }
.mistake-grid b { position: absolute; top: 18px; right: 18px; font-size: 28px; }
.mistake-grid strong { display: block; max-width: 85%; margin-top: 78px; font-size: 20px; line-height: 1.2; }
.mistake-grid p { margin: 12px 0 0; font-size: 11px; font-weight: 750; line-height: 1.7; }

.timestamp-faq { order: 6; display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: clamp(35px, 7vw, 90px); padding: 85px 0 115px; border-top: 3px solid var(--ink); }
.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 2px solid var(--ink); background: var(--sheet); }
.faq-list details[open] { background: var(--blue-soft); }
.faq-list summary { padding: 17px 48px 17px 18px; font-size: 14px; font-weight: 900; line-height: 1.5; cursor: pointer; }
.faq-list p { margin: 0; padding: 0 18px 18px; font-size: 11px; font-weight: 750; line-height: 1.75; }

.tool-footer { display: flex; min-height: 92px; gap: 18px; align-items: center; justify-content: space-between; border-top: 3px solid var(--ink); font-size: 11px; font-weight: 850; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; max-width: min(360px, calc(100% - 44px)); padding: 12px 16px; border: 2px solid var(--ink); background: var(--lime); box-shadow: 4px 4px 0 var(--ink); font-size: 12px; font-weight: 900; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@keyframes rail-travel {
  from { left: 10%; transform: translateX(-50%) rotate(0); }
  to { left: 90%; transform: translateX(-50%) rotate(360deg); }
}
@keyframes live-pulse {
  0%, 100% { transform: scale(.75); opacity: .45; }
  50% { transform: scale(1.25); opacity: 1; }
}
@keyframes ticket-orbit { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .time-hero { grid-template-columns: 1fr; }
  .now-ticket { width: min(620px, 100%); justify-self: center; }
  .moment-lab > .section-heading,
  .converter-heading,
  .batch-lab > .section-heading { display: block; }
  .converter-panel,
  .batch-workbench { grid-template-columns: 1fr; }
  .converter-output,
  .batch-workbench > div + div { border-top: 2px dashed var(--ink); border-left: 0; }
  .converter-input,
  .converter-output { min-height: auto; }
  .timestamp-faq { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .tool-header,
  main,
  .tool-footer { width: min(100% - 28px, 1180px); }
  .tool-header { min-height: 72px; }
  .tool-header nav a:first-child { display: none; }
  .tool-brand__mark { width: 38px; height: 38px; }
  .time-hero { padding: 55px 0 72px; }
  .time-hero h1 { font-size: clamp(64px, 22vw, 96px); }
  .now-ticket { padding: 18px; box-shadow: 7px 7px 0 var(--ink); transform: none; }
  .number-row strong { font-size: clamp(23px, 8vw, 34px); }
  .ticket-actions { align-items: end; }
  .ticket-actions span { max-width: 130px; text-align: right; }
  .moment-lab,
  .converter,
  .batch-lab,
  .misunderstandings { padding: 68px 0 78px; }
  .moment-stage { padding: 42px 17px 24px; box-shadow: 6px 6px 0 var(--ink); }
  .moment-core { width: 92%; }
  .clock-rail { grid-template-columns: 1fr; gap: 11px; padding-top: 70px; }
  .clock-rail::before { top: 33px; left: 50%; width: 3px; height: calc(100% - 35px); }
  .clock-rail::after { top: 28px; left: calc(50% - 9px); animation: rail-travel-mobile 5.5s ease-in-out infinite alternate; }
  .clock-card,
  .clock-card--beijing,
  .clock-card--local { transform: none; }
  .clock-card::before { top: 50%; left: -19px; width: 19px; height: 2px; }
  .clock-card strong { margin-top: 12px; }
  .mode-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .mode-tabs button { padding: 9px; font-size: 11px; }
  .converter-panel,
  .batch-workbench { box-shadow: 6px 6px 0 var(--ink); }
  .input-line { grid-template-columns: 1fr; gap: 8px; }
  .input-line input { border-right: 2px solid var(--ink); }
  .mistake-grid { grid-template-columns: 1fr; }
  .mistake-grid article:nth-child(2) { transform: none; }
  .tool-footer { flex-wrap: wrap; justify-content: center; padding: 20px 0; text-align: center; }
}

@keyframes rail-travel-mobile {
  from { top: 28px; transform: rotate(0); }
  to { top: calc(100% - 20px); transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
