/* ============================================================
   Biz Tools — 共通デザインシステム v2 (2026-07-11)
   全ページ共通のスタイル。CSS変数でライト/ダーク切替。
   ============================================================ */

:root {
  color-scheme: light dark;

  /* ライトモード（デフォルト） */
  --primary: #0A2540;
  --primary-2: #1A3556;
  --primary-3: #2A4868;
  --primary-light: #E8EEF4;

  --money: #00B67A;
  --money-bg: #E8F8F0;
  --money-dark: #008C5E;

  --danger: #D63A5F;
  --warning: #F5A623;

  --text: #0F1E2E;
  --text-sub: #5A6B7D;
  --text-mute: #8A9AAA;

  --bg: #FFFFFF;
  --bg-soft: #F7F9FC;
  --bg-card: #FFFFFF;
  --bg-section: #F0F4F8;
  --bg-elev: #FFFFFF;

  --border: #E5E9EF;
  --border-strong: #CBD5E0;

  --accent: #E91B89;
  --accent-hover: #C71475;
  --accent-soft: #FCE7F1;

  --purple: #7B37A8;
  --blue: #5BAADE;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(10,37,64,.06), 0 1px 1px rgba(10,37,64,.04);
  --shadow: 0 4px 12px rgba(10,37,64,.08), 0 1px 3px rgba(10,37,64,.04);
  --shadow-lg: 0 12px 32px rgba(10,37,64,.12), 0 4px 12px rgba(10,37,64,.06);
  --shadow-focus: 0 0 0 3px var(--accent-soft);

  --ease: cubic-bezier(.4,0,.2,1);

  --header-h: 64px;

  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* ダークモード（システム設定 or data-theme="dark"） */
:root[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #E8EEF4;
    --primary-2: #CBD5E0;
    --primary-3: #A0AEC0;
    --primary-light: #1E2E42;

    --text: #E8EEF4;
    --text-sub: #A0AEC0;
    --text-mute: #718096;

    --bg: #0B1420;
    --bg-soft: #121C2C;
    --bg-card: #17223A;
    --bg-section: #0E1725;
    --bg-elev: #1B2842;

    --border: #253451;
    --border-strong: #364569;

    --accent-soft: #3A1C2E;
    --money-bg: #0F2A20;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 1px 1px rgba(0,0,0,.3);
    --shadow: 0 4px 12px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.25);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --primary: #E8EEF4;
  --primary-2: #CBD5E0;
  --primary-3: #A0AEC0;
  --primary-light: #1E2E42;

  --text: #E8EEF4;
  --text-sub: #A0AEC0;
  --text-mute: #718096;

  --bg: #0B1420;
  --bg-soft: #121C2C;
  --bg-card: #17223A;
  --bg-section: #0E1725;
  --bg-elev: #1B2842;

  --border: #253451;
  --border-strong: #364569;

  --accent-soft: #3A1C2E;
  --money-bg: #0F2A20;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 1px 1px rgba(0,0,0,.3);
  --shadow: 0 4px 12px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.25);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
}

/* ============================================================ Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* focus-visible */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================ Layout */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ============================================================ Header / Nav */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .header { background: var(--bg); }
  :root[data-theme="dark"] .header { background: rgba(11,20,32,.92); }
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
  max-width: 1140px; margin: 0 auto; padding: 0 24px;
}
.logo {
  font-family: var(--font-sans);
  font-weight: 800; font-size: 20px;
  color: var(--primary);
  letter-spacing: -.02em;
  display: inline-flex; align-items: center;
  text-wrap: nowrap;
}
.logo-dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  margin: 0 2px 2px 0; vertical-align: middle;
}

.nav { display: flex; gap: 24px; align-items: center; }
.nav a {
  color: var(--text-sub); font-size: 14px; font-weight: 500;
  transition: color .2s var(--ease);
}
.nav a:hover, .nav a.active { color: var(--primary); }
.nav-cta {
  background: var(--accent); color: #fff !important;
  padding: 8px 18px; border-radius: 8px; font-weight: 600;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.nav-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }

