/* ==========================================================================
   UGLOOM 计算器 - 全站样式
   亮色/暗色主题由 html[data-theme] 控制，颜色通过 CSS 变量统一管理。
   ========================================================================== */

:root {
  --bg: #fbfbfd;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --primary: #0066cc;
  --primary-soft: #e8f3ff;
  --primary-strong: #005bb5;
  --surface-2: #f5f5f7;
  --input-bg: #ffffff;
  --border: #d2d2d7;
  --danger: #d70015;
  --danger-soft: rgba(215, 0, 21, 0.08);
  --button-bg: #0071e3;
  --button-hover: #0077ed;
  --button-text: #ffffff;
  --accent: #bf4800;
  --accent-soft: #fff1e6;
  --header-bg: rgba(251, 251, 253, 0.8);
  --footer-bg: #f5f5f7;
  --footer-text: #1d1d1f;
  --footer-muted: #6e6e73;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --radius: 22px;
  --radius-sm: 12px;
  --container: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #000000;
  --card: #1d1d1f;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --primary: #2997ff;
  --primary-soft: rgba(41, 151, 255, 0.14);
  --primary-strong: #6bb6ff;
  --surface-2: #161617;
  --input-bg: #1d1d1f;
  --border: #333336;
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --button-bg: #0071e3;
  --button-hover: #0077ed;
  --button-text: #ffffff;
  --accent: #ff9f0a;
  --accent-soft: rgba(255, 159, 10, 0.14);
  --header-bg: rgba(0, 0, 0, 0.72);
  --footer-bg: #161617;
  --footer-text: #f5f5f7;
  --footer-muted: #a1a1a6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-strong);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--primary-soft);
  color: var(--text);
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 0 0 8px 8px;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
  color: var(--button-text);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--button-bg);
  color: var(--button-text);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--primary);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.theme-icon {
  width: 17px;
  height: 17px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--button-bg);
  color: var(--button-text);
}

