/* buy2330.com - 高級明亮財經報刊極簡風格樣式表 */

/* 變數宣告 (明亮模式 + 禁用藍紫色) */
:root {
    --bg-light: #fafafa;
    --card-bg: #ffffff;
    --border-light: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --brand-orange: #d9531e; /* 台積橘紅 */
    --brand-slate: #1e293b;  /* 碳深灰 */
    --accent-gold: #c2410c;  /* 琥珀深橘金 */
    
    --text-main: #111827;    /* 近純黑 */
    --text-muted: #4b5563;   /* 中碳灰 */
    --text-light: #9ca3af;   /* 淺灰 */
    
    --tw-up: #dc2626;        /* 台灣股市紅色為漲 */
    --tw-down: #16a34a;      /* 台灣股市綠色為跌 */
    
    --orange-gradient: linear-gradient(135deg, #f97316 0%, #d9531e 100%);
}

/* 基礎設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Microsoft JhengHei", sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 0;
}

/* 晶圓網格背景 (極淡灰色) */
.wafer-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.005) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.005) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 數值專用字型 */
.number-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Google AdSense 預留區樣式 (報紙小邊框廣告感) */
.ad-slot {
    background-color: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 12px;
    text-align: center;
    margin-bottom: 25px;
}

.ad-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ad-placeholder {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.top-ad {
    margin-top: 25px;
}

/* 標頭樣式 (極簡報刊排版) */
header {
    padding: 40px 0 25px 0;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid var(--text-main);
}

.header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}

.logo-icon {
    font-size: 2.2rem;
    color: var(--brand-orange);
}

header h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 2.4rem;
    letter-spacing: -0.5px;
    color: var(--brand-slate);
    text-transform: uppercase;
}

header .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    max-width: 600px;
    margin: 5px auto 0 auto;
}

/* 網格佈局 */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

main.container > section {
    margin-bottom: 25px;
}

/* 幾何俐落卡片 (Bloomberg 質感) */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 25px;
    box-shadow: none; /* 去除陰影 */
    transition: border-color 0.2s ease;
}

.card:hover {
    border-color: var(--border-hover);
}

.card h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--brand-slate);
    padding-bottom: 10px;
    color: var(--brand-slate);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 行情與指標項目 */
.price-grid, .analysis-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.price-item, .analysis-item {
    padding: 14px 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center; /* 垂直居中對齊，讓結構更統一 */
    min-height: 85px;    /* 強制所有卡片長方形高度一致 */
    gap: 16px;
    position: relative;
    box-sizing: border-box;
}

.price-item::before, .analysis-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: transparent;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    flex: 1;
}

.price-item .label, .analysis-item .label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.item-value-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    min-width: 145px; /* 保證數值在同一行不拆行 */
}

.price-item .value, .analysis-item .value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

.price-item .change, .analysis-item .change {
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 4px;
    line-height: 1.2;
}

.price-item .subtext, .analysis-item .subtext {
    max-width: none;
    margin-top: 4px;
}

/* 卡片高亮（改為精緻左側線條，底色微調） */
.highlight-orange {
    background-color: #fdfaf8;
    border-color: var(--border-light);
}
.highlight-orange::before {
    background-color: var(--brand-orange);
}

.highlight-slate {
    background-color: #f8fafc;
    border-color: var(--border-light);
}
.highlight-slate::before {
    background-color: var(--brand-slate);
}

/* 漲跌色系 */
.change.up {
    color: var(--tw-up);
}
.change.up::before {
    content: "▲ ";
}

.change.down {
    color: var(--tw-down);
}
.change.down::before {
    content: "▼ ";
}

.subtext {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    margin-top: 3px;
    max-width: 250px;
    line-height: 1.3;
}

.update-time {
    font-size: 0.72rem;
    color: var(--text-light);
    text-align: right;
    margin-top: 15px;
    font-family: 'Outfit', sans-serif;
}

