:root {
  --theme_text-primary: #181d26;
  --theme_text-weak: rgba(4, 14, 32, 0.69);
  --theme_text-secondary-active: rgba(7, 12, 20, 0.82);
  --theme_surface-primary: #ffffff;
  --theme_surface-light: #f8fafc;
  --theme_brand-primary: #1b61c9;
  --theme_brand-link: #254fad;
  --theme_danger-text: #9f1239;
  --theme_danger-bg: #fff1f2;
  --theme_border-default: #e0e2e6;
  --theme_shadow-blue: rgba(0, 0, 0, 0.2) 0 0 1px,
    rgba(0, 0, 0, 0.06) 0 0 2px,
    rgba(45, 127, 249, 0.2) 0 1px 3px,
    rgba(0, 0, 0, 0.04) 0 0 0 0.5px inset;
  --theme_shadow-soft: rgba(15, 48, 106, 0.07) 0 16px 48px;
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --radius-sm: 4px;
  --radius-button: 12px;
  --radius-card: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--theme_text-primary);
  background:
    linear-gradient(180deg, #f8fafc 0%, #ffffff 52%, #f3f7fb 100%);
  font-family: var(--font-primary);
  letter-spacing: 0.08px;
}

button,
input {
  font: inherit;
  letter-spacing: 0.08px;
}

a {
  color: var(--theme_brand-link);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: var(--space-6);
  align-items: end;
  margin-bottom: var(--space-6);
}

.hero-copy {
  padding-bottom: var(--space-3);
}

.eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--theme_brand-primary);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.24px;
}

h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.intro {
  max-width: 620px;
  margin: var(--space-4) 0 0;
  color: var(--theme_text-weak);
  font-size: 18px;
  line-height: 1.6;
}

.search-panel,
.state-card,
.profile-card {
  background: var(--theme_surface-primary);
  border: 1px solid var(--theme_border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--theme_shadow-blue);
}

.search-panel {
  padding: var(--space-5);
}

label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--theme_text-secondary-active);
  font-size: 14px;
  font-weight: 700;
}

.search-row {
  display: flex;
  gap: var(--space-3);
}

input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--theme_border-default);
  border-radius: var(--radius-button);
  padding: 0 var(--space-4);
  color: var(--theme_text-primary);
  background: var(--theme_surface-light);
  outline: none;
}

input:focus {
  border-color: var(--theme_brand-primary);
  box-shadow: 0 0 0 3px rgba(27, 97, 201, 0.14);
  background: var(--theme_surface-primary);
}

button {
  min-height: 48px;
  min-width: 88px;
  border: 0;
  border-radius: var(--radius-button);
  padding: 0 var(--space-5);
  color: #ffffff;
  background: var(--theme_brand-primary);
  box-shadow: var(--theme_shadow-blue);
  cursor: pointer;
}

button:hover {
  background: #184fa6;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.helper {
  min-height: 20px;
  margin: var(--space-3) 0 0;
  color: var(--theme_text-weak);
  font-size: 14px;
  line-height: 1.4;
}

.result-area {
  display: grid;
  gap: var(--space-5);
}

.state-card {
  padding: var(--space-6);
  min-height: 164px;
  display: grid;
  align-content: center;
}

.state-card.alert {
  color: var(--theme_danger-text);
  background: var(--theme_danger-bg);
  border-color: #fecdd3;
}

.state-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.state-copy {
  margin: var(--space-2) 0 0;
  color: var(--theme_text-weak);
  font-size: 16px;
  line-height: 1.5;
}

.alert .state-copy {
  color: #9f1239;
}

.loader {
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-4);
  border: 3px solid #d7e5fb;
  border-top-color: var(--theme_brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.profile-card {
  overflow: hidden;
  box-shadow: var(--theme_shadow-soft);
}

.profile-header {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-6);
  border-bottom: 1px solid var(--theme_border-default);
}

#avatar {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid var(--theme_border-default);
  background: var(--theme_surface-light);
}

.identity {
  min-width: 0;
}

.display-name {
  margin: 0 0 var(--space-1);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#profile-link {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.time-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1px;
  background: var(--theme_border-default);
}

.time-item {
  min-width: 0;
  padding: var(--space-5);
  background: var(--theme_surface-primary);
}

.time-item.highlight {
  background: #f0f6ff;
}

.time-item span,
dt {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--theme_text-weak);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.time-item strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: var(--space-5) var(--space-6);
  gap: var(--space-4);
}

.stats-grid div {
  min-width: 0;
}

dd {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.is-hidden {
  display: none;
}

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

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 24px, 1120px);
    padding: var(--space-6) 0;
  }

  h1 {
    font-size: 36px;
  }

  .search-panel,
  .state-card,
  .profile-header,
  .time-item,
  .stats-grid {
    padding: var(--space-4);
  }

  .search-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .profile-header {
    align-items: flex-start;
  }

  #avatar {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

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