.btn-primary:hover {
  background: var(--button-hover);
  color: var(--button-text);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 48px 0 32px;
  background:
    radial-gradient(circle at 12% 8%, var(--primary-soft), transparent 42%),
    var(--bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.3rem, 8vw, 3.6rem);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.hero-subtitle {
  margin-top: 14px;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 600;
  color: var(--text);
}

.hero-text {
  max-width: 58ch;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-panel {
  display: none;
}

.mock-card {
  position: relative;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.mock-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 21px;
  background: linear-gradient(135deg, var(--primary-soft), transparent 60%);
}

.mock-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.mock-value {
  display: block;
  margin: 8px 0 18px;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mock-value small {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.mock-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 58px;
  margin-bottom: 18px;
}

.mock-bar {
  display: block;
  width: 32%;
  border-radius: 6px 6px 2px 2px;
  background: var(--primary-soft);
}

.mock-bar-1 {
  height: 100%;
  background: var(--primary);
}

.mock-bar-2 {
  height: 62%;
}

.mock-bar-3 {
  height: 78%;
}

.mock-rows {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.mock-rows span:nth-child(even) {
  font-family: var(--font-mono);
  color: var(--text);
  text-align: right;
}

.mock-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Shared section headings
   -------------------------------------------------------------------------- */

.tools-section,
.why-section,
.soon-section {
  padding: 72px 0;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 720;
}

.section-heading p {
  margin-top: 8px;
  max-width: 62ch;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Homepage tools: search, chips, cards
   -------------------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 18px;
}

.search-field {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 16px 11px 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
}

.search-field input::placeholder {
  color: var(--muted);
}

.search-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 38px;
  padding: 7px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.search-status {
  min-height: 1.5em;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.no-results {
  margin-bottom: 16px;
  padding: 26px 18px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

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

.tool-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.tool-icon {
  width: 23px;
  height: 23px;
}

.tool-category {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.tool-name {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tool-desc {
  flex: 1;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.tool-arrow {
  margin-top: 16px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Why + coming soon
   -------------------------------------------------------------------------- */

.why-section {
  background: var(--surface-2);
}

.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.why-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.why-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.why-icon svg {
  width: 20px;
  height: 20px;
}

.why-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.why-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.soon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.soon-list li {
  padding: 9px 16px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 40px;
  padding: 38px 0 22px;
  border-top: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.footer-title {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.footer-about p,
.footer-notes p {
  line-height: 1.8;
}

.footer-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-notes strong {
  color: var(--text);
  font-weight: 600;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.footer-bottom a {
  color: var(--muted);
}

.footer-bottom a:hover {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   Tool pages
   -------------------------------------------------------------------------- */

.tool-page {
  max-width: 960px;
  padding-top: 22px;
  padding-bottom: 12px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--border);
}

.tool-header {
  margin: 20px 0 26px;
}

.tool-header h1 {
  font-size: clamp(2rem, 5vw, 2.7rem);
  font-weight: 750;
}

.tool-intro {
  max-width: 72ch;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.85;
}

.calculator,
.prose-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.calculator > h2,
.prose-card > h2,
.faq > h2,
.related > h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 720;
}

.calculator > h2 {
  margin-bottom: 18px;
}

.calc-form {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 600;
}

.required {
  color: var(--danger);
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}

.field input[type="number"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.field input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.form-actions-split {
  justify-content: space-between;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--primary);
}

.form-error {
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9rem;
}

.result {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.result-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.result-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.result-primary {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.result-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.result-footnote {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap h3 {
  margin-bottom: 10px;
  font-size: 0.98rem;
  font-weight: 700;
}

.table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table-wrap th,
.table-wrap td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.table-wrap th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.table-wrap td {
  font-variant-numeric: tabular-nums;
}

.table-wrap td:not(:first-child) {
  font-family: var(--font-mono);
}

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

.table-wrap tr.is-target td {
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 600;
}

.calc-subsection + .calc-subsection {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.calc-subsection h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.subsection-intro {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.prose-card {
  margin-top: 22px;
}

.prose-card > h2 {
  margin-bottom: 14px;
}

.prose-card p {
  margin-bottom: 12px;
  line-height: 1.88;
}

.prose-card p:last-child {
  margin-bottom: 0;
}

.faq {
  margin-top: 32px;
}

.faq > h2 {
  margin-bottom: 16px;
}

.faq-item {
  margin-bottom: 10px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.faq-item summary {
  position: relative;
  padding: 15px 30px 15px 0;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding-bottom: 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.85;
}

.faq-answer p {
  margin: 0;
}

.related {
  margin-top: 32px;
}

.related > h2 {
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.related-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.related-name {
  font-size: 0.98rem;
  font-weight: 700;
}

.related-desc {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.page-meta {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

.last-updated {
  margin-bottom: 6px;
}

.disclaimer {
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.error-page {
  padding-top: 56px;
  padding-bottom: 24px;
}

.error-page h1 {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 760;
}

.error-text {
  max-width: 60ch;
  margin-top: 12px;
  color: var(--muted);
}

.error-page .form-actions {
  margin-top: 22px;
}

.popular-tools {
  margin-top: 40px;
}

.popular-tools h2 {
  margin-bottom: 16px;
  font-size: 1.35rem;
}

/* --------------------------------------------------------------------------
   Apple-style refresh（2026-11）
   黑白灰 + 苹果蓝，大留白、毛玻璃导航、克制圆角与阴影。
   -------------------------------------------------------------------------- */

body {
  background: var(--bg);
}

/* ---- Navigation ---- */

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: none;
}

.header-inner {
  gap: 24px;
  min-height: 52px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.brand {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.site-nav {
  gap: 22px;
}

.site-nav a {
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: none;
}

.theme-toggle {
  min-height: 30px;
  padding: 3px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  box-shadow: none;
}

.theme-toggle:hover {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

/* ---- Buttons ---- */

.btn-primary,
.btn-ghost {
  border-radius: 980px;
  font-weight: 500;
}

.btn-primary {
  background: var(--button-bg);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--button-hover);
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

/* ---- Hero ---- */

.hero {
  padding: 72px 0 48px;
  background: var(--bg);
  border-bottom: 0;
}

.hero-inner {
  gap: 56px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0;
}

.eyebrow::before {
  display: none;
}

.hero h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 5.6vw, 3.9rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.hero-subtitle {
  margin-top: 14px;
  color: var(--text);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 500;
}

.hero-text {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-actions {
  gap: 16px;
  margin-top: 30px;
}

/* ---- Product mock card ---- */

.mock-card {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.mock-card::before {
  display: none;
}

.mock-label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.mock-value {
  color: var(--text);
  font-size: clamp(1.9rem, 3.4vw, 2.3rem);
  font-weight: 600;
}

.mock-bar {
  background: var(--surface-2);
}

.mock-bar-1 {
  background: linear-gradient(180deg, #5ac8fa, #0071e3);
}

.mock-bar-2 {
  background: #b9dcff;
}

.mock-bar-3 {
  background: #7ab8f5;
}

/* ---- Section headings ---- */

.section-heading {
  margin-bottom: 40px;
  text-align: center;
}

.section-heading h2 {
  display: block;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.section-heading h2::before {
  display: none;
}

.section-heading p {
  margin: 12px auto 0;
  color: var(--muted);
}

/* ---- Tools ---- */

.tools-section {
  padding: 72px 0;
}

.search-field input {
  border-color: transparent;
  border-radius: 12px;
  background: var(--surface-2);
  box-shadow: none;
}

.search-field input:focus {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.chip {
  border-color: transparent;
  background: var(--surface-2);
  font-weight: 400;
}

.chip:hover {
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.chip.is-active:hover {
  background: var(--text);
  box-shadow: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
}

.chip-count {
  font-size: 0.76em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: 0.5;
}

.chip.is-active .chip-count {
  opacity: 0.72;
}

.chip.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
}

.tool-grid {
  gap: 20px;
}

.tool-card {
  padding: 26px;
  overflow: visible;
  border-color: var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.tool-card::before {
  display: none;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.tool-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}

.tool-name {
  font-size: 1.12rem;
  font-weight: 600;
}

.tool-category {
  background: var(--surface-2);
  color: var(--muted);
}

.tool-arrow {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 18px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 500;
}

.tool-card:hover .tool-arrow {
  background: none;
  color: var(--primary-strong);
  text-decoration: underline;
}

.tool-card-more {
  border-color: transparent;
  background: var(--surface-2);
  box-shadow: none;
}

.tool-card-more .tool-icon-wrap,
.tool-card-more .tool-category {
  background: var(--card);
}

.tool-card-more .tool-icon-wrap,
.tool-card-more .tool-arrow {
  color: var(--muted);
}

.tool-card-more:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.tool-card-more:hover .tool-arrow {
  color: var(--text);
  text-decoration: none;
}

/* ---- Why + soon ---- */

.why-section {
  padding: 72px 0;
  background: var(--surface-2);
}

.why-card {
  padding: 28px;
  border-color: transparent;
  background: var(--card);
  box-shadow: none;
}

.why-icon {
  background: var(--surface-2);
  color: var(--primary);
}

.soon-list li {
  border: 1px solid transparent;
  background: var(--surface-2);
}

/* ---- Footer ---- */

.site-footer {
  position: static;
  margin-top: 0;
  padding: 48px 0 28px;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer::before {
  display: none;
}

.footer-title {
  color: var(--footer-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.footer-notes strong {
  color: var(--footer-text);
}

.footer-about p,
.footer-notes p {
  color: var(--muted);
}

.footer-bottom {
  border-top-color: var(--border);
}

.footer-bottom a {
  color: var(--muted);
}

.footer-bottom a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---- Tool pages ---- */

.tool-page {
  padding-top: 32px;
}

.tool-header h1 {
  font-weight: 600;
  letter-spacing: -0.03em;
}

.tool-intro {
  font-size: 1.02rem;
}

.calculator,
.prose-card {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}

.calculator {
  overflow: visible;
}

.calculator::before {
  display: none;
}

.field input,
.field select {
  border-color: transparent;
  border-radius: 12px;
  background: var(--surface-2);
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.result {
  border-color: transparent;
  border-radius: 16px;
  background: var(--surface-2);
}

.result-item {
  border-color: var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: none;
}

.result-primary {
  color: var(--text);
}

.faq-item {
  border-color: var(--border);
  background: var(--card);
  box-shadow: none;
  transition: none;
}

.faq-item:hover {
  border-color: var(--border);
  box-shadow: none;
}

.related-card {
  border-color: var(--border);
  background: var(--card);
  transition: border-color 0.2s ease;
}

.related-card:hover {
  transform: none;
  border-color: var(--primary);
  box-shadow: none;
}

/* ---- Dark theme ---- */

[data-theme="dark"] .site-header {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .mock-card {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .mock-bar-2 {
  background: rgba(122, 162, 255, 0.3);
}

[data-theme="dark"] .mock-bar-3 {
  background: rgba(122, 162, 255, 0.5);
}

[data-theme="dark"] .tool-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
  .container {
    padding-left: 24px;
    padding-right: 24px;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calculator,
  .prose-card {
    padding: 26px;
  }

  .hero {
    padding: 96px 0 64px;
  }
}

@media (min-width: 800px) {
  .toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
  }

  .search-field {
    max-width: 420px;
  }

  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1fr 1.4fr;
    gap: 32px;
  }
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 48px;
  }

  .hero-panel {
    display: block;
  }

  .why-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tools-section,
  .why-section,
  .soon-section {
    padding: 96px 0;
  }
}

@media (min-width: 1000px) {
  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-nav {
    display: none;
  }

  .theme-text {
    display: none;
  }

  .header-inner {
    min-height: 52px;
  }

  .hero {
    padding: 40px 0 28px;
  }

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

  .hero-actions .btn-primary,
  .hero-actions .btn-ghost {
    width: 100%;
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: 0 0 auto;
  }

  .section-heading {
    margin-bottom: 28px;
  }

  .tools-section,
  .why-section,
  .soon-section {
    padding: 56px 0;
  }

  .tool-card {
    padding: 22px;
  }

  .site-footer {
    padding: 36px 0 22px;
  }

  .calculator,
  .prose-card {
    padding: 18px;
  }

  .result {
    padding: 14px;
  }

  .result-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .form-actions-split {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (hover: none) {
  .tool-card:hover {
    transform: none;
    box-shadow: none;
  }

  .related-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Homepage quick calculator / language switch / Uyghur RTL (2026-11-28)
   -------------------------------------------------------------------------- */

.lang-switch {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.lang-switch:hover {
  color: var(--text);
  background: var(--surface-2);
}

.quick-card {
  width: 100%;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.quick-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-badge {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
}

.quick-link {
  color: var(--primary);
  font-size: 0.78rem;
  text-decoration: none;
}

.quick-link:hover {
  text-decoration: underline;
}

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

.quick-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.quick-field input,
.quick-field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
}

.quick-field input:focus,
.quick-field select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.quick-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.quick-result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.quick-result-item span {
  color: var(--muted);
  font-size: 0.72rem;
}

.quick-result-item strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .quick-result {
    grid-template-columns: 1fr;
  }
}

/* Uyghur typography */
html[lang="ug"] {
  font-family: "Microsoft Uighur", "Noto Naskh Arabic", "Scheherazade New",
    "Segoe UI", Tahoma, sans-serif;
}

html[lang="ug"] body {
  font-family: "Microsoft Uighur", "Noto Naskh Arabic", "Scheherazade New",
    "Segoe UI", Tahoma, sans-serif;
  line-height: 1.9;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

html[lang="ug"] h1,
html[lang="ug"] h2,
html[lang="ug"] h3 {
  letter-spacing: 0;
  line-height: 1.35;
}

/* RTL mirroring */
[dir="rtl"] .brand {
  margin-right: 0;
  margin-left: auto;
}

[dir="rtl"] .skip-link {
  right: 16px;
  left: auto;
}

[dir="rtl"] .search-icon {
  right: 15px;
  left: auto;
}

[dir="rtl"] .search-field input {
  padding-right: 44px;
  padding-left: 16px;
}

[dir="rtl"] .faq-item summary {
  padding-right: 0;
  padding-left: 30px;
}

[dir="rtl"] .faq-item summary::after {
  right: auto;
  left: 0;
}

[dir="rtl"] .table-wrap th,
[dir="rtl"] .table-wrap td {
  text-align: right;
}

[dir="rtl"] .tool-arrow {
  align-self: flex-start;
}

[dir="rtl"] .quick-head,
[dir="rtl"] .header-inner,
[dir="rtl"] .toolbar,
[dir="rtl"] .footer-bottom {
  direction: rtl;
}

/* Alarm clock */
.alarm-status {
  margin-top: 16px;
  color: var(--muted);
  font-weight: 600;
}

.alarm-status.is-on {
  color: var(--primary);
}

.alarm-countdown {
  margin-top: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.alarm-ring {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--primary);
  border-radius: 16px;
  background: var(--primary-soft);
  text-align: center;
}

.alarm-ring-title {
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 700;
}

.alarm-ring-label {
  margin-top: 6px;
  color: var(--text);
}

.alarm-ring .form-actions {
  justify-content: center;
  margin-top: 14px;
}

@media (min-width: 1000px) {
  .tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Desktop toolbar: search on its own row, chips below */
@media (min-width: 800px) {
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .search-field {
    max-width: 420px;
  }
}

/* Quick result as label/value rows so long amounts never wrap the unit */
.quick-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-result-item {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.quick-result-item strong {
  font-size: 0.98rem;
  white-space: nowrap;
}

/* Uyghur hero headline: keep the long word on one line */
html[lang="ug"] .hero h1 {
  max-width: 18ch;
  font-size: clamp(2.2rem, 4.6vw, 3.2rem);
  line-height: 1.2;
}

/* Homepage starts with the calculator, no marketing hero */
.home-quick {
  padding: 32px 0 8px;
}

.quick-card-wide {
  max-width: 880px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.home-quick + .tools-section {
  padding-top: 48px;
}

.tools-section .section-heading {
  margin-bottom: 28px;
}

@media (min-width: 720px) {
  .quick-card-wide {
    padding: 28px 30px;
  }

  .quick-card-wide .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .quick-card-wide .quick-result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 640px) {
  .home-quick {
    padding: 20px 0 4px;
  }
}

/* Footer internal links */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Image compressor */
.img-drop {
  padding: 28px 20px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: var(--surface-2);
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.img-drop.is-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.img-drop-title {
  margin-bottom: 6px;
  font-weight: 600;
}

.img-selected {
  margin-top: 10px;
  color: var(--primary);
  font-size: 0.85rem;
}

.img-options {
  margin-top: 20px;
}

.img-options input[type="range"] {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
}

.img-progress {
  margin-top: 14px;
  color: var(--muted);
}

.img-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.img-result {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.img-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  background: var(--surface-2);
  object-fit: cover;
}

.img-info {
  min-width: 0;
}

.img-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.img-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.img-download {
  display: inline-block;
  margin-top: 8px;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.img-download:hover {
  text-decoration: underline;
}

.img-warning {
  margin-top: 6px;
  color: var(--danger);
  font-size: 0.78rem;
}

@media (min-width: 720px) {
  .img-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .img-result {
    flex-direction: column;
  }

  .img-thumb {
    width: 100%;
    height: 160px;
  }
}

/* Next-step tools inside the calculator card */
.next-tools {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.next-tools-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.next-tools-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.next-tools-links a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.82rem;
  text-decoration: none;
}

.next-tools-links a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Text/office tools */
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: vertical;
  unicode-bidi: plaintext;
}

.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--primary);
}

.result-item-wide {
  grid-column: 1 / -1;
}

.result-textarea {
  width: 100%;
  min-height: 170px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  resize: vertical;
  unicode-bidi: plaintext;
}

/* US test identity generator */
.identity-notice {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.7;
}

.identity-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.identity-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.identity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.identity-head strong {
  font-size: 1.05rem;
}

.identity-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
}

.identity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.82rem;
}

.identity-key {
  color: var(--muted);
}

.identity-value {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  text-align: end;
}

.identity-copy {
  margin-top: 10px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
}

.identity-copy:hover {
  border-color: var(--primary);
  color: var(--primary);
}

@media (min-width: 720px) {
  .identity-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* QR code result */
.qr-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}

.qr-result img {
  width: min(280px, 100%);
  height: auto;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
}

/* Popular tools */
.popular-section { padding: 36px 0 4px; }

.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  max-width: 960px;
  margin: 0 auto;
  gap: 12px;
}

.popular-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}

.popular-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.popular-name {
  font-weight: 600;
  font-size: 15px;
}

.popular-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .popular-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .popular-card {
    padding: 12px 13px;
  }

  .popular-desc {
    font-size: 12px;
  }
}

/* Math formula library */
.formula-intro { margin-bottom: 16px; }
.formula-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.formula-search { flex: 1 1 300px; min-height: 46px; padding: 10px 14px; border: 1px solid transparent; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 1rem; }
.formula-search:focus { outline: none; border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12); }
.formula-status { margin: 0; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.formula-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.formula-toc a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.86rem; text-decoration: none; }
.formula-toc a:hover { color: var(--text); }
.formula-toc span { opacity: 0.55; font-size: 0.9em; font-variant-numeric: tabular-nums; }
.formula-empty { margin: 18px 0 0; color: var(--muted); }
.formula-group { margin-top: 30px; }
.formula-group > h3 { margin-bottom: 10px; font-size: 1.12rem; font-weight: 650; }
.formula-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; list-style: none; margin: 0; padding: 0; }
.formula-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.formula-name { display: block; font-size: 0.95rem; font-weight: 600; }
.formula-expr { display: block; margin-top: 3px; color: var(--muted); font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.7; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .formula-list { grid-template-columns: 1fr; gap: 0; }
  .formula-toolbar { align-items: stretch; }
  .formula-search { flex-basis: 100%; }
}

/* Legal pages */
.legal-page {
  max-width: 820px;
  padding-top: 8px;
}

.legal-header {
  margin-bottom: 18px;
}

.legal-meta {
  color: var(--muted);
  font-size: 13px;
}

.legal-note {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.legal-content h2 {
  font-size: 18px;
  margin: 26px 0 8px;
}

.legal-content p,
.legal-content li {
  line-height: 1.8;
}

.legal-content ul {
  padding-left: 20px;
}

.legal-content a {
  color: var(--primary);
}

.contact-form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-size: 14px;
  color: var(--muted);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-privacy {
  color: var(--muted);
  font-size: 13px;
}

.form-actions button {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.form-actions button:hover {
  background: var(--button-hover);
}

.form-status {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 14px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 10px;
  padding-bottom: 14px;
  border-top: 1px solid var(--border);
}

.footer-legal a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.footer-legal a:hover {
  color: var(--primary);
}

/* Image tools */
.image-upload {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.image-upload label {
  font-size: 14px;
  color: var(--muted);
}

.image-stage {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-2);
  min-height: 120px;
}

.image-stage img,
.image-stage canvas {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Reference pages */
.reference-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
  margin: 12px 0;
}

.element-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.element-table th,
.element-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.element-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}

.table-caption {
  color: var(--muted);
  font-size: 13px;
}