/* 大聯盟概念股看板 */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--brand-slate);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.card-header-flex h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.toggle-buttons {
    display: flex;
    background-color: #f1f5f9;
    border-radius: 2px;
    padding: 2px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.1s;
}

.tab-btn.active {
    background-color: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.alliance-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
}

.alliance-table th, .alliance-table td {
    padding: 10px 6px;
    border-bottom: 1px solid var(--border-light);
}

.alliance-table th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
}

.alliance-table tbody tr:hover {
    background-color: #fcfcfc;
}

.alliance-role {
    display: inline-block;
    padding: 1px 5px;
    background-color: #f1f5f9;
    color: var(--brand-slate);
    border: 1px solid var(--border-light);
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 600;
}

.alliance-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-light);
    padding: 10px 12px;
    border-radius: 2px;
    font-size: 0.8rem;
    border: 1px solid var(--border-light);
}

/* 籌碼與股東結構版塊 */
.holder-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
}

.holder-left h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.structure-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.structure-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.item-info .name {
    color: var(--text-muted);
}

.item-info .pct {
    font-weight: 700;
    color: var(--text-main);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #f1f5f9;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease-in-out;
}

.holder-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: stretch;
}

.holder-tile {
    flex: 1;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 2px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* 居中對齊內容 */
    text-align: center;
}

.tile-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tile-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.tile-sub {
    font-size: 0.68rem;
    margin-top: 1px;
}

/* ==========================================
 * 今日信仰充值中心 (Futuristic Silicon Wafer UI)
 * ========================================== */
.faith-card-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
    padding: 10px 0;
}

.faith-action-area {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* 晶圓感長方形按鈕 */
.wafer-rect-button {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: 1px solid var(--brand-slate);
    background-color: var(--brand-slate);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: 4px;
    transition: all 0.2s;
}

/* 晶圓網格紋理 */
.wafer-mesh {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0/12px 12px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0/12px 12px;
    pointer-events: none;
    z-index: 1;
}

.wafer-chip-icon {
    font-size: 1.1rem;
    color: #ffe8cc;
    z-index: 2;
    transition: transform 0.5s ease;
}

.wafer-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    z-index: 2;
}

/* 按鈕互動特效 */
.wafer-rect-button:hover {
    background-color: #0f172a;
    border-color: #0f172a;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.15);
}

.wafer-rect-button:hover .wafer-chip-icon {
    transform: scale(1.1) rotate(5deg);
}

.wafer-rect-button:active {
    transform: scale(0.98);
}

/* 統計資訊區 */
.faith-stats-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.stats-box {
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: border-color 0.2s;
}

.stats-box:hover {
    border-color: var(--border-hover);
}

.stats-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 0;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--brand-slate);
    line-height: 1;
    margin-bottom: 0;
}

.stats-unit {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 700;
}

.faith-quote {
    text-align: center;
    font-style: italic;
    margin-top: 8px;
    color: var(--text-light);
    font-size: 0.8rem;
}

.faith-quote {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 12px;
    text-align: center;
    font-weight: 500;
}

/* ==========================================
 * 明日走勢信仰投票 (Premium Card Poll UI)
 * ========================================== */
.poll-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

/* 精緻卡片式按鈕 */
.poll-btn {
    flex: 1;
    padding: 16px 8px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background-color: #ffffff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.poll-btn i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.poll-btn-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--text-main);
}

.poll-btn-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* 投票按鈕互動樣式 */
.poll-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}

.poll-btn.btn-up {
    color: var(--tw-up);
}
.poll-btn.btn-up:hover {
    border-color: rgba(220, 38, 38, 0.4);
    background-color: #fef2f2;
}

.poll-btn.btn-down {
    color: var(--tw-down);
}
.poll-btn.btn-down:hover {
    border-color: rgba(22, 163, 74, 0.4);
    background-color: #f0fdf4;
}

.poll-btn.btn-hold {
    color: var(--brand-slate);
}
.poll-btn.btn-hold:hover {
    border-color: rgba(30, 41, 59, 0.3);
    background-color: #f8fafc;
}

.poll-btn:active {
    transform: translateY(0);
}

