/* ============================================================
   纺织工具箱 · 暖色纺织风
   深色渐变标题栏 + 米色底 + 砖红/墨绿点缀 + 深色页脚
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f3efe7;
  --surface: #fffcf7;
  --surface-2: #f5eee2;
  --ink: #1a211f;
  --ink-2: #3d4742;
  --muted: #7c7f78;
  --line: rgba(26, 33, 31, 0.1);
  --line-strong: rgba(26, 33, 31, 0.18);
  --accent: #a77c45;
  --accent-2: #c9a66b;
  --accent-soft: #f3e8d6;
  --teal: #33594f;
  --teal-soft: #e7eee9;
  --blue: #3b5d6b;
  --blue-soft: #e7eef0;
  --good: #3f6b52;
  --good-soft: #e6eee6;
  --best-soft: #e6b4c7;
  --pink: #7e2247;
  --navy: #131c22;
  --shadow-card: 0 10px 30px rgba(45, 38, 28, 0.07);
  --shadow-lift: 0 18px 40px rgba(18, 24, 26, 0.22);
  --radius: 18px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101413;
    --surface: #181e1c;
    --surface-2: #131817;
    --ink: #efe9df;
    --ink-2: #c8cfc8;
    --muted: #8e988f;
    --line: rgba(239, 233, 223, 0.1);
    --line-strong: rgba(239, 233, 223, 0.18);
    --accent: #d8b07a;
    --accent-2: #ecd0a4;
    --accent-soft: rgba(216, 176, 122, 0.14);
    --teal: #8fb9a9;
    --teal-soft: rgba(143, 185, 169, 0.14);
    --blue: #8fb2c2;
    --blue-soft: rgba(143, 178, 194, 0.14);
    --good: #7fbf9e;
    --good-soft: rgba(127, 191, 158, 0.14);
    --best-soft: rgba(255, 150, 180, 0.28);
    --pink: #ffb3cd;
    --navy: #0c1110;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.55);
  }
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 50% -16%, rgba(255, 253, 247, 0.92), transparent 62%),
    radial-gradient(820px 520px at 108% 106%, rgba(167, 124, 69, 0.08), transparent 62%),
    repeating-linear-gradient(135deg, rgba(26, 33, 31, 0.018) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(45deg, rgba(26, 33, 31, 0.012) 0 1px, transparent 1px 11px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(1100px 620px at 50% -16%, rgba(216, 176, 122, 0.06), transparent 62%),
      radial-gradient(820px 520px at 108% 106%, rgba(143, 185, 169, 0.05), transparent 62%),
      repeating-linear-gradient(135deg, rgba(239, 233, 223, 0.014) 0 1px, transparent 1px 9px);
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(1000px 540px at -10% -12%, rgba(122, 62, 26, 0.35) 0%, transparent 58%),
      radial-gradient(900px 520px at 110% 0%, rgba(22, 84, 78, 0.3) 0%, transparent 52%);
  }
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select {
  font-family: inherit;
}

button {
  -webkit-appearance: none;
  appearance: none;
}

::selection {
  background: rgba(167, 124, 69, 0.22);
}

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 14px;
}

.view {
  animation: view-in 0.24s ease;
}

.view[data-view="home"] {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ============================== 标题栏 ============================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  color: #fff;
  background:
    radial-gradient(130% 170% at 100% 0%, rgba(201, 166, 107, 0.12), transparent 56%),
    linear-gradient(158deg, #10181e 0%, #16232a 58%, #1a2a2b 100%);
  box-shadow: 0 12px 30px rgba(12, 18, 20, 0.22);
}

.topbar::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(201, 166, 107, 0.5), transparent);
  pointer-events: none;
}

.home-header {
  margin: 0 -14px 0;
  padding: calc(14px + env(safe-area-inset-top)) 18px 16px;
  border-radius: 26px 26px 0 0;
}

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

.home-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.install-top {
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #c26222, #e09a55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: 0 5px 12px rgba(194, 98, 34, 0.28);
  cursor: pointer;
}

.install-top:active {
  transform: scale(0.96);
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  overflow: hidden;
  background: #1f8fd6;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-title h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
}

.home-title p {
  margin: 1px 0 0;
  font-size: 11.5px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.66);
  letter-spacing: 0.06em;
}

.version-inline {
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.version-inline:hover {
  color: #fff;
}

.icon-btn {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  transition: background 0.15s ease;
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.26);
}

.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -14px 0;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-radius: 22px 22px 0 0;
}

.page-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.back {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  cursor: pointer;
}

.back:active {
  background: rgba(255, 255, 255, 0.26);
}

.back svg {
  display: block;
}

/* ============================== 主页 ============================== */

