 :root {
      --primary-color: #0057b7;
      --primary-light: #e6f0fa;
      --background-color: #f8f9fa;
      --card-bg-color: #ffffff;
      --text-color: #333333;
      --heading-color: #1a1a1a;
      --subtle-text: #5f6368;
      --separator-color: #e0e0e0;
      --border-radius: 12px;
      --nav-height: 65px;
      --font-family-base: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Segoe UI", "Helvetica Neue", sans-serif;
    }

    /* 基本重置與防溢出 */
    *, *::before, *::after { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      font-family: var(--font-family-base);
      margin: 0;
      background-color: var(--background-color);
      color: var(--text-color);
      line-height: 1.75;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow-x: hidden;
      word-break: break-word;
    }
    body.nav-open { overflow: hidden; }

    /* 版心 */
    .container { max-width: 1100px; margin: 0 auto; padding: 0 20px 40px; }


    h1, h2, h3 { color: var(--heading-color); font-weight: 700; letter-spacing: 0.5px; }
    h1 { font-size: 2.6rem; text-align: center; margin: 30px 0 15px; }
    .page-subtitle {
      text-align: center; font-size: 1.1rem; color: var(--subtle-text);
      margin-bottom: 50px; max-width: 680px; margin-left: auto; margin-right: auto;
    }

    h2 {
      font-size: 2rem; margin: 0 0 25px 0;
      display: flex; align-items: center; gap: 14px;
    }
    h2 .icon {
      display: inline-flex; justify-content: center; align-items: center;
      width: 40px; height: 40px;
      background-color: var(--primary-light);
      border-radius: 8px;
      color: var(--primary-color);
    }
    h2 .icon svg { width: 22px; height: 22px; }
    h3 { font-size: 1.5rem; margin-top: 30px; margin-bottom: 15px; color: var(--primary-color); }

    /* === 導航欄 (Mobile-First) === */
    .main-nav {
      background-color: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--separator-color);
      position: sticky; top: 0; z-index: 1000;
      height: var(--nav-height); display: flex; align-items: center;
    }
    .nav-content {
      max-width: 1100px; margin: 0 auto; display: flex;
      justify-content: space-between; align-items: center;
      width: 100%; padding: 0 20px;
    }
    .nav-logo { font-weight: 700; font-size: 1.4rem; color: var(--heading-color); text-decoration: none; z-index: 1011; }
    
    .nav-links {
        position: fixed; top: 0; left: 0;
        width: 100%; height: 100vh;
        background-color: var(--card-bg-color);
        display: flex; flex-direction: column;
        justify-content: center; align-items: center;
        transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
        transform: translateX(100%); z-index: 1005;
    }
    .nav-links.is-active { transform: translateX(0); }
    .nav-links a { margin: 20px 0; font-size: 1.5rem; color: var(--heading-color); font-weight: 700; text-decoration: none; }
    
    .mobile-nav-toggle { display: block; background: transparent; border: none; cursor: pointer; padding: 10px; z-index: 1010; }
    .mobile-nav-toggle .bar { display: block; width: 25px; height: 3px; background-color: var(--heading-color); margin: 5px 0; transition: all 0.3s ease-in-out; }
    .mobile-nav-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-nav-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .mobile-nav-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    @media (min-width: 1025px) {
        .nav-links { position: static; transform: none; background-color: transparent; flex-direction: row; height: auto; width: auto; transition: none; }
        .nav-links a { margin: 0 0 0 25px; font-size: 1rem; font-weight: 500; color: var(--subtle-text); }
        .nav-links a:hover { color: var(--primary-color); }
        .mobile-nav-toggle { display: none; }
    }

    /* 佈局 */
    .sticky-layout-container { display: grid; grid-template-columns: 1fr 420px; gap: 40px; align-items: flex-start; margin-top: 30px; }
    .content-column { min-width: 0; }
    .calculator-wrapper { position: sticky; top: calc(var(--nav-height) + 30px); min-width: 0; }
    @media (max-width: 1024px) {
      .sticky-layout-container { grid-template-columns: 1fr; }
      .calculator-wrapper { order: -1; position: static; margin-bottom: 40px; }
      h1 { font-size: 2.2rem; }
      h2 { font-size: 1.8rem; }
    }

    /* 【新增】內容卡片化佈局 */
    .content-section-card {
        background-color: var(--card-bg-color);
        border: 1px solid var(--separator-color);
        border-radius: var(--border-radius);
        padding: 30px 35px;
        margin-bottom: 30px;
        box-shadow: 0 4px 30px rgba(0,0,0,0.04);
    }
    .content-section-card p, .content-section-card ul, .content-section-card ol { max-width: 75ch; }
    .content-section-card > *:last-child { margin-bottom: 0; }
    
    /* 【美化】「如何使用」的步驟列表 */
    .steps-list { padding-left: 0; list-style: none; counter-reset: steps-counter; }
    .steps-list li { counter-increment: steps-counter; margin-bottom: 1.25rem; display: flex; align-items: flex-start; gap: 12px; }
    .steps-list li::before {
        content: counter(steps-counter);
        font-weight: 700;
        font-size: 0.9rem;
        color: var(--primary-color);
        background-color: var(--primary-light);
        border-radius: 50%;
        width: 28px;
        height: 28px;
        flex-shrink: 0;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        margin-top: 4px;
    }

    /* 【美化】FAQ 手風琴樣式 */
    .faq-accordion details {
        border-bottom: 1px solid var(--separator-color);
        padding: 18px 5px;
    }
    .faq-accordion details:last-child { border-bottom: none; }
    .faq-accordion summary {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--heading-color);
        cursor: pointer;
        list-style: none; /* 移除預設的箭頭 */
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .faq-accordion summary::-webkit-details-marker { display: none; }
    .faq-accordion summary::after { /* 自訂箭頭 */
        content: '›';
        font-size: 1.8rem;
        font-weight: 700;
        color: var(--primary-color);
        transform: rotate(0);
        transition: transform 0.2s;
        margin-left: 10px;
    }
    .faq-accordion details[open] summary::after { transform: rotate(90deg); }
    .faq-accordion .faq-answer {
        padding: 10px 5px 0 5px;
        margin-top: 8px;
        color: var(--subtle-text);
    }
    .faq-accordion .faq-answer p { margin: 0; line-height: 1.8; }
    
    /* 計算機 & 其他元件樣式 */
    .calculator-app-card { background-color: var(--card-bg-color); border-radius: var(--border-radius); padding: 30px; box-shadow: 0 4px 60px rgba(0, 0, 0, 0.05); border: 1px solid var(--separator-color); }
    .tabs { display: flex; background-color: #e9e9ed; border-radius: 8px; padding: 5px; margin-bottom: 25px; }
    .tab-button { flex: 1; padding: 12px; border: none; background-color: transparent; border-radius: 6px; font-size: 1rem; font-weight: 500; color: var(--subtle-text); cursor: pointer; transition: all 0.25s ease; }
    .tab-button.active { background-color: var(--card-bg-color); color: var(--primary-color); font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    .form-group { margin-bottom: 20px; }
    .form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.95rem; }
    .form-group input { width: 100%; padding: 14px; border: 1px solid var(--separator-color); border-radius: 8px; font-size: 1.1rem; background: var(--background-color); transition: border-color 0.2s, box-shadow 0.2s; }
    .form-group input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-light); outline: none; }
    #monthly-group { transition: opacity 0.3s ease, max-height 0.3s ease, margin-bottom 0.3s ease; overflow: hidden; }
    .calculate-btn { width: 100%; padding: 16px; background: linear-gradient(45deg, var(--primary-color), #007bff); color: white; border: none; border-radius: 8px; font-size: 1.2rem; font-weight: 700; cursor: pointer; transition: transform 0.1s, box-shadow 0.2s; }
    .calculate-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 87, 183, 0.25); }
    .results-dashboard { margin-top: 30px; text-align: center; }
    .summary-container { background: var(--primary-light); padding: 25px; border-radius: var(--border-radius); }
    .summary-final-amount { font-size: 2.5rem; font-weight: 700; color: var(--primary-color); margin: 5px 0 15px; }
    .summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
    .summary-item { font-size: 1rem; color: var(--subtle-text); }
    .summary-item span { display: block; font-weight: 700; color: var(--heading-color); font-size: 1.2rem; }
    .chart-container { margin-top: 30px; min-height: 280px; }
    .cta-buttons { display:flex; gap:12px; justify-content:center; margin-top:20px; }
    .cta-buttons button { padding: 10px 22px; background-color: #e9e9ed; color: var(--primary-color); border: none; border-radius: 8px; font-weight: 500; cursor: pointer; transition: background-color 0.2s; }
    .cta-buttons button:hover { background-color: #dcdce1; }
    .info-card { background-color: var(--background-color); padding: 25px; border-radius: var(--border-radius); border: 1px solid var(--separator-color); margin-top: 20px; }
    .table-wrapper { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1.25rem; border: 1px solid var(--separator-color); border-radius: 8px; }
    table { width: 100%; border-collapse: collapse; font-size: 0.85rem; text-align: center; background: var(--card-bg-color); }
    table caption { caption-side: top; text-align: left; font-weight: 600; padding: 8px 12px; background: #f5f7fa; font-size: 0.95rem; color: #334e68; }
    table thead th { padding: 10px 12px; background: #eef7ff; border-bottom: 1px solid #d1dbe8; font-weight: 600; position: sticky; top: 0; z-index: 2; }
    table th, table td { border-right: 1px solid var(--separator-color); }
    table th:last-child, table td:last-child { border-right: none; }
    table tbody td { padding: 8px 12px; border-bottom: 1px solid #e2e8f0; }
    table tbody tr:nth-child(odd) { background: #fbfcfe; }
    code { background: #f0f4f9; padding: 6px 10px; border-radius: 6px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85rem; display: inline-block; margin: 4px 0; border: 1px solid #d1dbe8; }
    .explanation h3 { margin-top: 1rem; font-size: 1.25rem; }
    .explanation p { margin: 0.65rem 0; font-size: 0.95rem; }
    strong { color: #111f3b; }
    .load-example-btn { background-color: var(--primary-color); color: white; border: none; padding: 10px 18px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; cursor: pointer; margin-top: 15px; transition: background-color 0.2s, transform 0.1s; }
    .load-example-btn:hover { background-color: #007bff; transform: translateY(-1px); }
    
    .site-footer { background-color: #e9ecef; color: var(--subtle-text); padding: 40px 20px; margin-top: 60px; border-top: 1px solid var(--separator-color); text-align: center; font-size: 0.9rem; }
    .footer-content { max-width: 1100px; margin: 0 auto; }
    .footer-links { margin-bottom: 15px; }
    .footer-links a { color: var(--subtle-text); text-decoration: none; margin: 0 15px; transition: color 0.2s; }
    .footer-links a:hover { color: var(--primary-color); }
    .footer-copyright { opacity: 0.8; }
    
    /* 深色模式 */
    @media (prefers-color-scheme: dark) {
      body { background: #0f172a; color: #c8d0ea; }
      h1, h2, h3 { color: #f0f4ff; }
      :root { --background-color: #0f172a; --card-bg-color: #1e293b; --text-color: #c8d0ea; --heading-color: #f0f4ff; --subtle-text: #94a3b8; --separator-color: #334155; --primary-light: rgba(59, 130, 246, 0.1); }
      .main-nav { background-color: rgba(15, 23, 42, 0.85); border-bottom-color: var(--separator-color); }
      .nav-links a { color: var(--heading-color); }
      .mobile-nav-toggle .bar { background-color: #e3eaff; }
      @media (min-width: 1025px) { .nav-links a { color: var(--subtle-text); } .nav-links a:hover { color: #a7c5ff; } }
      .info-card { border-color: var(--separator-color); background-color: #28364f; }
      .faq-accordion summary { color: var(--heading-color); }
      .faq-accordion .faq-answer { color: var(--subtle-text); }
      .faq-accordion details { border-color: var(--separator-color); }
      table { background: #1a2745; }
      table caption { background: #1f2d53; color: #d0d9ff; }
      table thead th { background: #1f2d53; color: #e3eaff; border-bottom-color: #2f406f; }
      table tbody td { border-bottom-color: #2f406f; }
      table tbody tr:nth-child(odd) { background: #1e293b; }
      table th, table td { border-right-color: #2f406f; }
      .table-wrapper { border-color: var(--separator-color); }
      code { background: #1e2d5a; border: 1px solid #2f3f87; color: #d8e3ff; }
      strong { color: #f0f4ff; }
      .site-footer { background-color: #1e293b; border-top-color: var(--separator-color); color: var(--subtle-text); }
      .footer-links a { color: var(--subtle-text); }
    }