.poll-results h3 {
    font-size: 0.8rem;
    margin-bottom: 15px;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--border-light);
    padding-bottom: 8px;
}

/* 現代化條形圖 */
.result-bar-container {
    margin-bottom: 16px;
}

.result-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.bar-up { background-color: var(--tw-up) !important; }
.bar-down { background-color: var(--tw-down) !important; }
.bar-hold { background-color: var(--brand-slate) !important; }

.total-votes {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
}

/* 定期定額計算器 */
.calculator-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 20px 30px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 15px;
}

.calculator-layout .form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    transition: all 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-orange);
}

/* 幾何橘色按鈕 */
.btn {
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
}

.btn-primary-gradient {
    color: #ffffff;
    background-color: var(--brand-orange);
    border: 1px solid var(--brand-orange);
}

.btn-primary-gradient:hover {
    background-color: #c2410c;
    border-color: #c2410c;
}

.calc-inputs button {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
}

.result-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.result-tile {
    padding: 12px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
}

.result-tile.highlight-border {
    border-color: #ffedd5;
    background-color: #fffaf8;
}

.tile-value {
    font-size: 1.15rem;
    margin-top: 4px;
    color: var(--brand-slate);
}

.tile-value.text-orange {
    font-size: 1.3rem;
}

.badge-display {
    margin-top: 20px;
    padding: 12px;
    background: rgba(22, 163, 74, 0.04);
    border: 1px solid rgba(22, 163, 74, 0.12);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.badge-title {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge-value {
    font-weight: 700;
    color: var(--tw-down);
}

/* 成長圖表 */
.chart-container-wrapper {
    margin-top: 25px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 20px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* FAQ 手風琴 */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.faq-item {
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--card-bg);
    transition: all 0.15s;
}

.faq-question {
    width: 100%;
    border: none;
    outline: none;
    padding: 15px 20px;
    background-color: var(--card-bg);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--brand-slate);
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: all 0.15s;
}

.faq-question:hover {
    background-color: #fafafa;
}

.faq-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s, color 0.2s;
}

.faq-item.active {
    border-color: #ffedd5;
}

.faq-item.active .faq-question {
    background-color: #fffaf8;
    color: var(--brand-orange);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--brand-orange);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    background-color: #fafafa;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 15px 20px;
    border-top: 1px solid #ffedd5;
}

.faq-answer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}


/* K線圖區塊 */
.kline-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--brand-slate);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.kline-header-row h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.kline-container {
    width: 100%;
    height: auto; /* 由 JS 產生的 iframe 高度撐開 (桌機 600px / 手機 400px) */
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

/* 大股東排行榜並排版面 */
.leaderboards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.leaderboard-column {
    flex: 1;
}

.column-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-slate);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 信仰對帳單分享牆 (寬版雙欄) */
.wall-layout-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-top: 20px;
    align-items: start;
}

.statement-form-container {
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 20px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.statement-form-container button {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
}

.statement-list-container {
    flex: 1;
}

.list-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    color: var(--brand-slate);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid var(--border-light);
    background-color: var(--bg-light);
    color: var(--text-muted);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-sm:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
}

.btn-sm.btn-active {
    background: var(--brand-slate);
    color: #ffffff;
    border-color: transparent;
}

.statement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
}

.statement-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.statement-card:hover {
    border-color: var(--border-hover);
}

.statement-author {
    font-weight: 700;
    color: var(--brand-orange);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.statement-date {
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    color: var(--text-light);
}

.statement-stats {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.stat-item {
    background-color: var(--bg-light);
    padding: 5px 8px;
    border-radius: 2px;
    border: 1px solid var(--border-light);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-val {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--brand-slate);
}

.statement-msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    word-break: break-all;
    flex-grow: 1;
    line-height: 1.4;
}



/* 排行榜分頁 */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    position: relative;
}

.leaderboard-item:hover {
    background-color: var(--card-bg);
    border-color: var(--border-hover);
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.68rem;
    margin-right: 12px;
    font-family: 'Outfit', sans-serif;
}

