:root {
  --upgrade-accent: #6366f1;
  --upgrade-surface: rgba(15, 23, 42, .96);
  --upgrade-border: rgba(148, 163, 184, .28);
  --upgrade-text: #f8fafc;
  --upgrade-muted: #cbd5e1;
}

/* Prevent wide calculator grids from causing document-level horizontal overflow */
.calc-page { overflow-x: clip; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 10050;
  padding: .7rem 1rem;
  border-radius: .5rem;
  background: #fff;
  color: #111827;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* 顶部导航栏内的站内搜索：宽屏显示放大镜 + 内联输入框，窄屏只保留放大镜按钮。 */
.header-search { display: flex; align-items: center; margin-left: auto; margin-right: .6rem; }
.header-search-form {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .18rem .3rem;
  border: 1px solid var(--upgrade-border);
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
}
.header-search-form:focus-within { border-color: var(--upgrade-accent); }
.header-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 34px;
  block-size: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.header-search-icon:hover,
.header-search-icon:focus-visible { color: var(--upgrade-accent); }
.header-search-icon svg {
  inline-size: 18px;
  block-size: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.header-search-input {
  inline-size: 190px;
  min-block-size: 32px;
  padding: .3rem .5rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .9rem;
}
.header-search-input::placeholder { color: currentColor; opacity: .6; }
.header-search-input:focus { outline: none; }
.header-search-input::-webkit-search-cancel-button { filter: invert(.5); }

@media (max-width: 900px) {
  .header-search { margin-right: .35rem; }
  .header-search-form { background: transparent; border-color: transparent; padding: 0; }
  .header-search-input { display: none; }
}

.site-utility-bar {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9000;
  display: flex;
  gap: .45rem;
  padding: .45rem;
  border: 1px solid var(--upgrade-border);
  border-radius: .85rem;
  background: var(--upgrade-surface);
  box-shadow: 0 14px 35px rgba(2, 6, 23, .3);
  backdrop-filter: blur(14px);
}
.site-utility-bar button,
.site-action-bar button,
.privacy-actions button {
  min-height: 42px;
  border: 1px solid var(--upgrade-border);
  border-radius: .6rem;
  background: rgba(255, 255, 255, .08);
  color: var(--upgrade-text);
  padding: .55rem .75rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.site-utility-bar button:hover,
.site-utility-bar button:focus-visible,
.site-action-bar button:hover,
.site-action-bar button:focus-visible { border-color: var(--upgrade-accent); }

.site-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  max-width: 1100px;
  margin: 1rem auto 1.5rem;
  padding: .8rem;
  border: 1px solid var(--upgrade-border);
  border-radius: .85rem;
  background: rgba(15, 23, 42, .68);
}
.site-action-bar button[aria-pressed="true"] { background: var(--upgrade-accent); }

.site-search-dialog,
.privacy-dialog {
  width: min(680px, calc(100vw - 2rem));
  max-height: min(82vh, 760px);
  border: 1px solid var(--upgrade-border);
  border-radius: 1rem;
  background: #0f172a;
  color: var(--upgrade-text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.site-search-dialog::backdrop,
.privacy-dialog::backdrop { background: rgba(2, 6, 23, .72); backdrop-filter: blur(5px); }
.dialog-inner { padding: 1.15rem; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-heading h2 { margin: 0; font-size: 1.35rem; color: var(--upgrade-text); }
.dialog-close { border: 0; background: transparent; color: var(--upgrade-text); font-size: 1.5rem; cursor: pointer; }
.site-search-input {
  width: 100%;
  margin: 1rem 0;
  padding: .85rem 1rem;
  border: 1px solid var(--upgrade-border);
  border-radius: .7rem;
  background: #020617;
  color: #fff;
  font: inherit;
}
.search-results { display: grid; gap: .55rem; overflow: auto; max-height: 54vh; }
.search-result {
  display: block;
  padding: .8rem;
  border: 1px solid var(--upgrade-border);
  border-radius: .7rem;
  color: var(--upgrade-text);
  text-decoration: none;
}
.search-result:hover, .search-result:focus-visible { border-color: var(--upgrade-accent); }
.search-result small { display: block; margin-top: .3rem; color: var(--upgrade-muted); }
.search-empty { color: var(--upgrade-muted); }

.privacy-dialog p,
.privacy-dialog label { color: var(--upgrade-muted); }
.privacy-choice {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .8rem;
  margin: .7rem 0;
  border: 1px solid var(--upgrade-border);
  border-radius: .7rem;
}
.privacy-choice input { margin-top: .25rem; inline-size: 1.1rem; block-size: 1.1rem; }
.privacy-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.privacy-actions .primary { background: var(--upgrade-accent); border-color: var(--upgrade-accent); }
.privacy-link { color: #a5b4fc; }

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9500;
  display: flex;
  width: 100%;
  min-height: 64px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: .85rem 1.5rem;
  background: var(--upgrade-surface);
  border-top: 1px solid var(--upgrade-border);
  box-shadow: 0 -6px 24px rgba(2, 6, 23, .35);
  backdrop-filter: blur(14px);
  color: var(--upgrade-muted);
  font-size: .88rem;
}
.consent-copy { max-width: 820px; line-height: 1.55; }
.consent-banner a { color: #a5b4fc; }
.consent-banner button {
  flex-shrink: 0;
  min-height: 36px;
  border: 1px solid var(--upgrade-accent);
  border-radius: .5rem;
  background: var(--upgrade-accent);
  color: #fff;
  padding: .45rem 1.1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.consent-banner button:hover { opacity: .9; }
/* “仅必要”是次要选项：保持同样可点，但视觉上不与“允许广告”竞争。 */
.consent-banner button.secondary {
  background: transparent;
  color: var(--upgrade-text);
  border-color: var(--upgrade-border);
  font-weight: 550;
}
.consent-banner button.secondary:hover { border-color: var(--upgrade-accent); opacity: 1; }
.consent-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }

@media (max-width: 680px) {
  .consent-banner { flex-direction: column; gap: .6rem; text-align: center; padding: .75rem 1rem; font-size: .82rem; }
}

/* 隐私偏好弹窗里回显当前选择，避免用户不确定自己选过什么。 */
.consent-state {
  margin: .2rem 0 .9rem;
  padding: .55rem .75rem;
  border: 1px solid var(--upgrade-border);
  border-radius: .55rem;
  font-size: .85rem;
}
.privacy-actions .secondary {
  background: transparent;
  color: var(--upgrade-text);
  border: 1px solid var(--upgrade-border);
}
.privacy-actions button[aria-pressed="true"] {
  border-color: var(--upgrade-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--upgrade-accent) 35%, transparent);
}

.offline-badge {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 9600;
  max-width: calc(100vw - 2rem);
  padding: .5rem .95rem;
  border: 1px solid var(--upgrade-border);
  border-radius: 999px;
  background: var(--upgrade-surface);
  color: var(--upgrade-text);
  font-size: .82rem;
  box-shadow: 0 6px 20px rgba(2, 6, 23, .35);
}

/* 默认隐藏；有可投放 zone 时先加 is-reserved 占位（否则隐藏元素无法触发懒加载观察器），
   脚本真正注入后再加 is-active。 */
/* width:100% 不可省略：广告位是 <body> 的直接子元素，而 body 是 flex column 容器，
   此时水平方向的 auto 外边距会吸收全部剩余空间、抵消 stretch，使广告位收缩到标签文字宽度
   （实测 108px），native banner 无法展示。显式给出宽度后实际宽度为 min(100%, 1100px)。 */
.ad-slot { display: none; width: 100%; max-width: 1100px; margin: 1.5rem auto; text-align: center; overflow: hidden; }
.ad-slot.is-reserved, .ad-slot.is-active { display: block; }
.ad-label { display: block; margin-bottom: .4rem; color: #94a3b8; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.ad-mount { min-height: 1px; }

.upgrade-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .9rem;
  padding: .75rem 1rem 1.25rem;
  font-size: .85rem;
}
.upgrade-footer-links a,
.upgrade-footer-links button { color: inherit; opacity: .8; }
.upgrade-footer-links button { border: 0; background: none; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }

.toast-message {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  z-index: 10020;
  transform: translateX(-50%);
  padding: .7rem 1rem;
  border-radius: .65rem;
  background: #111827;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.32);
}

.upgrade-policy { max-width: 820px; margin: 3rem auto; padding: 1rem; line-height: 1.75; }
.upgrade-policy h1, .upgrade-policy h2 { line-height: 1.25; }
.upgrade-policy-nav { padding: 1rem; }
.upgrade-policy-nav a { color: inherit; }

@media (max-width: 680px) {
  .site-utility-bar { right: .55rem; bottom: .55rem; }
  .site-utility-bar button { padding: .5rem .62rem; font-size: .82rem; }
  .site-action-bar { margin-inline: .75rem; }
}

@media print {
  .site-utility-bar, .site-action-bar, .privacy-dialog, .site-search-dialog,
  .ad-slot, .upgrade-footer-links, .consent-banner, .offline-badge { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
}


/* ── GEO：可被生成式引擎直接引用的答案摘要块 ─────────────────────────────── */
/* 站点主题各不相同，这里只用继承色与半透明描边，保证三个站视觉都不突兀。 */
.answer-summary {
  margin: 1.25rem 0 1.75rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--upgrade-border);
  border-left: 3px solid var(--upgrade-accent);
  border-radius: .6rem;
  background: rgba(99, 102, 241, .06);
  line-height: 1.7;
}
.answer-summary-title {
  margin: 0 0 .5rem;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
}
.answer-summary-lead { margin: 0; font-size: 1rem; }
.answer-summary-facts { margin: .7rem 0 0; padding-left: 1.15rem; font-size: .9rem; opacity: .88; }
.answer-summary-facts li { margin-bottom: .25rem; }
.answer-summary-meta { margin: .7rem 0 0; font-size: .8rem; opacity: .65; }

@media print { .answer-summary { border-color: #ccc; background: none; } }
/* AliExpress product recommendations are hidden until fresh eligible data arrives. */
.commerce-module.commerce-pending{display:block!important;width:1px!important;height:1px!important;min-height:1px!important;margin:0!important;padding:0!important;border:0!important;overflow:hidden!important}
.commerce-module[hidden]{display:none!important}.commerce-module{width:min(1120px,calc(100% - 32px));margin:42px auto;padding:22px 0;border-top:1px solid var(--border-color,#d8dee7);border-bottom:1px solid var(--border-color,#d8dee7)}.commerce-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}.commerce-label{font-size:12px;font-weight:800;text-transform:uppercase;color:var(--text-muted,#64748b)}.commerce-updated,.commerce-disclosure{font-size:12px;color:var(--text-muted,#64748b)}.commerce-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.commerce-card{min-width:0;background:var(--card-bg,#fff);border:1px solid var(--border-color,#d8dee7);border-radius:6px;overflow:hidden}.commerce-media{aspect-ratio:1/1;background:#f3f5f7;display:grid;place-items:center;overflow:hidden}.commerce-media img{width:100%;height:100%;object-fit:contain}.commerce-media.image-failed:after{content:'Image unavailable';font-size:12px;color:#64748b}.commerce-body{padding:13px}.commerce-title{height:2.8em;margin:0 0 9px;overflow:hidden;font-size:14px;line-height:1.4}.commerce-price-row{display:flex;align-items:baseline;gap:7px;min-height:24px}.commerce-price{font-size:17px}.commerce-original{font-size:12px;color:#64748b}.commerce-meta{min-height:34px;margin:7px 0 10px;font-size:12px;color:#64748b}.commerce-cta{display:inline-flex;min-height:36px;align-items:center;justify-content:center;padding:7px 10px;background:#0f172a;color:#fff!important;border-radius:5px;font-size:12px;font-weight:800;text-decoration:none}.commerce-disclosure{margin:13px 0 0}.commerce-module:focus-within{outline:2px solid var(--accent-color,#0f766e);outline-offset:4px}@media(max-width:900px){.commerce-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.commerce-module{width:calc(100% - 24px);padding:18px 0}.commerce-heading{align-items:flex-start;flex-direction:column;gap:4px}.commerce-grid{display:block}.commerce-card{display:grid;grid-template-columns:104px minmax(0,1fr);min-height:118px;margin-bottom:10px}.commerce-card:nth-child(n+3){display:none}.commerce-media{aspect-ratio:auto;height:116px}.commerce-body{padding:10px}.commerce-title{font-size:13px}.commerce-meta{min-height:0}.commerce-cta{min-height:34px}.commerce-disclosure{line-height:1.45}}
