/* 3v.gg 计算器 — 与 www 主站一致的紫白浅色主题 */
:root {
  --primary: #5d21d1;
  --primary-dark: #431995;
  --primary-light: #7c3ff2;
  --hero-bg: linear-gradient(135deg, #2d1065 0%, #431995 38%, #5d21d1 72%, #7c3ff2 100%);
  --purple-bg: #f7f4fd;
  --purple-soft: #f5f0ff;
  --nav-bg: #111111;
  --nav-h: 60px;
  --nav-hover: #6ea8d4;
  --footer-bg: #202427;
  --text: #212529;
  --text-secondary: #6e6e73;
  --muted: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --card: #fff;
  --surface: #f5f5f7;
  --calc-content-max: min(1400px, calc(100vw - 48px));
  --calc-nav-icon-x: 18px;
  --font-body: "Red Hat Display", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Encode Sans Semi Condensed", "Red Hat Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-nav: Arial, Verdana, Tahoma, sans-serif;
}

body {
  background: var(--surface) !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
}

h1, h2, h3, .calc-sidebar-title, .content-title,
.calc-site-nav .brand, input.button, #sug-submit {
  font-family: var(--font-heading) !important;
}

/* 顶栏 — 与主站 site-nav 一致 */
.calc-site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  height: var(--nav-h);
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 -10px 10px -10px #000 inset;
}
.calc-site-nav .brand {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-right: 32px;
  text-decoration: none;
  letter-spacing: -0.02em;
  font-family: var(--font-heading);
}
.calc-site-nav .brand span { color: #fff; opacity: 0.85; }
.calc-site-nav .links { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.calc-site-nav .links a {
  color: #e8edf7;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-nav);
  text-decoration: none;
}
.calc-site-nav .links a:hover,
.calc-site-nav .links a.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--nav-hover);
}
.calc-site-nav .nav-right { margin-left: auto; }
.calc-site-nav .nav-right a {
  color: #aaa;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid #444;
  border-radius: 8px;
  text-decoration: none;
}
.calc-site-nav .nav-right a:hover { color: #fff; border-color: var(--nav-hover); }

.calc-header { display: none !important; }
.counter_banner { display: none !important; }

.calc-page-wrap {
  padding-top: var(--nav-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface) !important;
}

/* 页头渐变 — 与主站 page-hero 一致 */
.calc-page-hero {
  position: relative;
  width: 100%;
  color: #fff;
  text-align: center;
  background: var(--hero-bg);
  padding: 40px 24px 48px;
  min-height: 160px;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}
.calc-page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url(/assets/images/inner-header-banner.png);
  background-repeat: no-repeat;
  background-position: 85% 100%;
  background-size: min(480px, 45vw);
  opacity: 0.55;
  pointer-events: none;
}
.calc-page-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--calc-content-max);
  margin: 0 auto;
}
.calc-page-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: #fff !important;
  background: none !important;
  height: auto !important;
  text-indent: 0 !important;
  border: none !important;
}
.calc-page-hero-sub {
  opacity: 0.92;
  font-size: clamp(13px, 1.6vw, 15px);
  margin-top: 8px;
  line-height: 1.5;
}

.calc-page-main {
  flex: 1 1 auto;
  width: 100%;
  box-sizing: border-box;
}

#counter_anchor {
  color: var(--muted) !important;
}
#counter_anchor a {
  color: var(--primary) !important;
  text-decoration: none;
}
#counter_anchor a:hover { color: var(--primary-light) !important; }

/* 主内容卡片 */
.content {
  background: var(--card) !important;
  border: 1px solid var(--border);
}
.content .right { color: var(--text) !important; }

/* 左侧 — 白底紫强调（不用蓝灰） */
.content .left {
  background: var(--card) !important;
  border-right: 1px solid var(--border);
}

.content .left h1,
.calc-sidebar-title {
  display: none !important;
}