.rank-1 { background-color: #fff7ed; color: var(--brand-orange); border: 1px solid #ffedd5; }
.rank-2 { background-color: #f8fafc; color: var(--brand-slate); border: 1px solid var(--border-light); }
.rank-3 { background-color: #fffbeb; color: var(--accent-gold); border: 1px solid #fef3c7; }
.rank-other { background-color: #f1f5f9; color: var(--text-muted); border: 1px solid #e2e8f0; }

.rank-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.rank-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
}

.rank-title {
    font-size: 0.68rem;
    padding: 2px 5px;
    background-color: var(--card-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: 2px;
    font-weight: 600;
}

.rank-value-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.leaderboard-tips {
    display: flex;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    background-color: var(--bg-light);
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    margin-top: 15px;
}

/* 排行榜分頁按鈕 */
.leaderboard-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-light);
}

.leaderboard-pagination .btn-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid var(--border-light);
    background-color: var(--bg-light);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.leaderboard-pagination .btn-page:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
}

.leaderboard-pagination .btn-page.active {
    background-color: var(--brand-slate);
    color: #ffffff;
    border-color: transparent;
}

/* 頁尾 */
footer {
    margin-top: 60px;
    background-color: var(--brand-slate);
    color: #94a3b8;
    padding: 35px 0;
    text-align: center;
}

footer p {
    font-size: 0.8rem;
    margin-bottom: 8px;
}

footer .disclaimer {
    font-size: 0.7rem;
    margin-top: 12px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.7;
    color: #64748b;
}

/* ==========================================
 * 移動端響應式適配樣式 (Mobile First / Responsive)
 * ========================================== */
@media (max-width: 992px) {
    body {
        padding-bottom: 0;
    }
    
    header {
        padding: 30px 0 15px 0;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    /* 雙欄佈局在平板/手機上改為垂直堆疊 */
    .grid-2, .leaderboards-grid, .wall-layout-grid, .calculator-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .holder-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .holder-right {
        flex-direction: row;
        gap: 15px;
    }
    
    .holder-tile {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 12px;
    }
    
    .card {
        padding: 18px;
    }
    
    .card h2 {
        font-size: 1.05rem;
        margin-bottom: 15px;
    }

    /* 信仰充值中心統計字型微調 */
    .stats-value {
        font-size: 1.5rem;
    }
    
    /* 大盤與個股數據字體縮減，並垂直堆疊避免擠壓 */
    .price-item, .analysis-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 15px;
    }

    .item-value-group {
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
        min-width: unset;
        margin-top: 4px;
    }

    .price-item .value, .analysis-item .value {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .price-item .change, .analysis-item .change {
        margin-top: 0;
    }
    
    .counter-value {
        font-size: 1.7rem;
    }
    
    .holder-right {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 表格自適應滾動保護 */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* iOS 流暢滾動 */
        border: 1px solid var(--border-light);
        border-radius: 2px;
    }
    
    .alliance-table {
        min-width: 480px; /* 強制設定最小寬度，防止手機端擠壓過窄 */
    }
    
    .alliance-table th, .alliance-table td {
        padding: 10px 8px;
    }
    
    /* 表單在小螢幕改為垂直堆疊 */
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .statement-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .poll-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .poll-btn {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        padding: 10px;
    }
    
    /* 觸控區域拉大 */
    .form-control, .btn, .poll-btn, .faq-question {
        min-height: 44px; /* 符合移動端最小觸控標準 */
    }

    /* 排行榜在小螢幕防止文字擠壓 */
    .rank-name-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .rank-title {
        align-self: flex-start;
    }
    .rank-value-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-top: 6px;
    }
    .rank-value-row span {
        margin-bottom: 2px;
    }

    /* 定期定額計算結果在小螢幕改為單欄，避免溢出 */
    .result-card-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

}

/* 計算器分頁標籤與通用顯隱工具 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center !important;
}

.calc-tab-group {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.calc-tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-tab-btn:hover {
    color: var(--text-main);
}

.calc-tab-btn.active {
    color: var(--brand-orange);
    border-bottom-color: var(--brand-orange);
}

/* 新的雙欄計算機佈局 */
.calculator-layout-new {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 30px;
    margin-bottom: 15px;
}

.calculator-layout-new .form-group {
    margin-bottom: 0;
}

.calc-footer-row {
    grid-column: 1 / span 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

#faith-badge-container {
    flex: 1;
    display: flex;
    flex-direction: row; /* 橫向顯示，不折行 */
    align-items: center;
    justify-content: flex-start;
    background-color: #f0fdf4; /* 淺綠色背景 */
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    padding: 0 20px;
    height: 48px; /* 固定高度 */
    margin-top: 0; /* 覆蓋 .badge-display 的 margin-top: 20px */
    gap: 8px;
    white-space: nowrap; /* 強制在同一行延伸 */
}

#faith-badge-container .badge-title {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0; /* 覆蓋原本垂直模式的 margin */
}