.header-tools {
  display: flex; gap: 4px; align-items: center;
  margin-left: 8px;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  color: var(--text-sub);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: var(--bg-section); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.hamburger { display: none; }

/* モバイルドロワー */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 200;
  visibility: hidden; opacity: 0;
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: opacity .25s var(--ease), visibility 0s linear .25s;
}
.mobile-drawer[data-open="true"] {
  visibility: visible; opacity: 1;
  transition: opacity .25s var(--ease), visibility 0s linear 0s;
}
.mobile-drawer-inner {
  height: 100%; overflow-y: auto;
  padding: 88px 24px 40px;
  max-width: 480px; margin: 0 auto;
}
.mobile-drawer-close {
  position: absolute; top: 16px; right: 16px;
}
.mobile-drawer h4 {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  color: var(--text-mute); text-transform: uppercase;
  margin: 28px 0 12px;
}
.mobile-drawer h4:first-child { margin-top: 0; }
.mobile-drawer ul { list-style: none; }
.mobile-drawer li { margin: 0; }
.mobile-drawer a {
  display: block;
  padding: 14px 4px;
  color: var(--primary);
  font-weight: 600; font-size: 16px;
  border-bottom: 1px solid var(--border);
  transition: color .2s var(--ease), padding .2s var(--ease);
}
.mobile-drawer a:hover { color: var(--accent); padding-left: 12px; }
.mobile-drawer .mobile-cta {
  display: block;
  margin-top: 24px;
  background: var(--accent); color: #fff !important;
  text-align: center; padding: 16px; border-radius: 10px;
  font-weight: 700; border-bottom: none !important;
}
.mobile-drawer .mobile-cta:hover { background: var(--accent-hover); padding-left: 16px; }

/* ============================================================ Search modal (Cmd+K) */
.search-modal {
  position: fixed; inset: 0; z-index: 300;
  visibility: hidden; opacity: 0;
  display: flex; align-items: flex-start; justify-content: center;
  background: rgba(10,20,32,.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  padding: 12vh 20px 40px;
  transition: opacity .2s var(--ease), visibility 0s linear .2s;
}
.search-modal[data-open="true"] {
  visibility: visible; opacity: 1;
  transition: opacity .2s var(--ease), visibility 0s linear 0s;
}
.search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  overflow: hidden;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.search-input-wrap svg { width: 18px; height: 18px; color: var(--text-mute); flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none; outline: none;
  background: transparent;
  font-size: 17px; font-weight: 500;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-mute); }
.search-hint {
  font-size: 11px; font-weight: 600;
  color: var(--text-mute);
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-soft);
}
.search-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.search-empty {
  padding: 40px 20px; text-align: center;
  color: var(--text-mute); font-size: 14px;
}
.search-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 8px;
  color: var(--text); text-decoration: none;
  transition: background .12s var(--ease);
}
.search-item:hover, .search-item[data-active="true"] { background: var(--bg-section); }
.search-item .icon { font-size: 20px; line-height: 1.4; flex-shrink: 0; }
.search-item .body { flex: 1; min-width: 0; }
.search-item .name { font-weight: 600; color: var(--primary); font-size: 14px; }
.search-item .desc { font-size: 12px; color: var(--text-sub); margin-top: 2px; line-height: 1.5; }
.search-item .cat {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 2px;
}

/* ============================================================ Breadcrumb */
.breadcrumb {
  padding: 16px 0; font-size: 13px; color: var(--text-mute);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.breadcrumb .container { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.breadcrumb a { color: var(--text-sub); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border-strong); }

/* ============================================================ Section */
.section { padding: 80px 0; }
.section-bg { background: var(--bg-section); }
.section-header { text-align: center; margin-bottom: 56px; }
.section-label {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .18em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-sans);
  font-size: clamp(26px, 3.5vw, 38px); font-weight: 800;
  color: var(--primary); letter-spacing: -.02em; line-height: 1.3;
  text-wrap: balance;
}
.section-sub {
  font-size: 16px; color: var(--text-sub);
  max-width: 600px; margin: 16px auto 0;
  text-wrap: pretty;
}

