/* ===========================
   CSS 變數與基礎設定
   =========================== */
:root {
    /* 主色調 - 橘色系 */
    --primary: #f97316;
    --primary-light: #fb923c;
    --primary-dark: #ea580c;

    /* 四種編碼方法的代表顏色 */
    --color-label: #f472b6;
    --color-onehot: #60a5fa;
    --color-ordinal: #a78bfa;
    --color-freq: #34d399;
    /* emerald 綠色 */
    --color-target: #f59e0b;
    /* amber 琥珀色 — Target Encoding */

    /* 背景與表面 */
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --surface: rgba(30, 41, 59, 0.8);
    --surface-light: rgba(51, 65, 85, 0.6);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* 文字顏色 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* 狀態顏色 */
    --success: #22c55e;
    --warning: #fbbf24;
    --error: #ef4444;

    /* 圓角與動畫 */
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===========================
   頁首
   =========================== */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--glass);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ===========================
   步驟區塊 — 每個教學步驟
   =========================== */
.step-section {
    margin-bottom: 2.5rem;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.step-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===========================
   第一步：問題展示
   =========================== */
.problem-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.problem-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.problem-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.problem-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

.problem-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.problem-visual {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.translate-demo {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.translate-before,
.translate-after {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.translate-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.translate-items {
    display: flex;
    gap: 0.5rem;
}

.text-badge {
    padding: 0.5rem 0.75rem;
    background: var(--surface-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.num-badge {
    padding: 0.5rem 0.85rem;
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-light);
    font-family: 'Courier New', monospace;
}

.translate-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 600;
}

.arrow-icon {
    font-size: 1.5rem;
}

/* ===========================
   第二步：資料選擇區
   =========================== */
.data-area {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.data-controls {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.func-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.func-select:hover,
.func-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.func-select option {
    background: var(--bg-gradient-end);
    color: var(--text-primary);
}

.custom-input-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--glass);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--glass-border);
}

.custom-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.custom-input-group {
    display: flex;
    gap: 0.5rem;
}

.name-input {
    width: 110px;
    padding: 0.55rem 0.75rem;
    background: var(--surface-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--primary-light);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition);
}

.value-input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    background: var(--surface-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.name-input:focus,
.value-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.name-input::placeholder,
.value-input::placeholder {
    color: var(--text-muted);
}

.button-group {
    display: flex;
    gap: 0.75rem;
}

.btn-primary {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(249, 115, 22, 0.5);
}

.btn-reset {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-reset:hover {
    background: var(--glass-border);
    transform: translateY(-2px);
}

/* 原始資料卡片 */
.original-data-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
}

.original-data-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.table-wrapper {
    overflow-x: auto;
}

.placeholder-text {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.95rem;
}

/* ===========================
   表格樣式（通用）
   =========================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background: var(--surface-light);
    color: var(--primary-light);
    padding: 0.65rem 0.75rem;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    white-space: nowrap;
}

.data-table td {
    padding: 0.55rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: var(--glass);
}

.data-table td.hot {
    color: var(--color-onehot);
    font-weight: 700;
}

/* 特徵顏色標記 */
.data-table th.feature-1 {
    border-bottom-color: var(--color-label);
    color: var(--color-label);
}

.data-table th.feature-2 {
    border-bottom-color: var(--color-onehot);
    color: var(--color-onehot);
}

.data-table th.feature-3 {
    border-bottom-color: var(--color-ordinal);
    color: var(--color-ordinal);
}

/* ===========================
   三種方法的區塊
   =========================== */
.method-section {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.method-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.method-header.label-theme {
    background: rgba(244, 114, 182, 0.08);
    border-bottom: 2px solid var(--color-label);
}

.method-header.onehot-theme {
    background: rgba(96, 165, 250, 0.08);
    border-bottom: 2px solid var(--color-onehot);
}

.method-header.ordinal-theme {
    background: rgba(167, 139, 250, 0.08);
    border-bottom: 2px solid var(--color-ordinal);
}

.method-header.freq-theme {
    background: rgba(52, 211, 153, 0.08);
    border-bottom: 2px solid var(--color-freq);
}

.method-header.target-theme {
    background: rgba(245, 158, 11, 0.08);
    border-bottom: 2px solid var(--color-target);
}

.method-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.label-bg {
    background: var(--color-label);
}

.onehot-bg {
    background: var(--color-onehot);
}

.ordinal-bg {
    background: var(--color-ordinal);
}

.freq-bg {
    background: var(--color-freq);
}

.target-bg {
    background: var(--color-target);
}

.method-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.method-body {
    padding: 1.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.method-explain {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 核心想法 */
.method-idea {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: var(--glass);
    border-radius: var(--radius-sm);
}

.idea-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.method-idea strong {
    font-size: 0.9rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.method-idea p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 範例區塊 */
.method-example-box {
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--text-muted);
}

.method-example-box.label-border {
    border-left-color: var(--color-label);
}

.method-example-box.onehot-border {
    border-left-color: var(--color-onehot);
}

.method-example-box.ordinal-border {
    border-left-color: var(--color-ordinal);
}

.method-example-box.freq-border {
    border-left-color: var(--color-freq);
}

.method-example-box.target-border {
    border-left-color: var(--color-target);
}

.example-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.example-flow {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.flow-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.flow-text {
    padding: 0.25rem 0.6rem;
    background: var(--surface-light);
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 500;
}

.flow-arrow {
    color: var(--text-muted);
}

.flow-num {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

.label-num {
    background: rgba(244, 114, 182, 0.15);
    color: var(--color-label);
}

.onehot-num {
    background: rgba(96, 165, 250, 0.15);
    color: var(--color-onehot);
}

.ordinal-num {
    background: rgba(167, 139, 250, 0.15);
    color: var(--color-ordinal);
}

.freq-num {
    background: rgba(52, 211, 153, 0.15);
    color: var(--color-freq);
}

.target-num {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-target);
}

/* One-Hot 範例表格 */
.onehot-example {
    overflow-x: auto;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.mini-table th {
    padding: 0.4rem 0.5rem;
    background: var(--surface-light);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.mini-table td {
    padding: 0.35rem 0.5rem;
    text-align: center;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-table td.hot {
    color: var(--color-onehot);
    font-weight: 700;
    background: rgba(96, 165, 250, 0.1);
}

/* 警告 / 優缺點 / 重點 */
.method-warning,
.method-key {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.method-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.method-warning p {
    color: var(--text-secondary);
    margin: 0;
}

.method-key {
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.method-key p {
    color: var(--text-secondary);
    margin: 0;
}

.method-pros-cons {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.pros {
    color: var(--success);
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.cons {
    color: var(--warning);
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
}

/* 編碼結果區 */
.method-result {
    display: flex;
    flex-direction: column;
}

.method-result h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* ===========================
   第四步：速查表
   =========================== */
/* 速查表三欄（加4之前預設） */
.decision-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* 速查表四欄 */
.decision-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 速查表五欄 */
.decision-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.decision-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
    border-top: 3px solid var(--text-muted);
}

.decision-card.label-border {
    border-top-color: var(--color-label);
}

.decision-card.onehot-border {
    border-top-color: var(--color-onehot);
}

.decision-card.ordinal-border {
    border-top-color: var(--color-ordinal);
}

.decision-card.freq-border {
    border-top-color: var(--color-freq);
}

.decision-card.target-border {
    border-top-color: var(--color-target);
}

.decision-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.decision-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.decision-when,
.decision-avoid {
    margin-bottom: 0.75rem;
}

.decision-when strong {
    font-size: 0.85rem;
    color: var(--success);
    display: block;
    margin-bottom: 0.3rem;
}

.decision-avoid strong {
    font-size: 0.85rem;
    color: var(--error);
    display: block;
    margin-bottom: 0.3rem;
}

.decision-when ul,
.decision-avoid ul {
    list-style: none;
    padding: 0;
}

.decision-when li,
.decision-avoid li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0.15rem 0 0.15rem 1rem;
    position: relative;
}

.decision-when li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--success);
}

.decision-avoid li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--error);
}

/* 判斷流程圖 */
.flowchart-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.flowchart-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    text-align: center;
}

.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.fc-node {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

.fc-question {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid var(--primary);
    color: var(--primary-light);
}

.fc-answer {
    font-size: 0.85rem;
    color: white;
}

.ordinal-answer {
    background: var(--color-ordinal);
}

.onehot-answer {
    background: var(--color-onehot);
}

.label-answer {
    background: var(--color-label);
}

.freq-answer {
    background: var(--color-freq);
}

.target-answer {
    background: var(--color-target);
}

.fc-branches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

.fc-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.fc-label {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
}

.yes-label {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.no-label {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.fc-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.fc-sub {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.fc-sub-branches {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.25rem;
}

.fc-sub-branch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.fc-sub-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.fc-sub-branch .fc-arrow {
    font-size: 0.9rem;
}

.fc-sub-branch .fc-node {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* ===========================
   Frequency Encoding 專屬元件
   =========================== */

/* Frequency 範例表格的頻率編碼値欄 */
.mini-table td.freq-val {
    color: var(--color-freq);
    font-weight: 700;
    background: rgba(52, 211, 153, 0.1);
}

/* ===========================
   Target Encoding 專屬元件
   =========================== */

/* Target 範例表格的目標編碼値欄 */
.mini-table td.target-val {
    color: var(--color-target);
    font-weight: 700;
    background: rgba(245, 158, 11, 0.1);
}

/* Target Encoding 的目標值輸入區 */
.target-input-section {
    margin-top: 0.75rem;
    padding: 0.85rem;
    background: rgba(245, 158, 11, 0.06);
    border: 1px dashed rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
}

.target-input-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-target);
    margin-bottom: 0.5rem;
}

.target-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.target-input-row input {
    flex: 1;
    min-width: 120px;
    padding: 0.55rem 0.75rem;
    background: var(--surface-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.target-input-row input:focus {
    outline: none;
    border-color: var(--color-target);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.target-input-row input::placeholder {
    color: var(--text-muted);
}

.btn-target {
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, var(--color-target), #d97706);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-target:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Target Encoding 的 warning/info 區塊 */
.method-target-info {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.method-target-info p {
    color: var(--text-secondary);
    margin: 0;
}

/* ===========================
   第五步：注意事項
   =========================== */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.tip-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
    transition: var(--transition);
}

.tip-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.tip-icon {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.tip-card h4 {
    font-size: 0.95rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.tip-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===========================
   頁尾
   =========================== */
.footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    color: var(--text-muted);
}

.footer p {
    margin-bottom: 0.75rem;
}

.back-home {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-home:hover {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-2px);
}

/* ===========================
   響應式設計
   =========================== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .problem-showcase {
        grid-template-columns: 1fr;
    }

    .method-body {
        grid-template-columns: 1fr;
    }

    .decision-grid,
    .decision-grid-4,
    .decision-grid-5 {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }

    .fc-branches {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .translate-demo {
        flex-direction: column;
    }

    .translate-arrow {
        flex-direction: row;
    }

    .custom-input-group {
        flex-direction: column;
    }

    .name-input {
        width: 100%;
    }

    .target-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-target {
        width: 100%;
    }
}