#faith-badge-container .badge-value {
    font-weight: 800;
    color: #16a34a; /* 綠色 */
    font-size: 0.88rem;
}

.badge-placeholder {
    flex: 1;
}

.calc-btn-container {
    flex-shrink: 0;
    text-align: right;
}

.calc-btn-container button {
    width: auto;
    min-width: 180px;
    padding: 0 24px;
    height: 48px; /* 固定高度與信仰徽章相同 */
}

@media (max-width: 768px) {
    .calculator-layout-new {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .calc-footer-row {
        grid-column: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    #faith-badge-container {
        flex-direction: column; /* 手機端垂直排列 */
        align-items: flex-start;
        white-space: normal; /* 手機端允許折行 */
        padding: 12px;
        height: auto; /* 手機端自適應高度 */
        gap: 4px;
    }
    .badge-placeholder {
        display: none;
    }
    .calc-btn-container {
        text-align: left;
    }
    .calc-btn-container button {
        width: 100%;
        height: 48px; /* 保持 48px 行高 */
        padding: 0 24px;
    }
}

/* K線圖即時數值圖例面版 (Legend Overlay) */
.chart-legend {
    position: absolute;
    left: 15px;
    top: 15px;
    z-index: 10;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 0.78rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-date {
    font-weight: 800;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 4px;
    margin-bottom: 4px;
    color: var(--text-main);
}

.legend-item {
    display: block;
}

.legend-ma-section {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-ma-section span {
    display: block;
}

/* 行動端額外響應式適配 */
@media (max-width: 576px) {
    /* K線圖例在手機端改為橫向排列，避免遮擋圖表 */
    .chart-legend {
        left: 5px;
        top: 5px;
        right: 5px;
        padding: 4px 8px;
        font-size: 0.65rem;
        background-color: rgba(255, 255, 255, 0.96);
        border: 1px solid var(--border-light);
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 2px 8px;
        line-height: 1.2;
    }
    
    .legend-date {
        font-weight: 800;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    .legend-item {
        display: inline-block;
    }
    
    .legend-ma-section {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0 8px;
        width: 100%; /* 讓 MA 數值自成一列 */
        border-top: 1px dashed var(--border-light);
        padding-top: 2px;
        margin-top: 2px;
    }

    .legend-ma-section span {
        display: inline;
    }

    /* 大聯盟概念股表格在手機端改為卡片式排列，免除水平滾動 */
    .alliance-table {
        min-width: unset !important;
    }

    .alliance-table, 
    .alliance-table thead, 
    .alliance-table tbody, 
    .alliance-table th, 
    .alliance-table td, 
    .alliance-table tr { 
        display: block; 
    }
    
    .alliance-table thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .alliance-table tr {
        border: 1px solid var(--border-light);
        border-radius: 4px;
        margin-bottom: 12px;
        padding: 6px 10px;
        background-color: #ffffff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.01);
    }
    
    .alliance-table td { 
        border: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        padding-left: 35% !important; 
        text-align: right;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        min-height: 38px;
    }
    
    .alliance-table td:last-child {
        border-bottom: none;
    }
    
    .alliance-table td:before { 
        position: absolute;
        top: 8px;
        left: 8px;
        width: 30%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.72rem;
    }
    
    .alliance-table td:nth-of-type(1):before { content: "名稱 (代號)"; }
    .alliance-table td:nth-of-type(2):before { content: "今日價格"; }
    .alliance-table td:nth-of-type(3):before { content: "關係地位"; }
    .alliance-table td:nth-of-type(4):before { content: "變動原因"; }
}

/* Card stretch for Today's Faith Recharge Center */
#faith-card {
    display: flex;
    flex-direction: column;
}

#faith-card .faith-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 0 10px 0; /* 增加上下內距，使其高寬協調 */
    box-sizing: border-box;
}

/* 累積數據展示盒 (KPI 大儀表風格) */
.stats-box {
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
    min-height: 140px; /* 固定最小高度，使佔據合理空間 */
}

.stats-box:hover {
    border-color: var(--border-hover);
}

.stats-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.stats-value-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.stats-value {
    font-size: 3.6rem; /* 超大數字 */
    font-weight: 900;
    color: var(--brand-slate);
    line-height: 1;
}

.stats-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 700;
}

.faith-quote {
    text-align: center;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 12px 15px;
    background-color: #f8fafc;
    border: 1px dashed var(--border-light);
    border-radius: 4px;
    margin: 15px 0;
    width: 100%;
    box-sizing: border-box;
}

/* 信仰充值按鈕 - 大按鈕設計 */
.wafer-rect-button {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 80px; /* 加高至 80px */
    border: 1px solid var(--brand-slate);
    background-color: var(--brand-slate);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.15rem;
    border-radius: 4px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.wafer-mesh {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0/12px 12px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0/12px 12px;
    pointer-events: none;
    z-index: 1;
}

.wafer-chip-icon {
    font-size: 1.5rem;
    color: #ffe8cc;
    z-index: 2;
    transition: transform 0.5s ease;
}

.wafer-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    z-index: 2;
}

.wafer-rect-button:hover {
    background-color: #0f172a;
    border-color: #0f172a;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.15);
}

.wafer-rect-button:hover .wafer-chip-icon {
    transform: scale(1.15) rotate(5deg);
}

.wafer-rect-button:active {
    transform: scale(0.98);
}

/* 信仰許願池 / 功能投稿區樣式 */
#wishlist-section {
    margin-top: 25px;
    margin-bottom: 30px;
}