/* ============================================================ Hero */
.hero {
  padding: 96px 0 72px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  text-align: center;
}
.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(32px, 5.2vw, 54px); font-weight: 800;
  letter-spacing: -.02em; color: var(--primary); line-height: 1.15;
  margin-bottom: 20px;
  text-wrap: balance;
}
.hero h1 .accent-text { color: var(--accent); }
.hero .lead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-sub); max-width: 640px;
  margin: 0 auto 36px; line-height: 1.7;
  text-wrap: pretty;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #fff;
  padding: 16px 32px; border-radius: 12px;
  font-weight: 600; font-size: 16px;
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.hero-cta:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hero-cta:after { content: '→'; font-size: 18px; }
.hero-meta {
  display: flex; justify-content: center; gap: 32px;
  margin-top: 36px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-mute);
}
.hero-meta-item::before {
  content: '✓'; color: var(--money); font-weight: 700; margin-right: 6px;
}

/* ============================================================ Tool cards (dashboard) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  color: var(--text);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  display: flex; flex-direction: column;
  position: relative; min-height: 180px;
}
.tool-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.tool-card.featured {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--primary-light) 100%);
  border-color: var(--accent);
}
.tool-icon {
  width: 48px; height: 48px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; font-size: 24px;
}
.tool-card.featured .tool-icon { background: var(--accent-soft); }
.tool-name {
  font-size: 19px; font-weight: 700;
  color: var(--primary); margin-bottom: 8px;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.tool-desc {
  color: var(--text-sub); font-size: 13.5px;
  line-height: 1.7; margin-bottom: 18px; flex: 1;
  text-wrap: pretty;
}
.tool-link {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.tool-link:after { content: '→'; transition: transform .2s var(--ease); }
.tool-card:hover .tool-link:after { transform: translateX(4px); }
.tool-badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 8px; border-radius: 4px; text-transform: uppercase;
}

/* カテゴリセパレータ */
.tools-category {
  margin: 48px 0 20px;
  display: flex; align-items: center; gap: 16px;
}
.tools-category h3 {
  font-size: 14px; font-weight: 700; color: var(--primary);
  letter-spacing: .04em; text-wrap: nowrap;
}
.tools-category::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.tools-category:first-child { margin-top: 0; }

/* ============================================================ Why grid */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 32px; margin-top: 40px;
}
.why-item { text-align: center; padding: 0 12px; }
.why-num {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 700;
  color: var(--accent); letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.why-title { font-size: 18px; font-weight: 700; color: var(--primary); margin: 8px 0 12px; text-wrap: balance; }
.why-desc { font-size: 14px; color: var(--text-sub); line-height: 1.7; text-wrap: pretty; }

/* ============================================================ Tool page: calc UI */
.tool-hero { padding: 48px 0 32px; text-align: center; background: var(--bg); }
.tool-hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(28px, 4vw, 42px); font-weight: 800;
  color: var(--primary); letter-spacing: -.02em; line-height: 1.3;
  margin-bottom: 16px;
  text-wrap: balance;
}
.tool-hero .lead {
  font-size: 16px; color: var(--text-sub);
  max-width: 560px; margin: 0 auto;
  text-wrap: pretty;
}

.calc-section { padding: 40px 0 64px; background: var(--bg-soft); }

.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 960px) {
  .calc-layout.has-sidebar { grid-template-columns: 1fr 300px; align-items: start; }
}