.tool-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.tool {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 18px;
  color: inherit;
  text-align: left;
  text-decoration: none;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool:active {
  transform: scale(0.98);
}

.tool-icon {
  display: block;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  overflow: hidden;
  background: #1f8fd6;
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(15, 45, 74, 0.18);
}

.tool-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-text {
  display: grid;
  flex: 0 1 auto;
  gap: 2px;
  min-width: 0;
}

.tool-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.tool-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.ios-hint {
  margin: 16px 0 0;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
}

/* ============================== 计算页 ============================== */

.page-main {
  padding-bottom: 18px;
}

.page-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  flex: 1;
  min-height: 48px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-dark {
  color: #fff;
  background: linear-gradient(135deg, #17211f, #2c4038);
  box-shadow: 0 10px 22px rgba(18, 24, 26, 0.24);
}

.btn-ghost {
  color: var(--ink-2);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

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

.btn-link {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.btn-small {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 14px;
  font-size: 12.5px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* 胶囊输入 */

.field-group {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.field {
  display: flex;
  align-items: stretch;
  min-height: 64px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field:focus-within {
  border-color: rgba(167, 124, 69, 0.55);
  box-shadow: 0 0 0 4px rgba(167, 124, 69, 0.14), var(--shadow-card);
}

.field-name {
  display: flex;
  flex: 0 0 108px;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 12px 0 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}

.field-name small {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.field-input {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  padding: 0 18px 0 12px;
  background: var(--surface);
}

.field-input input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0;
  font-size: 21px;
  font-weight: 650;
  color: var(--ink);
  text-align: right;
  background: transparent;
  border: 0;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.field-input input::placeholder {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.65;
}

.field-input select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  text-align-last: right;
  background: transparent;
  border: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.field-input i {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.field-input .select-caret {
  font-size: 12px;
  opacity: 0.8;
}

/* 结果卡 */

.result {
  position: relative;
  margin-top: 14px;
  padding: 20px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(150deg, #121c19 0%, #1d302b 55%, #2a3f37 100%);
  border-radius: 20px;
  box-shadow: var(--shadow-lift);
}

.result::after {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  content: "";
  background: radial-gradient(circle, rgba(201, 166, 107, 0.24) 0%, transparent 70%);
  pointer-events: none;
}

.result-main {
  display: grid;
  gap: 3px;
}

.result-label {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.66);
  letter-spacing: 0.06em;
}

.result-number {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.result-number b {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.result-number i {
  font-style: normal;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.result-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 11px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.result-sub {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.result-sub b {
  font-size: 19px;
  font-weight: 650;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.result-sub i {
  font-style: normal;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.result b.is-empty {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.42;
}

.result-sub b.is-empty {
  font-size: 15px;
  opacity: 0.5;
}

/* ============================== 卡片与列表 ============================== */

.card {
  margin-top: 14px;
  padding: 2px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0 4px;
}

.card-head h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.card-head h2::before {
  display: inline-block;
  width: 4px;
  height: 13px;
  margin-right: 8px;
  vertical-align: -1px;
  content: "";
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}

.card-head span {
  font-size: 10.5px;
  color: var(--muted);
}

.card-head .chip-hint {
  color: #c0392b;
  font-weight: 600;
}

.formula {
  margin: 16px 4px 0;
  padding-left: 10px;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
  border-left: 2px solid rgba(167, 124, 69, 0.38);
  text-wrap: balance;
}

.empty {
  margin: 0;
  padding: 16px 8px 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

/* 机型 chips */

.chips {
  display: flex;
  gap: 8px;
  padding: 6px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.chip {
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
  padding: 9px 12px;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.chip b {
  font-size: 13px;
  font-weight: 700;
}

.chip small {
  font-size: 10.5px;
  color: var(--muted);
}

.chip:active {
  border-color: rgba(167, 124, 69, 0.55);
}

.chip.is-fit {
  color: var(--pink);
  background: var(--best-soft);
  border-color: rgba(178, 59, 106, 0.3);
}

.chip.is-fit b,
.chip.is-fit small {
  color: var(--pink);
}

.chip[aria-pressed="true"] {
  border-color: var(--pink);
}

/* 推荐列表 */

.rec-list {
  margin: 0;
  padding: 0 0 8px;
  list-style: none;
}

.rec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.rec:last-child {
  border-bottom: 0;
}

.rec.is-best {
  margin-inline: -10px;
  padding-inline: 10px;
  background: var(--best-soft);
  border-bottom-color: transparent;
  border-radius: 12px;
}

.rec-main {
  display: grid;
  gap: 1px;
  min-width: 0;
  grid-column: 1;
}

.rec-main b {
  font-size: 14px;
  color: var(--ink);
}

.rec-main small {
  font-size: 11px;
  color: var(--muted);
}

.rec-width {
  display: grid;
  justify-items: center;
  gap: 1px;
  grid-column: 2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rec-width small {
  font-size: 10px;
  color: var(--muted);
}

.rec-width b {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.rec.is-best .rec-width small {
  color: rgba(126, 34, 71, 0.62);
}

.rec.is-best .rec-width b {
  color: var(--pink);
}

.rec-diff {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  grid-column: 3;
  justify-self: end;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rec-diff.is-exact {
  color: var(--good);
  font-weight: 600;
}

.tag {
  padding: 2px 6px;
  font-size: 10px;
  font-style: normal;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

/* ============================== 设置页 ============================== */

.lib-list {
  max-height: 320px;
  margin: 0 -6px 0 0;
  padding: 0 6px 0 0;
  overflow-y: auto;
  list-style: none;
}

.lib-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.lib-item:last-child {
  border-bottom: 0;
}

.lib-main {
  display: grid;
  flex: 1;
  gap: 1px;
  min-width: 0;
}

.lib-main b {
  overflow: hidden;
  font-size: 14px;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-main small {
  font-size: 11px;
  color: var(--muted);
}

.lib-needles {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.lib-del {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.lib-del:hover {
  color: #b23b2e;
  background: rgba(178, 59, 46, 0.1);
}

.lib-edit {
  flex: 0 0 auto;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.lib-edit:hover {
  color: var(--teal);
  border-color: var(--teal);
}

.lib-tools {
  display: flex;
  gap: 6px;
}

.lib-export {
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.lib-export:hover {
  border-color: var(--teal);
}

.form-title {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.lib-actions {
  display: flex;
  gap: 8px;
  padding: 12px 0 14px;
}

.machine-form {
  display: grid;
  gap: 10px;
  padding: 2px 0 16px;
}

.mini-field {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}

.mini-field input {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
}

.mini-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 124, 69, 0.14);
}

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

.mini-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.setting-row:last-of-type {
  border-bottom: 0;
}

.setting-text b {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.setting-text small {
  font-size: 11px;
  color: var(--muted);
}

.status-line {
  margin: 6px 0 12px;
  padding: 9px 11px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 9px;
}

.help-list {
  margin: 0;
  padding: 4px 0 14px 18px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-2);
}

.help-list li {
  margin: 5px 0;
}

.help-list b {
  color: var(--ink);
}

/* ============================== 页脚 ============================== */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(56px + env(safe-area-inset-bottom));
  margin: auto -14px 0;
  padding: 0 18px env(safe-area-inset-bottom);
  text-align: center;
  position: relative;
  background: #111a1c;
  border-radius: 0 0 22px 22px;
}

.site-footer::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 68%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(201, 166, 107, 0.42), transparent);
  transform: translateX(-50%);
}

.site-line {
  width: 100%;
  margin: 0;
  font-size: 11.5px;
  line-height: 1;
  text-align: center;
  transform: translateY(12px);
  color: rgba(255, 255, 255, 0.66);
  white-space: nowrap;
}

/* ============================== 主页安装入口 ============================== */

.install-actions {
  padding: 12px 0 4px;
}

.install-actions .btn {
  width: 100%;
}

/* ============================== 试用 / 注册 ============================== */

.license-chip {
  display: block;
  margin: 12px auto 0;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.license-lock {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 18, 30, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.license-card {
  width: 100%;
  max-width: 340px;
  padding: 24px 22px 16px;
  text-align: center;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.license-badge {
  display: inline-block;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
}

.license-card h2 {
  margin: 14px 0 6px;
  font-size: 19px;
}

.license-desc {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.license-machine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
  padding: 9px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.license-machine span {
  font-size: 11px;
  color: var(--muted);
}

.license-machine code {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  user-select: text;
}

.license-copy {
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background:
    linear-gradient(180deg, var(--sheen), transparent 48%),
    linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  border: 1px solid var(--pearl-edge);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 var(--sheen),
    0 1px 0 var(--pearl-edge);
  cursor: pointer;
}

.license-hint {
  margin: 0 0 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.license-card input {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  font-size: 16px;
  text-align: center;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  outline: none;
}

.license-card input:focus {
  border-color: var(--teal);
}

.license-card .btn {
  width: 100%;
  margin-top: 12px;
}

.license-error {
  margin: 10px 0 0;
  font-size: 12px;
  color: #b23b2e;
}

.license-contact {
  margin: 14px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.license-close {
  margin-top: 10px;
  padding: 6px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}

body.is-locked {
  overflow: hidden;
}

/* ============================== 版本号 / 提示 ============================== */

.version-link {
  padding: 4px 10px;
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.version-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.toast {
  position: fixed;
  bottom: calc(26px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 120;
  max-width: 82vw;
  padding: 10px 16px;
  font-size: 13px;
  color: #fff;
  text-align: center;
  background: rgba(15, 25, 38, 0.94);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
}

/* ============================== 更新条 ============================== */

.update-bar {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 9px 9px 16px;
  font-size: 13px;
  color: #fff;
  background: #10202f;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
}

.update-bar button {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

/* ============================== 宽屏 / 动效 ============================== */

@media (min-width: 720px) {
  body {
    padding: 22px 0 0;
  }

  .app {
    padding-inline: 18px;
  }

  .home-header,
  .page-header {
    margin-inline: -18px;
  }

  .site-footer {
    margin-inline: -18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   主题皮肤（藏青蓝 / 莫兰迪中蓝 / 莫兰迪绿）
   ============================================================ */

:root,
[data-theme="navy"] {
  --bg: #edf1f6;
  --surface: #fbfcfe;
  --surface-2: #e8eef6;
  --ink: #16202d;
  --ink-2: #3a4757;
  --muted: #6f7c8c;
  --line: rgba(22, 32, 45, 0.1);
  --line-strong: rgba(22, 32, 45, 0.18);
  --accent: #8a6a3f;
  --accent-2: #b28b55;
  --accent-soft: #f0e7d6;
  --teal: #2f5a72;
  --teal-soft: #e2edf3;
  --blue: #2f5a72;
  --blue-soft: #e4eef5;
  --good: #3f6b52;
  --good-soft: #e6eee7;
  --best-soft: #e6b4c7;
  --pink: #7e2247;
  --navy: #0c1726;
  --shadow-card: 0 10px 30px rgba(20, 30, 45, 0.08);
  --shadow-lift: 0 18px 40px rgba(10, 20, 34, 0.24);
  --header-1: #0b1626;
  --header-2: #12263c;
  --header-3: #1a334d;
  --glow: rgba(114, 149, 184, 0.16);
  --footer-bg: #0b1622;
  --result-1: #0d1b2b;
  --result-2: #183049;
  --result-3: #23425c;
  --metal-1: #345273;
  --metal-2: #0f2136;
  --metal-edge: #7295b8;
  --metal-text: #f5f9ff;
  --pearl-1: #ffffff;
  --pearl-2: #e1e8f0;
  --pearl-edge: #a8b6c6;
  --pearl-text: #1a2738;
  --sheen: rgba(255, 255, 255, 0.8);
  --deep: rgba(0, 0, 0, 0.1);
  --cast: rgba(18, 28, 40, 0.12);
}

[data-theme="blue"] {
  --bg: #eceff0;
  --surface: #f8faf9;
  --surface-2: #e2e8e8;
  --ink: #263036;
  --ink-2: #48545b;
  --muted: #79858a;
  --line: rgba(38, 48, 54, 0.1);
  --line-strong: rgba(38, 48, 54, 0.18);
  --accent: #96765a;
  --accent-2: #b99775;
  --accent-soft: #efe6da;
  --teal: #4f6f7e;
  --teal-soft: #e4edf0;
  --blue: #4f6f7e;
  --blue-soft: #e4edf0;
  --good: #4a6b58;
  --good-soft: #e6eee8;
  --best-soft: #e6b4c7;
  --pink: #7e2247;
  --navy: #2a3e49;
  --shadow-card: 0 10px 30px rgba(35, 48, 54, 0.08);
  --shadow-lift: 0 18px 40px rgba(32, 46, 52, 0.22);
  --header-1: #263a44;
  --header-2: #354e5a;
  --header-3: #48646f;
  --glow: rgba(167, 189, 201, 0.18);
  --footer-bg: #263a44;
  --result-1: #243b44;
  --result-2: #35545f;
  --result-3: #446a76;
  --metal-1: #718b9b;
  --metal-2: #3c5867;
  --metal-edge: #a7bdc9;
  --metal-text: #f7fbfd;
  --pearl-1: #ffffff;
  --pearl-2: #e4eaea;
  --pearl-edge: #aab7ba;
  --pearl-text: #26333a;
  --sheen: rgba(255, 255, 255, 0.8);
  --deep: rgba(0, 0, 0, 0.1);
  --cast: rgba(32, 46, 52, 0.12);
}

[data-theme="green"] {
  --bg: #eaefe8;
  --surface: #f8faf5;
  --surface-2: #e1e8de;
  --ink: #222d26;
  --ink-2: #45534a;
  --muted: #77847a;
  --line: rgba(34, 45, 38, 0.1);
  --line-strong: rgba(34, 45, 38, 0.18);
  --accent: #7f7449;
  --accent-2: #a89a6a;
  --accent-soft: #eee9d8;
  --teal: #4b6b57;
  --teal-soft: #e4ede5;
  --blue: #4b6b57;
  --blue-soft: #e4ede5;
  --good: #41664d;
  --good-soft: #e5eee6;
  --best-soft: #e6b4c7;
  --pink: #7e2247;
  --navy: #23332a;
  --shadow-card: 0 10px 30px rgba(30, 42, 33, 0.08);
  --shadow-lift: 0 18px 40px rgba(26, 38, 30, 0.22);
  --header-1: #1e2e25;
  --header-2: #2b4033;
  --header-3: #3a5543;
  --glow: rgba(169, 191, 174, 0.16);
  --footer-bg: #1e2e25;
  --result-1: #1d3025;
  --result-2: #2b4635;
  --result-3: #385a44;
  --metal-1: #718b77;
  --metal-2: #3d5847;
  --metal-edge: #a9bfae;
  --metal-text: #f6faf5;
  --pearl-1: #ffffff;
  --pearl-2: #e3e9df;
  --pearl-edge: #adb9a7;
  --pearl-text: #233028;
  --sheen: rgba(255, 255, 255, 0.8);
  --deep: rgba(0, 0, 0, 0.1);
  --cast: rgba(26, 38, 30, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root,
  [data-theme="navy"] {
    --bg: #0a1018;
    --surface: #141c26;
    --surface-2: #101720;
    --ink: #eef3f9;
    --ink-2: #c6d0dc;
    --muted: #8997a6;
    --line: rgba(238, 243, 249, 0.1);
    --line-strong: rgba(238, 243, 249, 0.18);
    --accent: #d8b07a;
    --accent-2: #e8c99a;
    --accent-soft: rgba(216, 176, 122, 0.14);
    --teal: #8fb9c9;
    --teal-soft: rgba(143, 185, 201, 0.14);
    --blue: #8fb9c9;
    --blue-soft: rgba(143, 185, 201, 0.14);
    --good: #7fbf9e;
    --good-soft: rgba(127, 191, 158, 0.14);
    --best-soft: rgba(255, 150, 180, 0.28);
    --pink: #ffb3cd;
    --navy: #08101a;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.55);
    --header-1: #08111c;
    --header-2: #0e1d2e;
    --header-3: #152a40;
    --glow: rgba(111, 147, 184, 0.18);
    --footer-bg: #08111a;
    --result-1: #0b1929;
    --result-2: #142a40;
    --result-3: #1d3b56;
    --metal-1: #3a5878;
    --metal-2: #122338;
    --metal-edge: #6f93b8;
    --metal-text: #f5f9ff;
    --pearl-1: #202b39;
    --pearl-2: #151d28;
    --pearl-edge: #41566a;
    --pearl-text: #eaf0f7;
    --sheen: rgba(255, 255, 255, 0.22);
    --deep: rgba(0, 0, 0, 0.4);
    --cast: rgba(0, 0, 0, 0.4);
  }

  [data-theme="blue"] {
    --bg: #0e1416;
    --surface: #171f21;
    --surface-2: #121a1c;
    --ink: #eef3f3;
    --ink-2: #c9d3d4;
    --muted: #93a0a3;
    --line: rgba(238, 243, 243, 0.1);
    --line-strong: rgba(238, 243, 243, 0.18);
    --accent: #d3b087;
    --accent-2: #e4c9a6;
    --accent-soft: rgba(211, 176, 135, 0.14);
    --teal: #9dbcc7;
    --teal-soft: rgba(157, 188, 199, 0.14);
    --blue: #9dbcc7;
    --blue-soft: rgba(157, 188, 199, 0.14);
    --good: #8dbfa2;
    --good-soft: rgba(141, 191, 162, 0.14);
    --best-soft: rgba(255, 150, 180, 0.28);
    --pink: #ffb3cd;
    --navy: #1e3039;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.55);
    --header-1: #1e3039;
    --header-2: #2a414b;
    --header-3: #38545f;
    --glow: rgba(138, 167, 180, 0.18);
    --footer-bg: #1a2a31;
    --result-1: #243b44;
    --result-2: #35545f;
    --result-3: #446a76;
    --metal-1: #55707f;
    --metal-2: #2b4753;
    --metal-edge: #8aa7b4;
    --metal-text: #f7fbfd;
    --pearl-1: #1f292c;
    --pearl-2: #151d1f;
    --pearl-edge: #485b61;
    --pearl-text: #eaf1f2;
    --sheen: rgba(255, 255, 255, 0.22);
    --deep: rgba(0, 0, 0, 0.4);
    --cast: rgba(0, 0, 0, 0.4);
  }

  [data-theme="green"] {
    --bg: #0d1310;
    --surface: #161d18;
    --surface-2: #111814;
    --ink: #eef4ed;
    --ink-2: #c8d3ca;
    --muted: #93a094;
    --line: rgba(238, 244, 237, 0.1);
    --line-strong: rgba(238, 244, 237, 0.18);
    --accent: #d6bd8c;
    --accent-2: #e7d3aa;
    --accent-soft: rgba(214, 189, 140, 0.14);
    --teal: #a3c4ad;
    --teal-soft: rgba(163, 196, 173, 0.14);
    --blue: #a3c4ad;
    --blue-soft: rgba(163, 196, 173, 0.14);
    --good: #8fc3a0;
    --good-soft: rgba(143, 195, 160, 0.14);
    --best-soft: rgba(255, 150, 180, 0.28);
    --pink: #ffb3cd;
    --navy: #1a2a21;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.55);
    --header-1: #1a2a21;
    --header-2: #253b2e;
    --header-3: #314d3c;
    --glow: rgba(143, 174, 152, 0.18);
    --footer-bg: #18261e;
    --result-1: #1d3025;
    --result-2: #2b4635;
    --result-3: #385a44;
    --metal-1: #5a7a64;
    --metal-2: #2f4a3a;
    --metal-edge: #8fae98;
    --metal-text: #f6faf5;
    --pearl-1: #1e2721;
    --pearl-2: #141b16;
    --pearl-edge: #47594b;
    --pearl-text: #e9f1ea;
    --sheen: rgba(255, 255, 255, 0.22);
    --deep: rgba(0, 0, 0, 0.4);
    --cast: rgba(0, 0, 0, 0.4);
  }
}

/* 标题栏 / 结果卡 / 页脚跟随主题 */
.topbar {
  background:
    radial-gradient(130% 170% at 100% 0%, var(--glow), transparent 56%),
    linear-gradient(158deg, var(--header-1) 0%, var(--header-2) 58%, var(--header-3) 100%);
}

.site-footer {
  background: var(--footer-bg);
}

.result {
  background: linear-gradient(150deg, var(--result-1) 0%, var(--result-2) 55%, var(--result-3) 100%);
}

/* ============================== 主题选择 ============================== */

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

.theme-option {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 9px 6px 8px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pearl-text);
  background:
    linear-gradient(180deg, var(--sheen), transparent 48%),
    linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  border: 1px solid var(--pearl-edge);
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 var(--sheen),
    inset 0 -1px 1px var(--deep),
    0 2px 0 var(--pearl-edge),
    0 4px 8px var(--cast);
  cursor: pointer;
}

.theme-option[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 var(--sheen),
    inset 0 -1px 1px var(--deep),
    0 0 0 2px var(--accent-soft),
    0 2px 0 var(--pearl-edge),
    0 4px 8px var(--cast);
}

.theme-swatch {
  width: 100%;
  height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 7px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.swatch-navy {
  background: linear-gradient(135deg, #4a647a 0 50%, #edf1f4 50% 100%);
}

.swatch-blue {
  background: linear-gradient(135deg, #53706c 0 50%, #eef1ef 50% 100%);
}

.swatch-green {
  background: linear-gradient(135deg, #64707c 0 50%, #f0f1f2 50% 100%);
}

/* ============================== 3D 金属按钮 ============================== */

.btn,
.icon-btn,
.back,
.chip,
.lib-edit,
.lib-export,
.lib-del,
.license-chip,
.theme-option,
.update-bar button {
  color: var(--pearl-text);
  border: 1px solid var(--pearl-edge);
  background:
    linear-gradient(180deg, var(--sheen), transparent 46%),
    linear-gradient(180deg, var(--pearl-1), var(--pearl-2));
  box-shadow:
    inset 0 1px 0 var(--sheen),
    inset 0 -1px 1px var(--deep),
    0 2px 0 var(--pearl-edge),
    0 5px 10px var(--cast);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-dark,
.license-card .btn-dark,
.license-activate {
  color: var(--metal-text);
  border-color: var(--metal-edge);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 46%),
    linear-gradient(180deg, var(--metal-1), var(--metal-2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 1px rgba(0, 0, 0, 0.35),
    0 2px 0 var(--metal-edge),
    0 7px 14px rgba(8, 14, 20, 0.24);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.btn-ghost {
  color: var(--pearl-text);
}

.btn-soft {
  color: var(--accent);
}

.btn-link {
  color: var(--pearl-text);
}

.btn-small {
  color: var(--accent);
}

.install-top {
  color: #fff;
  border-color: #8f4314;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 45%),
    linear-gradient(180deg, #e09a55, #b4571c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 1px rgba(0, 0, 0, 0.3),
    0 2px 0 #8f4314,
    0 6px 12px rgba(120, 60, 20, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.chip {
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 var(--sheen),
    inset 0 -1px 1px var(--deep),
    0 1px 0 var(--pearl-edge),
    0 3px 6px var(--cast);
}

.chip.is-fit {
  color: var(--pink);
  background: var(--best-soft);
  border-color: rgba(126, 34, 71, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 0 rgba(126, 34, 71, 0.3),
    0 3px 6px rgba(126, 34, 71, 0.14);
}

.chip.is-fit b,
.chip.is-fit small {
  color: var(--pink);
}

.lib-del {
  color: #a23b32;
}

.btn:active,
.icon-btn:active,
.back:active,
.chip:active,
.lib-edit:active,
.lib-export:active,
.lib-del:active,
.license-chip:active,
.theme-option:active,
.update-bar button:active,
.install-top:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px var(--deep),
    0 1px 0 var(--pearl-edge);
}

/* 主题图标（线性白图标 + 主题底色） */
.logo {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.logo-svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.tool-icon {
  background: transparent;
}

.tool-svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(20, 30, 40, 0.16);
}

/* ============================================================
   三套主题最终配色（清透钢蓝 / 青雾松绿 / 薄雾暖灰）
   ============================================================ */

:root,
[data-theme="navy"] {
  --bg: #edf1f4;
  --surface: #fbfcfd;
  --surface-2: #e7ecf0;
  --ink: #1e2a35;
  --ink-2: #44525f;
  --muted: #788490;
  --line: rgba(30, 42, 53, 0.1);
  --line-strong: rgba(30, 42, 53, 0.18);
  --accent: #4a647a;
  --accent-2: #748da0;
  --accent-soft: #e6ebf0;
  --teal: #587287;
  --teal-soft: #e8eef3;
  --blue: #587287;
  --blue-soft: #e8eef3;
  --good: #4a647a;
  --good-soft: #e6ebf0;
  --best-soft: #e6b4c7;
  --pink: #7e2247;
  --navy: #324657;
  --shadow-card: 0 10px 30px rgba(30, 42, 53, 0.08);
  --shadow-lift: 0 18px 40px rgba(30, 42, 53, 0.22);
  --header-1: #4a647a;
  --header-2: #4a647a;
  --header-3: #4a647a;
  --glow: rgba(255, 255, 255, 0);
  --footer-bg: #4a647a;
  --result-1: #324657;
  --result-2: #3b5164;
  --result-3: #4a647a;
  --metal-1: #748da0;
  --metal-2: #324657;
  --metal-edge: #b0b9c0;
  --metal-text: #ffffff;
  --pearl-1: #ffffff;
  --pearl-2: #e7ecf0;
  --pearl-edge: #b0b9c0;
  --pearl-text: #1e2a35;
  --sheen: rgba(255, 255, 255, 0.8);
  --deep: rgba(0, 0, 0, 0.1);
  --cast: rgba(30, 42, 53, 0.12);
  --icon-logo: #82a092;
  --icon-machine: #587287;
  --icon-width: #94a8b8;
  --icon-yarn: #70889b;
}

[data-theme="blue"] {
  --bg: #eef1ef;
  --surface: #fafbfa;
  --surface-2: #e7ece9;
  --ink: #232e2a;
  --ink-2: #485650;
  --muted: #79867f;
  --line: rgba(35, 46, 42, 0.1);
  --line-strong: rgba(35, 46, 42, 0.18);
  --accent: #53706c;
  --accent-2: #7e9995;
  --accent-soft: #e6edea;
  --teal: #5b7874;
  --teal-soft: #e8efec;
  --blue: #5b7874;
  --blue-soft: #e8efec;
  --good: #53706c;
  --good-soft: #e6edea;
  --best-soft: #e6b4c7;
  --pink: #7e2247;
  --navy: #394d4a;
  --shadow-card: 0 10px 30px rgba(35, 46, 42, 0.08);
  --shadow-lift: 0 18px 40px rgba(35, 46, 42, 0.22);
  --header-1: #53706c;
  --header-2: #53706c;
  --header-3: #53706c;
  --glow: rgba(255, 255, 255, 0);
  --footer-bg: #53706c;
  --result-1: #394d4a;
  --result-2: #465f5a;
  --result-3: #53706c;
  --metal-1: #7e9995;
  --metal-2: #394d4a;
  --metal-edge: #b5bebc;
  --metal-text: #ffffff;
  --pearl-1: #ffffff;
  --pearl-2: #e7ece9;
  --pearl-edge: #b5bebc;
  --pearl-text: #232e2a;
  --sheen: rgba(255, 255, 255, 0.8);
  --deep: rgba(0, 0, 0, 0.1);
  --cast: rgba(35, 46, 42, 0.12);
  --icon-logo: #64867a;
  --icon-machine: #5b7874;
  --icon-width: #8da7a2;
  --icon-yarn: #77948e;
}

[data-theme="green"] {
  --bg: #f0f1f2;
  --surface: #fbfbfc;
  --surface-2: #e9ebed;
  --ink: #293037;
  --ink-2: #4e5861;
  --muted: #7d858e;
  --line: rgba(41, 48, 55, 0.1);
  --line-strong: rgba(41, 48, 55, 0.18);
  --accent: #64707c;
  --accent-2: #8c97a2;
  --accent-soft: #e9edf0;
  --teal: #6e7a86;
  --teal-soft: #eceff2;
  --blue: #6e7a86;
  --blue-soft: #eceff2;
  --good: #64707c;
  --good-soft: #e9edf0;
  --best-soft: #e6b4c7;
  --pink: #7e2247;
  --navy: #464f58;
  --shadow-card: 0 10px 30px rgba(41, 48, 55, 0.08);
  --shadow-lift: 0 18px 40px rgba(41, 48, 55, 0.22);
  --header-1: #64707c;
  --header-2: #64707c;
  --header-3: #64707c;
  --glow: rgba(255, 255, 255, 0);
  --footer-bg: #64707c;
  --result-1: #464f58;
  --result-2: #55616c;
  --result-3: #64707c;
  --metal-1: #8c97a2;
  --metal-2: #464f58;
  --metal-edge: #bdc2c7;
  --metal-text: #ffffff;
  --pearl-1: #ffffff;
  --pearl-2: #e9ebed;
  --pearl-edge: #bdc2c7;
  --pearl-text: #293037;
  --sheen: rgba(255, 255, 255, 0.8);
  --deep: rgba(0, 0, 0, 0.1);
  --cast: rgba(41, 48, 55, 0.12);
  --icon-logo: #899c90;
  --icon-machine: #6e7a86;
  --icon-width: #9ca7b1;
  --icon-yarn: #808c98;
}

@media (prefers-color-scheme: dark) {
  :root,
  [data-theme="navy"] {
    --bg: #0e151c;
    --surface: #161f28;
    --surface-2: #111920;
    --ink: #edf1f5;
    --ink-2: #c6d0da;
    --muted: #8a97a4;
    --line: rgba(237, 241, 245, 0.1);
    --line-strong: rgba(237, 241, 245, 0.18);
    --accent: #a7bdd0;
    --accent-2: #c4d3e0;
    --accent-soft: rgba(167, 189, 208, 0.14);
    --teal: #a7bdd0;
    --teal-soft: rgba(167, 189, 208, 0.14);
    --blue: #a7bdd0;
    --blue-soft: rgba(167, 189, 208, 0.14);
    --good: #a7bdd0;
    --good-soft: rgba(167, 189, 208, 0.14);
    --best-soft: rgba(255, 150, 180, 0.28);
    --pink: #ffb3cd;
    --navy: #324657;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.55);
    --header-1: #324657;
    --header-2: #324657;
    --header-3: #324657;
    --glow: rgba(255, 255, 255, 0);
    --footer-bg: #324657;
    --result-1: #24333f;
    --result-2: #324657;
    --result-3: #435b6f;
    --metal-1: #748da0;
    --metal-2: #324657;
    --metal-edge: #b0b9c0;
    --metal-text: #ffffff;
    --pearl-1: #1d2630;
    --pearl-2: #141c24;
    --pearl-edge: #4b5a68;
    --pearl-text: #edf1f5;
    --sheen: rgba(255, 255, 255, 0.16);
    --deep: rgba(0, 0, 0, 0.4);
    --cast: rgba(0, 0, 0, 0.4);
  }

  [data-theme="blue"] {
    --bg: #0e1412;
    --surface: #161e1b;
    --surface-2: #111916;
    --ink: #edf1ef;
    --ink-2: #c8d2ce;
    --muted: #8b978f;
    --line: rgba(237, 241, 239, 0.1);
    --line-strong: rgba(237, 241, 239, 0.18);
    --accent: #a6bdb8;
    --accent-2: #c4d3d0;
    --accent-soft: rgba(166, 189, 184, 0.14);
    --teal: #a6bdb8;
    --teal-soft: rgba(166, 189, 184, 0.14);
    --blue: #a6bdb8;
    --blue-soft: rgba(166, 189, 184, 0.14);
    --good: #a6bdb8;
    --good-soft: rgba(166, 189, 184, 0.14);
    --best-soft: rgba(255, 150, 180, 0.28);
    --pink: #ffb3cd;
    --navy: #394d4a;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.55);
    --header-1: #394d4a;
    --header-2: #394d4a;
    --header-3: #394d4a;
    --glow: rgba(255, 255, 255, 0);
    --footer-bg: #394d4a;
    --result-1: #243430;
    --result-2: #31433f;
    --result-3: #3d524d;
    --metal-1: #7e9995;
    --metal-2: #394d4a;
    --metal-edge: #b5bebc;
    --metal-text: #ffffff;
    --pearl-1: #1c2623;
    --pearl-2: #131b18;
    --pearl-edge: #46544f;
    --pearl-text: #edf1ef;
    --sheen: rgba(255, 255, 255, 0.16);
    --deep: rgba(0, 0, 0, 0.4);
    --cast: rgba(0, 0, 0, 0.4);
  }

  [data-theme="green"] {
    --bg: #111316;
    --surface: #191d21;
    --surface-2: #14181c;
    --ink: #edf0f2;
    --ink-2: #c9d0d6;
    --muted: #8e969d;
    --line: rgba(237, 240, 242, 0.1);
    --line-strong: rgba(237, 240, 242, 0.18);
    --accent: #b4c0cb;
    --accent-2: #d0d9e1;
    --accent-soft: rgba(180, 192, 203, 0.14);
    --teal: #b4c0cb;
    --teal-soft: rgba(180, 192, 203, 0.14);
    --blue: #b4c0cb;
    --blue-soft: rgba(180, 192, 203, 0.14);
    --good: #b4c0cb;
    --good-soft: rgba(180, 192, 203, 0.14);
    --best-soft: rgba(255, 150, 180, 0.28);
    --pink: #ffb3cd;
    --navy: #464f58;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.55);
    --header-1: #464f58;
    --header-2: #464f58;
    --header-3: #464f58;
    --glow: rgba(255, 255, 255, 0);
    --footer-bg: #464f58;
    --result-1: #2a333b;
    --result-2: #36414b;
    --result-3: #46525d;
    --metal-1: #8c97a2;
    --metal-2: #464f58;
    --metal-edge: #bdc2c7;
    --metal-text: #ffffff;
    --pearl-1: #1e2327;
    --pearl-2: #151a1d;
    --pearl-edge: #4a545c;
    --pearl-text: #edf0f2;
    --sheen: rgba(255, 255, 255, 0.16);
    --deep: rgba(0, 0, 0, 0.4);
    --cast: rgba(0, 0, 0, 0.4);
  }
}