.wishlist-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 15px;
}

/* 單列水平等高表單 */
.wishlist-form-new {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.wish-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wish-form-group.flex-1 {
    flex: 1;
}

.wish-form-group.flex-2 {
    flex: 2.5;
}

.wish-form-group.flex-btn {
    flex-shrink: 0;
}

.wish-form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
}

.form-control-wish {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    height: 44px;
    box-sizing: border-box;
    transition: all 0.15s;
}

.form-control-wish:focus {
    outline: none;
    border-color: var(--brand-orange);
}

.wish-btn {
    height: 44px;
    min-width: 140px;
    box-sizing: border-box;
    padding: 0 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* 願願清單顯示 */
.wishes-display-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wishes-display-area h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--brand-slate);
    border-bottom: 1px dashed var(--border-light);
    padding-bottom: 8px;
    margin-bottom: 5px;
}

.wishes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wish-item {
    background-color: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.01);
    animation: fade-in-up 0.5s ease forwards;
}

.wish-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 4px;
}

.wish-nickname {
    font-weight: 700;
    color: var(--brand-orange);
}

.wish-date {
    color: var(--text-light);
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
}

.wish-content {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-all;
    text-align: left;
}

/* 手機端響應式調整 */
@media (max-width: 768px) {
    .wishlist-form-new {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px;
    }
    
    .wish-form-group {
        width: 100%;
    }
    
    .wish-btn {
        width: 100%;
        height: 44px;
    }
}
