/* ============================================================
   我的小破站 - 主样式表（深墨绿 + 金色高端风）
   ============================================================ */

:root {
  --bg: #0d2b1a;
  --bg-alt: #0f2e1c;
  --card: #143828;
  --card-hover: #1a422e;
  --border: rgba(201, 169, 97, 0.18);
  --text: #f0ede5;
  --text-muted: #8fa88a;
  --primary: #c9a961;
  --primary-light: #d4b978;
  --accent: #e8d5a3;
  --gradient: linear-gradient(135deg, #b8934a, #c9a961, #e8d5a3);
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --transition: all 0.3s ease;
  --nav-height: 68px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: "Inter", "Noto Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

/* 计算器等内容较宽的区块：充分利用页面横向空间 */
.container-wide {
  width: min(1400px, 95%);
  margin: 0 auto;
}

/* ---------- 渐变文字（金色） ---------- */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================================
   导航栏
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.navbar.scrolled {
  background: #0b2416;
  border-bottom-color: rgba(201, 169, 97, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.brand-logo-img {
  display: inline-block;
  height: 40px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

.brand-name {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-radius: 8px;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(201, 169, 97, 0.1);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(201, 169, 97, 0.12);
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   Hero 区域（深墨绿纯色 + 金色大标题 + 底部插画）
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--nav-height) + 40px) 0 0;
  background: var(--bg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg .orb,
.hero-bg .grid-overlay {
  display: none;
}

.hero-inner {
  text-align: center;
  position: relative;
  z-index: 1;
  padding-bottom: 20px;
}

.hero-tag {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid rgba(201, 169, 97, 0.35);
  border-radius: 999px;
  background: rgba(201, 169, 97, 0.08);
  color: var(--primary-light);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 22px;
  color: var(--text);
}

.hero-title .gradient-text {
  font-weight: 900;
}

.cursor {
  display: inline-block;
  color: var(--primary);
  font-weight: 400;
  animation: blink 0.9s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

.btn {
  display: inline-block;
  padding: 13px 36px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient);
  color: var(--bg);
  box-shadow: 0 10px 30px rgba(201, 169, 97, 0.25);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(201, 169, 97, 0.4);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

/* 底部房屋插画 */
.hero-house {
  width: 100%;
  max-width: 720px;
  margin: 10px auto 0;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

.hero-house img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* 滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.8;
}

.mouse {
  display: block;
  width: 26px;
  height: 42px;
  border: 2px solid var(--text-muted);
  border-radius: 16px;
  position: relative;
}

.wheel {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  border-radius: 3px;
  background: var(--text-muted);
  animation: scroll 1.8s ease-in-out infinite;
}

@keyframes scroll {
  0% { opacity: 1; transform: translate(-50%, 0); }
  70% { opacity: 0; transform: translate(-50%, 12px); }
  100% { opacity: 0; }
}

/* ============================================================
   通用区块
   ============================================================ */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  text-align: center;
  margin-bottom: 60px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--text);
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* ============================================================
   关于我
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  transition: var(--transition);
}

.about-card:hover {
  transform: translateY(-8px);
  background: var(--card-hover);
  border-color: rgba(201, 169, 97, 0.4);
  box-shadow: var(--shadow);
}

.about-icon {
  font-size: 2.6rem;
  margin-bottom: 16px;
}

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  color: var(--text);
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================================
   开发项目
   ============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(201, 169, 97, 0.4);
  box-shadow: var(--shadow);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.project-icon {
  font-size: 2.2rem;
}

.project-status {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(201, 169, 97, 0.12);
  color: var(--primary);
  border: 1px solid rgba(201, 169, 97, 0.3);
}

.project-status:last-child {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.project-card h3 {
  font-size: 1.12rem;
  margin-bottom: 10px;
  color: var(--text);
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
  flex: 1;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.project-tags span {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(201, 169, 97, 0.1);
  color: var(--primary-light);
  border: 1px solid rgba(201, 169, 97, 0.2);
}

.project-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.92rem;
  transition: var(--transition);
}

.project-link:hover {
  letter-spacing: 0.5px;
}

/* ============================================================
   API 接口
   ============================================================ */
.api-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.api-item {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 24px;
  transition: var(--transition);
}

.api-item:hover {
  border-color: rgba(201, 169, 97, 0.4);
  transform: translateX(6px);
}

.api-method {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 7px;
  background: rgba(201, 169, 97, 0.15);
  color: var(--primary);
  letter-spacing: 0.5px;
}

.api-method.get { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.api-method.post { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }

.api-info {
  flex: 1;
  min-width: 0;
}

.api-info code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(201, 169, 97, 0.1);
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-block;
  word-break: break-all;
}

.api-info p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 6px;
}

.api-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.api-footer {
  text-align: center;
  margin-top: 30px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================================
   云服务
   ============================================================ */
.cloud-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.cloud-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: var(--transition);
}

.cloud-card:hover {
  transform: translateY(-6px);
  background: var(--card-hover);
  border-color: rgba(201, 169, 97, 0.35);
  box-shadow: var(--shadow);
}

.cloud-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
}

.cloud-logo.aliyun { background: linear-gradient(135deg, #ff6a00, #ff9a44); }
.cloud-logo.tencent { background: linear-gradient(135deg, #0085ff, #00c6ff); }
.cloud-logo.baidu { background: linear-gradient(135deg, #2932e1, #4e6ef2); }
.cloud-logo.github { background: linear-gradient(135deg, #24292f, #57606a); }

.cloud-info {
  flex: 1;
  min-width: 0;
}

.cloud-info h3 {
  font-size: 1rem;
  margin-bottom: 2px;
  color: var(--text);
}

.cloud-info p {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cloud-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: var(--transition);
}

.cloud-card:hover .cloud-arrow {
  color: var(--primary);
  transform: translate(3px, -3px);
}

/* ============================================================
   联系方式
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 860px;
  margin: 0 auto;
}

.contact-card {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  transition: var(--transition);
}

.contact-card:hover {
  transform: translateY(-8px);
  border-color: rgba(201, 169, 97, 0.4);
  box-shadow: var(--shadow);
}

/* 微信卡片 */
.wechat-card {
  cursor: default;
}

.wechat-card:hover {
  transform: translateY(-8px);
}

.wechat-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.wechat-qr {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px;
  transition: transform 0.3s ease;
  display: block;
  margin: 0 auto;
}

.wechat-card:hover .wechat-qr {
  transform: scale(1.06);
}

.contact-icon {
  display: inline-block;
  font-size: 2rem;
  margin-bottom: 12px;
}

.contact-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--text);
}

.contact-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
  background: #0b2416;
  border-top: 1px solid var(--border);
  padding: 60px 0 0;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-brand h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-links h4 {
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: var(--text);
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.icp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  white-space: nowrap;
}

.icp-link {
  color: var(--text-muted);
  transition: var(--transition);
}

.icp-link:hover {
  color: var(--primary);
}

.icp-sep {
  margin: 0 6px;
  color: var(--text-muted);
  opacity: 0.6;
}

.mps-link {
  /* display: inline-flex; */
  display: flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1;
}

.mps-logo {
  width: 16px;
  height: 17.2875px;
  object-fit: contain;
  opacity: 0.75;
  transition: var(--transition);
}

.mps-link:hover .mps-logo {
  opacity: 1;
}

/* ============================================================
   回到顶部
   ============================================================ */
.back-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: var(--transition);
  z-index: 90;
}

.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--gradient);
  color: var(--bg);
  border-color: transparent;
}

/* ============================================================
   滚动入场动画
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 992px) {
  .about-grid,
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cloud-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(13, 43, 26, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 10px 6vw 20px;
    transform: translateY(-120%);
    transition: transform 0.35s ease;
    visibility: hidden;
  }

  .nav-links.open {
    transform: translateY(0);
    visibility: visible;
  }

  .nav-link {
    padding: 13px 16px;
    font-size: 1rem;
  }

  .section {
    padding: 72px 0;
  }

  .about-grid,
  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 30px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .api-item {
    flex-wrap: wrap;
  }

  .hero-house {
    max-width: 90vw;
  }
}

@media (max-width: 480px) {
  .cloud-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* ---------- 减少动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .wheel {
    animation: none;
  }
}

/* ============================================================
   导航「小工具」下拉菜单
   ============================================================ */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.caret {
  font-size: 0.72rem;
  transition: transform 0.3s ease;
}

.nav-dropdown.open .caret {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 176px;
  padding: 7px;
  margin: 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 20;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: rgba(201, 169, 97, 0.12);
  color: var(--primary);
}

.dropdown-ico {
  font-size: 1rem;
}

/* ============================================================
   房贷计算器（页面内嵌）
   ============================================================ */
.calc-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calc-body {
  padding: 26px;
}

/* ---------- 计算器布局 ---------- */
.calc-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 28px;
}

.calc-form,
.calc-result {
  min-width: 0; /* 允许在窄屏收缩，避免被表格等宽内容撑破 */
}

@media (max-width: 1240px) {
  .calc-grid {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 22px;
  }
}

.calc-form {
  display: block;
}

.field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.seg-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 9px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.seg-btn.is-active {
  background: var(--gradient);
  color: var(--bg);
  font-weight: 600;
}

.chips {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ---------- 带单位切换的输入项 ---------- */
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.field-head .field-label {
  margin-bottom: 0;
}

.segmented-sm {
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 10px;
}

.segmented-sm .seg-btn {
  flex: 0 0 auto;
  padding: 5px 14px;
  font-size: 0.82rem;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 46px;
}

.input-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.88rem;
  color: var(--text-muted);
  pointer-events: none;
}

.field-hint {
  margin-top: 8px;
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--text-muted);
  opacity: 0.85;
}

/* ---------- 组合贷款（商业 + 公积金） ---------- */
.combo-block {
  margin-bottom: 4px;
}

.combo-group {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.combo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.combo-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.combo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.combo-row .field {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .combo-row {
    grid-template-columns: 1fr;
  }
}

.combo-block .field-hint {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(201, 169, 97, 0.08);
  opacity: 1;
}

.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.chip.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(201, 169, 97, 0.12);
}

.calc-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn-block {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.95rem;
  text-align: center;
  border: none;
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  border-radius: 999px;
}

.btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.calc-tip {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.85;
}

/* ---------- 结果区 ---------- */
.calc-result {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.result-empty {
  padding: 44px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.result-error {
  padding: 14px;
  border-radius: 10px;
  background: rgba(220, 80, 80, 0.12);
  border: 1px solid rgba(220, 80, 80, 0.35);
  color: #ffb4b4;
  font-size: 0.88rem;
}

/* 组合贷拆分说明单独一行，不参与五个数据项的统一排版 */
.result-note {
  display: block;
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.result-note:empty {
  display: none;
}

/* 容器查询需建立在父级上：查询条件不能作用于容器元素自身 */
.result-stats-wrap {
  container-type: inline-size;
}

.result-stats {
  display: grid;
  /* 月供 + 总额/利息/总还款/期数 五项并列，月供在最左 */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.rs-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.rs-item > span {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rs-item strong {
  font-size: 1.02rem;
  /* 同一行放五项，数值字号随容器收窄而自适应，避免拥挤换行 */
  font-size: clamp(0.62rem, 2.75cqi, 1.02rem);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rs-item strong .v-short,
.rs-item > span .v-short {
  display: none;
}

/* 月供数字后的补充说明小字（如「每月递减 7.18」）：放不下时换行显示，不挤压主数字 */
.rs-value-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 4px;
  row-gap: 2px;
  min-width: 0;
}

.rs-value-row strong {
  flex: 0 1 auto;
  min-width: 0;
}

.rs-note {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rs-note:empty {
  display: none;
}

/* 容器过窄时改用「万元」简写并压缩间距，尽量保持五项同一行 */
@container (max-width: 700px) {
  .rs-item strong .v-full,
  .rs-item > span .v-full {
    display: none;
  }

  .rs-item strong .v-short,
  .rs-item > span .v-short {
    display: inline;
  }
}

@container (max-width: 580px) {
  .result-stats {
    gap: 8px;
  }

  .rs-item {
    padding: 10px 8px;
  }

  .rs-item > span {
    font-size: 0.74rem;
  }
}

@container (max-width: 470px) {
  .result-stats {
    gap: 6px;
  }

  .rs-item {
    padding: 8px 6px;
  }

  .rs-item > span {
    font-size: 0.7rem;
  }
}

/* 极窄容器（小屏手机）下五项已无法并排，改为三列换行，避免数值被省略号截断 */
@container (max-width: 420px) {
  .result-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container (max-width: 380px) {
  .result-stats {
    gap: 5px;
  }

  .rs-item {
    padding: 8px 5px;
  }

  .rs-item > span {
    font-size: 0.66rem;
  }
}

/* 对比信息：单行紧凑小字，不再占用独立区块 */
.result-compare {
  margin: 8px 0 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.result-compare:empty {
  display: none;
}

.result-compare b {
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.schedule {
  margin-top: 16px;
}

.sum-jump {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.sum-jump:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* 图标按钮：去掉文字标签后固定宽度保持原有点击区域与布局，文案改由悬浮气泡提示 */
.sum-jump.jump-icon {
  position: relative;
  width: 90px;
  text-align: center;
  font-size: 1rem;
  line-height: 18px;
}

.sum-jump.jump-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 5;
}

.sum-jump.jump-icon:hover::after,
.sum-jump.jump-icon:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 分页导航：首年 / 指定年份 / 尾年，与「尾年」按钮保持同一套视觉 */
.schedule-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.jump-to {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.jump-input,
.jump-select {
  /* 年份选项为纯数字，宽度容纳两位数 + 下拉箭头即可 */
  width: 100px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-family: inherit;
  transition: var(--transition);
}

.jump-input:focus,
.jump-select:focus {
  outline: none;
  border-color: var(--primary);
  color: var(--primary);
}

.jump-select option {
  /* 下拉展开的原生列表必须用不透明深色背景：此前引用了不存在的
     --card-bg 变量，导致回退为浏览器默认白底 + 浅色文字，几乎不可读 */
  background: var(--card);
  color: var(--text);
}

.jump-hint {
  flex: 1 0 100%;
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.jump-hint.is-error {
  color: #e2696a;
}

.sum-jump:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sum-jump:disabled:hover {
  color: var(--text-muted);
  border-color: var(--border);
}

/* 跳转目标行高亮，作为跳转成功后的视觉反馈 */
.schedule-table tbody tr.is-target td {
  background: rgba(201, 169, 97, 0.16);
  color: var(--text);
}

/* 末页不足 12 行时的补位空行：保持每页高度一致，翻页时不跳动 */
.schedule-table tbody tr.is-filler td {
  background: transparent;
}

.schedule-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  /* 行高变量：固定每行 28px + 1px 分隔线，每页 12 行（一年） */
  --sch-row-h: 28px;
}

.schedule-scroll {
  /* 按年分页后每页固定 12 行，无需纵向滚动：禁用垂直滚动条，
     内容通过「首年 / 年份下拉 / 尾年」分页访问；窄屏保留横向滚动 */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 169, 97, 0.35) transparent;
}

.schedule-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.schedule-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.schedule-scroll::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 97, 0.35);
  border-radius: 4px;
}

.schedule-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 97, 0.55);
}

.schedule-table {
  width: 100%;
  /* 7 列（含月份列）后的最小宽度 */
  min-width: 720px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 10px;
  color: var(--primary);
  font-weight: 600;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.schedule-table th,
.schedule-table td {
  padding: 10px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 固定行高：纵向内边距归零、用 line-height 垂直居中，保证 12 行高度可精确计算 */
.schedule-table td {
  height: var(--sch-row-h);
  padding: 0 10px;
  line-height: var(--sch-row-h);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.schedule-table th:first-child,
.schedule-table td:first-child,
/* 月份列（YYYYMM）与期数列同样居中显示 */
.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) {
  text-align: center;
}

/* 列宽：期数 / 月份略窄，其余均分，保证表头与表体严格对齐 */
.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1) { width: 52px; }
.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) { width: 68px; }
.schedule-table th:nth-child(3),
.schedule-table td:nth-child(3) { width: 100px; }
.schedule-table th:nth-child(4),
.schedule-table td:nth-child(4) { width: 100px; }
.schedule-table th:nth-child(5),
.schedule-table td:nth-child(5) { width: 100px; }
.schedule-table th:nth-child(6),
.schedule-table td:nth-child(6) { width: 100px; }
.schedule-table th:nth-child(7),
.schedule-table td:nth-child(7) {
  width: 100px;
}

.schedule-table tbody tr:hover td {
  background: rgba(201, 169, 97, 0.06);
  color: var(--text);
}

/* ---------- 计算器响应式 ---------- */
@media (max-width: 900px) {
  .calc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-dropdown {
    display: flex;
    flex-direction: column;
  }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 13px 16px;
    font-size: 1rem;
  }

  .dropdown-menu {
    position: static;
    display: none;
    min-width: 0;
    padding: 0 0 4px 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-dropdown.open .dropdown-menu {
    display: block;
  }

  .calc-body {
    padding: 18px 16px;
  }
}

@media (max-width: 480px) {
  .calc-actions {
    flex-direction: column;
  }
}
