/* 序列号查询页 — Apple 官网级极简认证风格 */

:root {
  --lookup-bg: #0b0b0f;
  --lookup-title: #f5f5f7;
  --lookup-subtitle: #cfcfcf;
  --lookup-text: #f5f5f7;
  --lookup-muted: rgba(245, 245, 247, 0.52);
  --lookup-muted-soft: rgba(245, 245, 247, 0.38);
  --lookup-border: rgba(255, 255, 255, 0.08);
  --lookup-glass: rgba(255, 255, 255, 0.04);
  --lookup-card: rgba(22, 22, 26, 0.72);
  --lookup-card-inner: rgba(255, 255, 255, 0.03);
  --lookup-primary: #0071e3;
  --lookup-primary-hover: #0077ed;
  --lookup-primary-active: #006edb;
  --lookup-focus-ring: rgba(0, 113, 227, 0.28);
  --lookup-shadow-card:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.32);
  --lookup-shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.18);
  --lookup-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --lookup-ease-slow: cubic-bezier(0.16, 1, 0.3, 1);
}

.lookup-page {
  margin: 0;
  min-height: 100vh;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "SF Pro Display",
    "Segoe UI",
    "PingFang SC",
    "Helvetica Neue",
    sans-serif;
  background: var(--lookup-bg);
  color: var(--lookup-text);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.lookup-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* —— 语言栏 —— */
.lookup-lang-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
  opacity: 0;
  animation: lookupFadeUp 1.2s var(--lookup-ease-slow) 0.05s forwards;
}

.lookup-lang-toolbar-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.lookup-lang-toolbar label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--lookup-muted-soft);
  margin-bottom: 8px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.lookup-lang-select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--lookup-border);
  font-size: clamp(11px, 3.4vw, 15px);
  font-weight: 500;
  line-height: 1.2;
  background: var(--lookup-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--lookup-text);
  color-scheme: dark;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-text-size-adjust: 100%;
  transition: border-color 0.2s var(--lookup-ease), box-shadow 0.2s var(--lookup-ease);
}

.lookup-lang-select option {
  color: #1d1d1f;
  background-color: #ffffff;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}

.lookup-lang-select option:checked,
.lookup-lang-select option:hover {
  color: #1d1d1f;
  background-color: #e8e8ed;
}

.lookup-lang-select:focus {
  outline: none;
  border-color: rgba(0, 113, 227, 0.4);
  box-shadow: 0 0 0 3px var(--lookup-focus-ring);
}

.lookup-lang-hint {
  font-size: 12px;
  color: var(--lookup-muted-soft);
  margin: 6px 0 0;
}

.lookup-lang-loading {
  font-size: 12px;
  color: var(--lookup-primary);
  margin-top: 6px;
  display: none;
}

.lookup-lang-loading.show {
  display: block;
}

.lookup-lang-current {
  display: none;
}

/* —— 品牌标题区 —— */
.lookup-brand-hero {
  position: relative;
  margin: 10px 10px 24px 0;
  text-align: center;
  overflow: visible;
}

.lookup-brand-glass {
  position: relative;
  padding: 36px 20px 32px;
  border-radius: 18px;
  background: var(--lookup-glass);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border: 1px solid var(--lookup-border);
  box-shadow: var(--lookup-shadow-card);
  overflow: hidden;
}

.lookup-brand-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.lookup-brand-kicker,
.lookup-brand-title {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-size: clamp(18px, 5.2vw, 26px);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.25;
  text-transform: uppercase;
  text-align: center;
  color: var(--lookup-title);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.lookup-brand-kicker {
  margin-bottom: 10px;
  opacity: 0;
  animation: lookupBrandLineIn 1.4s var(--lookup-ease-slow) 0.15s forwards;
}

.lookup-brand-title {
  margin-bottom: 12px;
  opacity: 0;
  animation: lookupBrandLineIn 1.5s var(--lookup-ease-slow) 0.28s forwards;
}

.lookup-brand-subtitle {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-align: center;
  color: var(--lookup-subtitle);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  opacity: 0;
  animation: lookupBrandLineIn 1.6s var(--lookup-ease-slow) 0.42s forwards;
}

.lookup-brand-domain {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 14px 0 0;
  padding: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.42);
  white-space: normal;
  overflow: visible;
  opacity: 0;
  animation: lookupBrandLineIn 1.7s var(--lookup-ease-slow) 0.52s forwards;
}

/* 中日韩等：取消大写/过大字距，避免译文视觉大小不一致 */
html:lang(zh) .lookup-brand-kicker,
html:lang(zh) .lookup-brand-title,
html:lang(zh) .lookup-brand-subtitle,
html:lang(zh) .verify-card__title,
html:lang(ja) .lookup-brand-kicker,
html:lang(ja) .lookup-brand-title,
html:lang(ja) .lookup-brand-subtitle,
html:lang(ja) .verify-card__title,
html:lang(ko) .lookup-brand-kicker,
html:lang(ko) .lookup-brand-title,
html:lang(ko) .lookup-brand-subtitle,
html:lang(ko) .verify-card__title {
  letter-spacing: 0;
  text-transform: none;
  word-break: normal;
  hyphens: manual;
}

@keyframes lookupBrandLineIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lookupFadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— 验证卡片 —— */
.verify-card {
  background: var(--lookup-card);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border-radius: 18px;
  padding: 28px 20px 26px;
  border: 1px solid var(--lookup-border);
  box-shadow: var(--lookup-shadow-card);
  text-align: center;
  overflow: hidden;
  opacity: 0;
  animation: lookupFadeUp 1.4s var(--lookup-ease-slow) 0.55s forwards;
}

.verify-card__title {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 6px;
  padding: 0 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-align: center;
  color: var(--lookup-title);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.verify-card__hint {
  text-align: center;
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--lookup-muted);
  letter-spacing: -0.01em;
}

.serial-search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
}