.content .left ul,
.left-classify {
  background: var(--card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.left-classify {
  border-bottom: 1px solid var(--border) !important;
  color: var(--text) !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 14px !important;
}

.left-classify > a {
  color: var(--text) !important;
  font-weight: 600;
}
.left-classify > a:hover { color: var(--primary) !important; }

.clickadd { filter: hue-rotate(200deg) saturate(1.2); opacity: 0.7; }

.content .left ul li {
  background: var(--card) !important;
  border-bottom: 1px solid var(--border) !important;
  height: 44px !important;
  line-height: 44px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  border-right: 3px solid transparent !important;
}

.content .left ul li:hover {
  background: var(--purple-soft) !important;
  color: var(--text) !important;
}
.content .left ul li:hover a {
  color: var(--primary) !important;
}

.content .left ul li.calc-nav-active,
.content .left ul li[style*="445871"],
.content .left ul li[style*="00dbff"],
.content .left ul li[style*="1bb8d9"],
.content .left ul li[style*="5d21d1"] {
  background: var(--purple-bg) !important;
  color: var(--primary) !important;
  border-right-color: var(--primary) !important;
}

.content .left ul li a[style*="00dbff"],
.content .left ul li a[style*="color: rgb(0, 219, 255)"],
.content .left ul li.calc-nav-active a {
  color: var(--primary) !important;
}

/* 图标固定槽位 — 选中/未选中同一坐标 */
.content .left ul li a {
  color: var(--text-secondary, #6e6e73) !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding-left: 44px !important;
  text-indent: 0 !important;
  background-position: var(--calc-nav-icon-x) center !important;
  background-size: 20px 20px !important;
  background-repeat: no-repeat !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.content .left ul li a:hover,
.content .left ul li.active a,
.content .left ul li.calc-nav-active a {
  color: var(--primary) !important;
  font-weight: 600;
}

/* 覆盖 common20171116 的白色链接 */
.content .left a,
.content .left-classify a {
  color: var(--text) !important;
}

/* 右侧标题区 */
.content .right .content-title,
.content .right .title {
  background: var(--purple-bg) !important;
  color: var(--primary-dark) !important;
  font-weight: 600 !important;
  border-bottom: 1px solid var(--border) !important;
}

.content .right .right-content {
  background: var(--card) !important;
  border-top-color: var(--border) !important;
  color: var(--text) !important;
}

.content .right .right-content select,
.content .right ul select,
.content .right ul input[type="text"] {
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  background: #fff !important;
}

.content .right ul input[type="text"]:focus,
.content .right ul select:focus {
  border-color: var(--primary-light) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(93, 33, 209, 0.15);
}

/* 结果区 — 计算完成后由 JS slideDown 显示 */
.content .right .result {
  background: var(--purple-bg) !important;
  border: 1px solid rgba(93, 33, 209, 0.2) !important;
  border-radius: 12px !important;
  display: none;
  margin-bottom: 16px;
}

.content .right .store .hd {
  display: none;
}
.content .right .store .hd.is-visible {
  display: list-item !important;
}

.content .right .result .title span,
.content .right .result .title span[style*="1cb9dc"],
.content .right .result .title span[style*="color:#1cb9dc"],
.rst-font,
.content .right .result .rst-font,
span[style*="color:#1cb9dc"],
a[style*="color:#1cb9dc"],
div[style*="color:#1cb9dc"] {
  color: #1cb9dc !important;
}

.content .right .rst-list ul { background: var(--purple-soft) !important; }

/* 按钮 */
input.button,
input#count.button,
input.countAll.button,
#sug-submit {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 980px !important;
  padding: 12px 40px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(93, 33, 209, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  width: auto !important;
  min-width: 160px !important;
  height: auto !important;
  min-height: 44px !important;
  line-height: 1.25 !important;
  text-align: center !important;
  box-sizing: border-box !important;
  -webkit-appearance: none;
  appearance: none;
}
input.button:hover,
input#count.button:hover,
input.countAll.button:hover,
#sug-submit:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(93, 33, 209, 0.35);
}

/* 覆盖 duanlu.css 固定高度导致文字偏移 */
.content .right input[id=count],
.content .right input.button,
.content .right input.countAll {
  display: inline-block !important;
  vertical-align: middle !important;
}

.content .right ul li[style*="f6f6f6"] {
  background: var(--purple-bg) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  padding: 28px 16px !important;
  height: auto !important;
  min-height: 80px !important;
  margin-top: 20px !important;
  box-sizing: border-box;
}
.content .right ul li[style*="f6f6f6"] > label {
  display: none !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.content .right ul li[style*="f6f6f6"] input#count,
.content .right ul li[style*="f6f6f6"] input.button,
.content .right ul li[style*="f6f6f6"] input.countAll {
  margin: 0 auto !important;
  float: none !important;
}

.loop-text,
#loop-box .tianhua p,
#loop-box .guabi p,
#loop-box .caodi p,
#loop-box .yinzhu p {
  color: var(--primary) !important;
}

.loop1, .loop2, .loop3, .loop4 {
  border-color: rgba(93, 33, 209, 0.12) !important;
  border-radius: 8px;
  background: #fff !important;
}

/* 页脚 — 与主站 site-footer 一致，贴底 */
.calc-footer {
  background: var(--footer-bg);
  color: #aaa;
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}
.calc-footer a { color: #ccc; text-decoration: none; }
.calc-footer a:hover { color: #fff; }

@media (max-width: 768px) {
  .calc-page-hero {
    padding: 32px 16px 40px;
    min-height: 120px;
  }
  .calc-site-nav { padding: 0 12px; }
  .calc-site-nav .links a { padding: 6px 8px; font-size: 13px; }
}