.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.calc-card .card-title {
  font-size: 15px; font-weight: 700; color: var(--primary);
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  letter-spacing: -.01em;
}
.calc-row { margin-bottom: 20px; }
.calc-row:last-child { margin-bottom: 0; }
.calc-row label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13.5px; font-weight: 600; color: var(--primary);
  margin-bottom: 8px;
}
.calc-row .hint {
  font-size: 12px; color: var(--text-mute); font-weight: 400;
  margin-left: 6px;
}
.calc-row .req-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 3px;
  background: var(--accent-soft); color: var(--accent);
}
.calc-row .opt-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 3px;
  background: var(--bg-section); color: var(--text-mute);
}

.calc-input-wrap { position: relative; }
.calc-input-wrap input,
.calc-input-wrap select {
  width: 100%;
  padding: 13px 60px 13px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 17px; font-family: inherit; font-weight: 600;
  color: var(--primary);
  background: var(--bg);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  font-variant-numeric: tabular-nums;
}
.calc-input-wrap input:focus,
.calc-input-wrap select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.calc-input-wrap input:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}
.calc-input-wrap .unit {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 14px; font-weight: 600; color: var(--text-mute);
  pointer-events: none;
}
.calc-input-wrap select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A6B7D' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.calc-input-slider { margin-top: 10px; }
.calc-input-slider input[type=range] {
  width: 100%; accent-color: var(--accent);
}
.calc-input-slider .slider-marks {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-mute);
  margin-top: 4px; font-variant-numeric: tabular-nums;
}

.calc-actions {
  display: flex; gap: 12px; margin-top: 24px;
  flex-wrap: wrap;
}
.calc-btn {
  flex: 1; min-width: 140px;
  padding: 14px 20px;
  background: var(--accent); color: #fff;
  border-radius: 10px;
  font-size: 15px; font-weight: 700;
  transition: background .2s var(--ease), transform .1s var(--ease), box-shadow .2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.calc-btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.calc-btn:active { transform: translateY(0); }
.calc-btn.secondary {
  background: var(--bg-section); color: var(--primary);
  box-shadow: none;
}
.calc-btn.secondary:hover { background: var(--border); }
.calc-btn.icon-only {
  flex: 0 0 auto; min-width: auto; width: 44px; padding: 12px;
}

/* リアルタイム表示：計算ボタン省略時のインジケータ */
.calc-realtime-hint {
  font-size: 12px; color: var(--text-mute);
  margin-top: 8px; text-align: center;
  display: flex; align-items: center; gap: 6px; justify-content: center;
}
.calc-realtime-hint::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  background: var(--money); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.8); }
}