.serial-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.serial-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  border: 1px solid var(--lookup-border);
  background: var(--lookup-card-inner);
  transition:
    border-color 0.2s var(--lookup-ease),
    box-shadow 0.2s var(--lookup-ease),
    background-color 0.2s var(--lookup-ease);
}

.serial-input-wrap:focus-within {
  border-color: rgba(0, 113, 227, 0.45);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px var(--lookup-focus-ring);
}

.serial-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 14px 10px 14px 14px;
  border: none;
  border-radius: 12px 0 0 12px;
  background: transparent;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--lookup-text);
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.serial-input:focus {
  outline: none;
}

.serial-input::placeholder {
  color: rgba(245, 245, 247, 0.36);
  letter-spacing: 0;
  font-size: clamp(11px, 3vw, 14px);
  line-height: 1.25;
  opacity: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-scan {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  padding: 0;
  border: none;
  border-left: 1px solid var(--lookup-border);
  border-radius: 0 12px 12px 0;
  background: transparent;
  color: var(--lookup-primary);
  cursor: pointer;
  transition: background-color 0.2s var(--lookup-ease);
  -webkit-tap-highlight-color: transparent;
}

.btn-scan:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-scan:active {
  background: rgba(255, 255, 255, 0.1);
}

.btn-scan:focus-visible {
  outline: 2px solid var(--lookup-primary);
  outline-offset: -2px;
}

.btn-scan svg {
  width: 22px;
  height: 22px;
  display: block;
}

.btn-serial {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: var(--lookup-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--lookup-shadow-btn);
  transition: background-color 0.2s var(--lookup-ease);
  -webkit-tap-highlight-color: transparent;
}

.btn-serial:hover {
  background: var(--lookup-primary-hover);
}

.btn-serial:active {
  background: var(--lookup-primary-active);
}

.btn-serial:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-serial:focus-visible {
  outline: 2px solid var(--lookup-primary);
  outline-offset: 2px;
}

[dir="rtl"] .lookup-lang-toolbar {
  flex-direction: row-reverse;
}

[dir="rtl"] .serial-input {
  border-radius: 0 12px 12px 0;
  padding: 14px 14px 14px 10px;
}

[dir="rtl"] .btn-scan {
  border-left: none;
  border-right: 1px solid var(--lookup-border);
  border-radius: 12px 0 0 12px;
}

@media (min-width: 520px) {
  .lookup-brand-glass {
    padding: 42px 28px 36px;
  }

  .lookup-brand-kicker,
  .lookup-brand-title {
    font-size: 26px;
    letter-spacing: 0.05em;
  }

  .lookup-brand-kicker {
    margin-bottom: 12px;
  }

  .lookup-brand-title {
    margin-bottom: 14px;
  }

  .lookup-brand-subtitle {
    font-size: 13px;
    max-width: 100%;
  }

  .lookup-brand-domain {
    font-size: 11px;
    margin-top: 16px;
    letter-spacing: 0.12em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lookup-lang-toolbar,
  .lookup-brand-kicker,
  .lookup-brand-title,
  .lookup-brand-subtitle,
  .lookup-brand-domain,
  .verify-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .serial-input-wrap,
  .btn-serial,
  .btn-scan,
  .lookup-lang-select {
    transition: none;
  }
}
