:root {
  color-scheme: light;
  --canvas: #f6f7fb;
  --surface: #fff;
  --ink: #1b2338;
  --quiet: #535e73;
  --stroke: #e0e4ee;
  --accent: #3d45c7;
  --accent-dark: #3038ae;
  --accent-tint: #f0f1ff;
  --night: #22254b;
  --error: #a52a39;
  --error-bg: #fff3f5;
  --radius: 17px;
  --font: Inter, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.55 var(--font);
}

a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: #dddcff;
  color: var(--ink);
}

.page-width {
  width: min(100% - 64px, 1112px);
  margin-inline: auto;
}

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

.skip-link:focus {
  position: fixed;
  z-index: 5;
  inset: 12px auto auto 12px;
  padding: 8px 12px;
  background: var(--surface);
}

.masthead {
  border-bottom: 1px solid var(--stroke);
  background: var(--surface);
}

.masthead-inner, .account-nav, .wordmark {
  display: flex;
  align-items: center;
}

.masthead-inner {
  min-height: 72px;
  justify-content: space-between;
  gap: 14px;
}

.wordmark {
  gap: 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.03em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}

.brand-mark::before {
  width: 17px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  content: "";
}

.brand-mark::after {
  position: absolute;
  top: 12px;
  left: 16px;
  width: 5px;
  height: 6px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  content: "";
}

.account-nav { gap: 12px; }

.account-nav a, .primary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

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

.login-link:hover, .login-link[aria-current] { background: var(--accent-tint); }

.register-link, .primary-button {
  background: var(--accent);
  color: #fff;
}

.register-link:hover, .primary-button:hover:not(:disabled) { background: var(--accent-dark); }

.main { flex: 1; }

.world { margin-top: 39px; }

.world-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.world-heading h1, .auth-card h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 47px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.06em;
}

.world-heading p, .tool-heading p, .member-heading p, .auth-card > p {
  margin: 7px 0 0;
  color: var(--quiet);
}

.sync {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.sync-status {
  max-width: 180px;
  font-size: 13px;
  text-align: right;
}

.sync-status.is-synced::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #27825c;
  content: "";
  vertical-align: .09em;
}

.text-button {
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 650;
  white-space: nowrap;
}

.text-button:hover, .back-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.clock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.clock-card {
  display: flex;
  min-height: 154px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 19px 15px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
}

.clock-card:first-child {
  border-color: var(--night);
  background: var(--night);
  color: #fff;
}

.clock-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.clock-city {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
}

.clock-offset {
  padding: 3px 7px;
  border-radius: 6px;
  background: #edf0f7;
  color: #475471;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.clock-card:first-child .clock-offset {
  background: #41466e;
  color: #f3f4ff;
}

.clock-time {
  display: block;
  margin-block: 5px 2px;
  font-size: clamp(29px, 5.5vw, 49px);
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  letter-spacing: -.07em;
  white-space: nowrap;
}

.clock-seconds {
  margin-left: .08em;
  color: var(--quiet);
  font-size: .52em;
  letter-spacing: -.04em;
}

.clock-date {
  color: var(--quiet);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.clock-card:first-child .clock-date, .clock-card:first-child .clock-seconds { color: #d7d9ed; }

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 27px;
  align-items: start;
}

.tool-card, .auth-card {
  padding: 22px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--surface);
}

.tool-heading { margin-bottom: 19px; }

.tool-heading h2, .member-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -.035em;
}

.tool-heading p, .member-heading p { font-size: 14px; }

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: block;
  min-width: 0;
  color: var(--quiet);
  font-size: 13px;
  font-weight: 650;
}

input, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid #cfd5e2;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

input:focus-visible, select:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}

.occurrence { margin-top: 12px; }

.tool-actions { margin-top: 15px; }

.result {
  display: grid;
  gap: 2px;
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-size: 14px;
}

.result strong {
  color: var(--ink);
  font-size: clamp(17px, 3vw, 22px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.result.is-error {
  background: var(--error-bg);
  color: var(--error);
}

.member-section { margin-top: 31px; }

.member-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 13px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.member-card {
  display: flex;
  min-height: 80px;
  justify-content: space-between;
  gap: 9px;
  padding: 13px 14px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #fdfdff;
  text-decoration: none;
}

.member-card:hover {
  border-color: #bec3ea;
  background: var(--accent-tint);
}

.member-card h3 {
  margin: 0 0 3px;
  color: #34405a;
  font-size: 14px;
  line-height: 1.4;
}

.member-card p {
  margin: 0;
  color: var(--quiet);
  font-size: 12px;
}

.lock-mark {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: #ecedf6;
  color: #516080;
}

.lock-mark::before, .lock-mark::after {
  position: absolute;
  border: 1.25px solid currentColor;
  content: "";
}

.lock-mark::before {
  top: 13px;
  left: 9px;
  width: 10px;
  height: 7px;
  border-radius: 2px;
}

.lock-mark::after {
  top: 8px;
  left: 11px;
  width: 6px;
  height: 6px;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.auth-view {
  width: min(100%, 440px);
  margin: 48px auto 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 13px;
  color: var(--quiet);
  font-size: 14px;
  text-decoration: none;
}

.auth-card { padding: 28px; }

.auth-card h1 {
  margin: 12px 0 0;
  font-size: clamp(28px, 5vw, 37px);
}

.auth-card form { margin-top: 23px; }

.auth-card .primary-button {
  width: 100%;
  margin-top: 15px;
}

.noscript-note { margin: 20px 0; }

.footer {
  display: flex;
  min-height: 69px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 37px;
  border-top: 1px solid var(--stroke);
  color: var(--quiet);
  font-size: 13px;
}

.footer a { text-decoration: none; }

@media (max-width: 760px) {
  .page-width { width: calc(100% - 36px); }
  .world { margin-top: 25px; }
  .clock-card { min-height: 140px; padding: 13px; }
  .clock-grid { gap: 9px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .page-width { width: calc(100% - 30px); }
  .masthead-inner { min-height: 61px; }
  .wordmark { gap: 7px; font-size: 18px; }
  .account-nav { gap: 3px; }
  .account-nav a { padding-inline: 8px; }
  .world-heading { align-items: flex-start; flex-direction: column; gap: 6px; margin-bottom: 12px; }
  .sync-status { max-width: initial; text-align: left; }
  .clock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clock-card { min-height: 117px; }
  .clock-card:first-child { grid-column: 1 / -1; min-height: 131px; }
  .clock-card:first-child .clock-time { font-size: 45px; }
  .tool-grid { margin-top: 18px; }
  .tool-card { padding: 15px; }
  .tool-heading { margin-bottom: 14px; }
  .fields { gap: 9px; }
  .member-section { margin-top: 23px; }
  .member-card { padding: 10px; }
  .member-card p { font-size: 12px; }
  .auth-view { margin-top: 24px; }
  .auth-card { padding: 19px; }
}