/* Tab group */
.tab-group {
  display: flex; gap: 0;
  margin-bottom: 24px;
  background: var(--bg-section);
  border-radius: 10px; padding: 4px;
}
.tab-btn {
  flex: 1; padding: 12px;
  background: transparent; border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-sub);
  transition: all .2s var(--ease);
}
.tab-btn.active {
  background: var(--bg-card); color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Radio group (税率選択のような) */
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-option { flex: 1 1 140px; position: relative; }
.radio-option input {
  position: absolute; opacity: 0; pointer-events: none;
}
.radio-option label {
  display: block;
  padding: 14px 12px;
  border: 2px solid var(--border);
  border-radius: 10px; text-align: center;
  cursor: pointer;
  transition: all .2s var(--ease);
  font-weight: 600; color: var(--text-sub);
  background: var(--bg);
}
.radio-option label:hover { border-color: var(--border-strong); }
.radio-option input:checked + label {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.radio-option input:focus-visible + label { box-shadow: var(--shadow-focus); }
.radio-option label .sub {
  display: block; font-size: 11px;
  color: var(--text-mute); font-weight: 400; margin-top: 4px;
}
.radio-option input:checked + label .sub { color: var(--accent); }

/* ============================================================ Result card */
.result-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 24px;
  min-height: 160px;
  box-shadow: var(--shadow-lg);
  position: relative;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.result-card.show { opacity: 1; transform: translateY(0); }
.result-card.placeholder {
  background: var(--bg-section);
  color: var(--text-mute);
  border: 1px dashed var(--border-strong);
  box-shadow: none;
  opacity: 1; transform: none;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.result-card.placeholder .placeholder-msg {
  font-size: 14px; color: var(--text-mute); font-weight: 500;
}

.result-label {
  font-size: 11px; font-weight: 700; letter-spacing: .18em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 8px;
}
.result-card.placeholder .result-label { color: var(--text-mute); }
.result-main {
  font-family: var(--font-sans);
  font-size: clamp(36px, 6.5vw, 60px); font-weight: 800;
  color: #fff; line-height: 1.05;
  margin-bottom: 4px;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.result-main .unit-lg { font-size: .48em; color: rgba(255,255,255,.6); margin-left: 8px; font-weight: 700; }
.result-meta {
  color: rgba(255,255,255,.7); font-size: 14px; margin-bottom: 20px;
}
.result-breakdown {
  background: rgba(255,255,255,.06);
  border-radius: 12px; padding: 18px 20px;
  margin-top: 20px;
}
.breakdown-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 14px; gap: 12px;
}
.breakdown-row:last-child { border-bottom: none; padding-bottom: 4px; }
.breakdown-row .key { color: rgba(255,255,255,.7); }
.breakdown-row .val { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.breakdown-row.highlight .val { color: var(--money); font-size: 16px; font-weight: 700; }

.result-actions {
  display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap;
}
.result-btn {
  flex: 1; min-width: 120px;
  padding: 10px 14px;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.result-btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); }
.result-btn svg { width: 14px; height: 14px; }
.result-btn.toast-success { background: var(--money); border-color: var(--money); }
.result-card.placeholder .result-actions { display: none; }

/* ============================================================ Sidebar: history */
.side-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
}
.side-card h3 {
  font-size: 13px; font-weight: 700; color: var(--primary);
  letter-spacing: .05em; text-transform: uppercase;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.side-card .clear-btn {
  font-size: 11px; color: var(--text-mute);
  padding: 2px 8px; border-radius: 4px;
  text-transform: none; letter-spacing: 0;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.side-card .clear-btn:hover { color: var(--danger); background: var(--bg-section); }
.history-list { list-style: none; }
.history-item {
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
  font-size: 12.5px;
}
.history-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.history-item .time { color: var(--text-mute); font-size: 11px; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.history-item .val { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.history-item .params { color: var(--text-sub); font-size: 11px; margin-top: 2px; }
.history-empty { color: var(--text-mute); font-size: 12px; text-align: center; padding: 12px 0; }

/* ============================================================ Content section */
.content-section { background: var(--bg); padding: 64px 0; }
.content-section h2 {
  font-family: var(--font-sans);
  font-size: clamp(22px, 3vw, 30px); font-weight: 800;
  color: var(--primary); margin-bottom: 20px;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.content-section h3 {
  font-size: 18px; font-weight: 700; color: var(--primary);
  margin: 28px 0 12px;
  text-wrap: balance;
}
.content-section p {
  color: var(--text-sub); margin-bottom: 14px;
  font-size: 15px; line-height: 1.85;
  text-wrap: pretty;
}
.content-section ul, .content-section ol {
  margin: 0 0 16px 22px; color: var(--text-sub);
  font-size: 15px; line-height: 1.9;
}
.content-section ul li, .content-section ol li { margin-bottom: 6px; }
.content-section a { color: var(--accent); text-decoration: none; font-weight: 500; }
.content-section a:hover { text-decoration: underline; }

.formula-box {
  background: var(--bg-section);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  border-radius: 8px;
  margin: 20px 0;
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 600; font-size: 14.5px;
  line-height: 1.9;
  overflow-x: auto;
  font-variant-numeric: tabular-nums;
}

.disclaimer {
  background: color-mix(in srgb, var(--warning) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 24px 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--warning) 40%, var(--text));
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .disclaimer { background: #FFF8E1; border-color: #FFE082; color: #6B5800; }
  :root[data-theme="dark"] .disclaimer { background: #3A2E10; border-color: #6B5800; color: #F5D577; }
}
.disclaimer strong { color: inherit; }

/* TOC (table of contents) */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0 32px;
}
.toc-title {
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 10px;
}
.toc ol { list-style: none; counter-reset: toc; margin: 0 !important; padding: 0 !important; }
.toc li { counter-increment: toc; margin-bottom: 4px !important; font-size: 14px !important; }
.toc li::before {
  content: counter(toc, decimal-leading-zero) '.';
  color: var(--text-mute); font-weight: 700; margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
.toc a { color: var(--text-sub); }
.toc a:hover { color: var(--accent); }

/* ============================================================ FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .2s var(--ease);
}
.faq-item[open] { border-color: var(--accent); }
.faq-q {
  padding: 18px 22px;
  font-weight: 600; font-size: 15px;
  color: var(--primary);
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  list-style: none;
  gap: 16px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:after {
  content: '+'; font-size: 22px; font-weight: 400;
  color: var(--text-mute);
  transition: transform .2s var(--ease), color .2s var(--ease);
  flex-shrink: 0;
}
.faq-item[open] .faq-q:after { transform: rotate(45deg); color: var(--accent); }
.faq-q:hover { color: var(--accent); }
.faq-a { padding: 0 22px 18px; color: var(--text-sub); font-size: 14px; line-height: 1.85; }
.faq-a a { color: var(--accent); }
.faq-a a:hover { text-decoration: underline; }

/* ============================================================ Related tools */
.related-tools { background: var(--bg-section); padding: 56px 0; }
.related-tools h2 {
  font-family: var(--font-sans);
  font-size: clamp(20px, 2.6vw, 26px); font-weight: 800;
  color: var(--primary); text-align: center; margin-bottom: 8px;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.related-tools .related-lead { text-align: center; color: var(--text-sub); font-size: 14px; margin-bottom: 24px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  display: block;
}
.related-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: var(--accent);
}
.related-card .name { font-weight: 700; color: var(--primary); margin-bottom: 4px; font-size: 15px; }
.related-card .desc { font-size: 13px; color: var(--text-sub); line-height: 1.6; }

/* ============================================================ Ad slot */
.ad-slot {
  margin: 40px auto;
  text-align: center;
  min-height: 90px;
  max-width: 728px;
  padding: 0 24px;
}
.ad-slot::before {
  content: 'Sponsored'; display: block;
  font-size: 10px; letter-spacing: .1em; color: var(--text-mute);
  margin-bottom: 4px; text-transform: uppercase;
}

/* ============================================================ Footer */
.footer {
  background: var(--primary);
  color: #BCC9D6;
  padding: 56px 0 32px;
  font-size: 14px;
}
:root[data-theme="dark"] .footer { background: #030812; }
.footer .container { max-width: 1140px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-logo { font-family: var(--font-sans); font-weight: 800; font-size: 22px; color: #fff; margin-bottom: 12px; }
.footer-desc { line-height: 1.7; color: #8A9AAA; max-width: 360px; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 16px; font-weight: 600; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer a { color: #BCC9D6; transition: color .15s var(--ease); }
.footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 16px; color: #8A9AAA; font-size: 13px;
}
.kappy-network { padding: 0 0 32px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 36px; }
.network-label {
  font-size: 11px; color: #8A9AAA; letter-spacing: .15em;
  text-transform: uppercase; margin-bottom: 14px; font-weight: 600;
}
.network-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.net-tag {
  display: inline-block; padding: 7px 13px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  color: #BCC9D6 !important;
  font-size: 12px;
  transition: all .18s var(--ease);
}
.net-tag:hover { background: rgba(255,255,255,.1); color: #fff !important; border-color: rgba(255,255,255,.2); }

/* ============================================================ Article (cashless/funding style) */
article.long-article {
  max-width: 800px; margin: 0 auto;
  padding: 48px 24px 80px;
}
article.long-article h1 {
  font-size: clamp(24px, 3.2vw, 32px); font-weight: 800;
  line-height: 1.4; color: var(--primary);
  margin-bottom: 14px; letter-spacing: -.01em;
  text-wrap: balance;
}
article.long-article .lead {
  font-size: 16.5px; color: var(--text-sub);
  line-height: 1.9;
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  margin: 22px 0 36px;
  text-wrap: pretty;
}
article.long-article h2 {
  font-size: 21px; font-weight: 800;
  color: var(--primary);
  margin: 52px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  letter-spacing: -.01em;
  text-wrap: balance;
}
article.long-article h3 { font-size: 17px; font-weight: 700; color: var(--primary); margin: 26px 0 10px; text-wrap: balance; }
article.long-article p { font-size: 15px; color: var(--text); margin-bottom: 14px; text-wrap: pretty; }
article.long-article ul, article.long-article ol { padding-left: 24px; margin-bottom: 18px; }
article.long-article li { font-size: 15px; color: var(--text); margin-bottom: 10px; line-height: 1.85; }
article.long-article a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
article.long-article .tbl-wrap { overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch; }
article.long-article table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13.5px; background: var(--bg-card); }
article.long-article th, article.long-article td {
  border: 1px solid var(--border);
  padding: 10px 12px; text-align: left; vertical-align: top;
  line-height: 1.7;
}
article.long-article th { background: var(--primary); color: #fff; font-weight: 700; white-space: nowrap; }
article.long-article td strong { color: var(--primary); }
article.long-article .src { font-size: 11.5px; color: var(--text-mute); }

.verified-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: #0F6E4E;
  background: var(--money-bg);
  border: 1px solid #BFE8D4;
  border-radius: 999px;
  padding: 5px 14px 5px 10px;
  margin: 0 0 22px 10px;
  font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 1px 0 rgba(0,182,122,.05), 0 2px 8px rgba(0,182,122,.08);
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}
:root[data-theme="dark"] .verified-badge {
  color: #6EDDA9; border-color: #1F4A38;
}
.verified-badge::before {
  content: "✓";
  display: inline-flex; width: 16px; height: 16px;
  align-items: center; justify-content: center;
  background: var(--money); color: #fff;
  border-radius: 50%; font-size: 10px; font-weight: 900;
  flex-shrink: 0;
}
.verified-badge a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================ Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--primary); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 400;
  display: inline-flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast.success { background: var(--money); }
.toast.error { background: var(--danger); }

/* ============================================================ Responsive */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .nav { display: none; }
  .icon-btn.hamburger { display: inline-flex; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 56px 0; }
  .section-header { margin-bottom: 40px; }
  .hero-meta { gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .calc-card { padding: 24px 18px; }
  .result-card { padding: 24px 18px; }
  .result-actions { gap: 6px; }
  .result-btn { min-width: 100px; padding: 10px 8px; font-size: 12px; }
  .tools-grid { grid-template-columns: 1fr; }
  .search-modal { padding: 8vh 12px 20px; }
}
@media (max-width: 480px) {
  .header-inner { padding: 0 16px; }
  .logo { font-size: 18px; }
  .icon-btn { width: 36px; height: 36px; }
  .container-narrow { padding: 0 16px; }
  article.long-article { padding: 32px 16px 60px; }
}

/* 印刷用 */
@media print {
  .header, .footer, .ad-slot, .nav, .mobile-drawer, .search-modal, .toast, .result-actions, .related-tools, .kappy-network { display: none !important; }
  body { background: #fff; color: #000; }
  .calc-card, .result-card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  .result-card { background: #f5f5f5 !important; color: #000 !important; }
  .result-main, .breakdown-row .val, .result-meta, .result-label { color: #000 !important; }
}
