/* ================================================================
   🏝️ 動物島主題 (Animal Island Theme) — 學生端第四主題
   設計語言來源：animal-island-ui v0.9.4
   核心美學：暖色羊皮紙 + 藥丸形狀 + 3D 按鈕陰影 + 自然色卡
   ================================================================ */

[data-theme="animal"] {
    /* === 基礎色彩 — 暖色羊皮紙調 === */
    --bg-color: #fef9e7;              /* 暖白羊皮紙背景 */
    --text-color: #5d4e37;            /* 深棕色文字 #725d42 變體 */
    --primary-color: #3b7a6b;         /* 動物島森林綠 */
    --secondary-color: #f7cd67;       /* 暖金黃 app-yellow */

    /* === 佈局 === */
    --header-bg: #3b7a6b;             /* 森林綠頂欄 */
    --header-text: #fef9e7;           /* 羊皮紙色文字 */
    --sidebar-bg: #faf5e4;            /* 淺羊皮紙側欄 */
    --sidebar-border: #d4c5a0;        /* 暖棕邊框 */

    /* === 卡片 === */
    --card-bg: #fdf8ed;               /* 卡片羊皮紙 */
    --card-border: #d4c5a0;           /* 暖棕卡片邊框 */
    --card-shadow: rgba(93, 78, 55, 0.12);

    /* === 輸入框 === */
    --input-bg: #fffef9;
    --input-border: #c4b89a;
    --input-focus: #3b7a6b;

    /* === 菜單色彩（柔和自然色） === */
    --menu-home: #5c9a8b;             /* 柔和森林綠 */
    --menu-notice: #e8a850;           /* 暖橘 */
    --menu-read: #6dbd8a;             /* app-green 變體 */
    --menu-makeup: #e5736e;           /* app-red 變體 */
    --menu-history: #9b7ec4;          /* 柔和紫 */
    --menu-rank: #e8c84a;             /* 金黃 */
    --menu-profile: #5da8a0;          /* 淺藍綠 */
}

/* ================================================================
   1. 按鈕系統 — 藥丸形狀 + 3D 底部陰影（核心身份）
   ================================================================ */

/* 基礎按鈕類 */
.ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 50px;              /* 藥丸形狀 — 絕不設定 border-radius: 0 */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    text-decoration: none;
    line-height: 1.4;
    /* 3D 底部陰影 — 動物島核心身份標識 */
    box-shadow: 0 4px 0 rgba(0,0,0,0.15), 0 6px 12px rgba(0,0,0,0.08);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Hover：浮起 + 陰影加深 */
.ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.12);
}

/* Active：按壓下沉 */
.ai-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.08);
    transition: all 0.05s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ai-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 3px 0 rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
}

/* --- 按鈕大小 --- */
.ai-btn-sm {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 40px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
}
.ai-btn-sm:hover { box-shadow: 0 5px 0 rgba(0,0,0,0.12), 0 7px 14px rgba(0,0,0,0.08); }
.ai-btn-sm:active { box-shadow: 0 1px 0 rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.06); }

.ai-btn-lg {
    padding: 14px 36px;
    font-size: 18px;
    border-radius: 60px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.1);
}
.ai-btn-lg:hover { box-shadow: 0 8px 0 rgba(0,0,0,0.15), 0 14px 28px rgba(0,0,0,0.14); }
.ai-btn-lg:active { box-shadow: 0 3px 0 rgba(0,0,0,0.15), 0 5px 10px rgba(0,0,0,0.1); }

.ai-btn-block {
    display: flex;
    width: 100%;
}

/* --- 按鈕類型配色 --- */

/* Primary — 森林綠 */
.ai-btn-primary {
    background: #3b7a6b;
    color: #fff;
}
.ai-btn-primary:hover {
    background: #347064;
}

/* Default — 暖色羊皮紙 */
.ai-btn-default {
    background: #f7f3df;
    color: #5d4e37;
    border: 2px solid #d4c5a0;
}
.ai-btn-default:hover {
    background: #efe8cc;
}

/* Dashed — 虛線邊框（用於空狀態 / 草稿） */
.ai-btn-dashed {
    background: transparent;
    color: #5d4e37;
    border: 2px dashed #c4b89a;
    box-shadow: none;
}
.ai-btn-dashed:hover {
    background: #f7f3df;
    border-style: solid;
    box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 6px 12px rgba(0,0,0,0.04);
}
.ai-btn-dashed:active {
    box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}

/* Text — 純文字 */
.ai-btn-text {
    background: transparent;
    color: #5d4e37;
    box-shadow: none;
    padding-left: 8px;
    padding-right: 8px;
}
.ai-btn-text:hover {
    background: rgba(93, 78, 55, 0.06);
    transform: none;
    box-shadow: none;
}

/* Link — 連結樣式 */
.ai-btn-link {
    background: transparent;
    color: #3b7a6b;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding-left: 4px;
    padding-right: 4px;
}
.ai-btn-link:hover {
    color: #2a5c52;
    transform: none;
    box-shadow: none;
}

/* Danger — 暖紅 */
.ai-btn-danger {
    background: #fc736d;
    color: #fff;
}
.ai-btn-danger:hover {
    background: #e86560;
}

/* Success — 草綠 */
.ai-btn-success {
    background: #6dbd8a;
    color: #fff;
}
.ai-btn-success:hover {
    background: #5da878;
}

/* Warning — 暖橘 */
.ai-btn-warning {
    background: #e8a850;
    color: #fff;
}
.ai-btn-warning:hover {
    background: #d4953e;
}

/* Ghost — 半透明幽靈按鈕 */
.ai-btn-ghost {
    background: transparent;
    color: #5d4e37;
    border: 2px solid #c4b89a;
    box-shadow: none;
}
.ai-btn-ghost:hover {
    background: rgba(93, 78, 55, 0.06);
    border-color: #a89875;
    box-shadow: 0 4px 0 rgba(0,0,0,0.06), 0 6px 12px rgba(0,0,0,0.04);
}

/* --- Loading 狀態：斜條紋動畫 --- */
.ai-btn-loading {
    position: relative;
    overflow: hidden;
    cursor: wait;
}
.ai-btn-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(255,255,255,0.15) 8px,
        rgba(255,255,255,0.15) 16px
    );
    animation: aiStripeMove 0.8s linear infinite;
    border-radius: inherit;
}

@keyframes aiStripeMove {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ================================================================
   2. 信息框 / 卡片系統 — 13 色色卡
   ================================================================ */

.ai-card {
    background: #f7f3df;
    color: #5d4e37;
    border: 2px solid #d4c5a0;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(93, 78, 55, 0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.ai-card:hover {
    box-shadow: 0 4px 16px rgba(93, 78, 55, 0.12);
}

/* 標題型卡片 */
.ai-card-title {
    background: #3b7a6b;
    color: #fff;
    border-color: #2a5c52;
    font-weight: 700;
    font-size: 18px;
}

/* 虛線卡片（空狀態） */
.ai-card-dashed {
    border-style: dashed;
    background: #fef9e7;
    color: #9a8b6e;
}

/* --- 13 色色卡 --- */
.ai-card-pink {
    background: #f8a6b2;
    color: #fff;
    border-color: #e8929e;
}
.ai-card-purple {
    background: #b77dee;
    color: #fff;
    border-color: #a369da;
}
.ai-card-blue {
    background: #889df0;
    color: #fff;
    border-color: #7489dc;
}
.ai-card-yellow {
    background: #f7cd67;
    color: #5d4e37;
    border-color: #e3ba53;
}
.ai-card-orange {
    background: #e59266;
    color: #fff;
    border-color: #d17e52;
}
.ai-card-teal {
    background: #82d5bb;
    color: #fff;
    border-color: #6ec1a7;
}
.ai-card-green {
    background: #8ac68a;
    color: #fff;
    border-color: #76b276;
}
.ai-card-red {
    background: #fc736d;
    color: #fff;
    border-color: #e86560;
}
.ai-card-lime {
    background: #d1da49;
    color: #3d5a1a;
    border-color: #bdc63c;
}
.ai-card-yellowgreen {
    background: #ecdf52;
    color: #5d4e37;
    border-color: #d8cb3e;
}
.ai-card-brown {
    background: #9a835a;
    color: #fff;
    border-color: #866f46;
}
.ai-card-peach {
    background: #e18c6f;
    color: #fff;
    border-color: #cd7862;
}

/* 資訊提示框 */
.ai-info-box {
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-info-box::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.ai-info-success {
    background: #e8f5e9;
    color: #2e5a30;
    border: 1px solid #a5d6a7;
}
.ai-info-success::before { content: '\f058'; color: #43a047; }

.ai-info-warning {
    background: #fff8e1;
    color: #6d5200;
    border: 1px solid #ffe082;
}
.ai-info-warning::before { content: '\f071'; color: #ffa000; }

.ai-info-error {
    background: #fce4ec;
    color: #791a2c;
    border: 1px solid #ef9a9a;
}
.ai-info-error::before { content: '\f057'; color: #d32f2f; }

.ai-info-info {
    background: #e3f2fd;
    color: #0d3b66;
    border: 1px solid #90caf9;
}
.ai-info-info::before { content: '\f05a'; color: #1976d2; }

.ai-info-tip {
    background: #f3e5f5;
    color: #4a1a5c;
    border: 1px solid #ce93d8;
}
.ai-info-tip::before { content: '\f0eb'; color: #7b1fa2; }

/* ================================================================
   3. 表單列表
   ================================================================ */

/* 表單行 */
.ai-form-group {
    margin-bottom: 18px;
}

.ai-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
    color: #5d4e37;
}

/* 表單輸入 — 藥丸形狀 + 3D 陰影 */
.ai-input {
    width: 100%;
    padding: 12px 18px;
    font-size: 15px;
    font-family: inherit;
    color: #5d4e37;
    background: #fffef9;
    border: 2px solid #c4b89a;
    border-radius: 50px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 0 rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
    outline: none;
}

.ai-input:focus {
    border-color: #3b7a6b;
    box-shadow: 0 0 0 3px rgba(59, 122, 107, 0.15), 0 2px 0 rgba(0,0,0,0.06);
}

.ai-input.error {
    border-color: #fc736d;
}
.ai-input.error:focus {
    box-shadow: 0 0 0 3px rgba(252, 115, 109, 0.15);
}

.ai-input.warning {
    border-color: #e8a850;
}

.ai-input[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Textarea */
.ai-textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-family: inherit;
    color: #5d4e37;
    background: #fffef9;
    border: 2px solid #c4b89a;
    border-radius: 20px;
    box-sizing: border-box;
    min-height: 100px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 0 rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
    outline: none;
}
.ai-textarea:focus {
    border-color: #3b7a6b;
    box-shadow: 0 0 0 3px rgba(59, 122, 107, 0.15);
}

/* Select */
.ai-select {
    padding: 12px 40px 12px 18px;
    font-size: 15px;
    font-family: inherit;
    color: #5d4e37;
    background: #fffef9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235d4e37' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 2px solid #c4b89a;
    border-radius: 50px;
    appearance: none;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0,0,0,0.06), 0 4px 8px rgba(0,0,0,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.ai-select:focus {
    border-color: #3b7a6b;
    box-shadow: 0 0 0 3px rgba(59, 122, 107, 0.15);
}

/* 表格列表 */
.ai-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(93, 78, 55, 0.08);
    font-size: 14px;
}

.ai-table thead th {
    background: #f7f3df;
    color: #5d4e37;
    font-weight: 700;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid #d4c5a0;
}

.ai-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e8dcc8;
    background: #fffef9;
}

.ai-table tbody tr:hover td {
    background: #fdf8ed;
}

.ai-table tbody tr:last-child td {
    border-bottom: none;
}

/* 空狀態 */
.ai-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #9a8b6e;
}

.ai-empty-state .ai-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.ai-empty-state p {
    font-size: 16px;
    margin: 0;
}

/* 徽章 / 標籤 */
.ai-badge {
    display: inline-block;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ai-badge-primary   { background: #3b7a6b; color: #fff; }
.ai-badge-success   { background: #6dbd8a; color: #fff; }
.ai-badge-warning   { background: #e8a850; color: #fff; }
.ai-badge-danger    { background: #fc736d; color: #fff; }
.ai-badge-info      { background: #889df0; color: #fff; }
.ai-badge-purple    { background: #b77dee; color: #fff; }
.ai-badge-teal      { background: #82d5bb; color: #fff; }
.ai-badge-default   { background: #e8dcc8; color: #5d4e37; }

/* 分頁導航 */
.ai-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.ai-pagination a,
.ai-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.ai-pagination a {
    background: #f7f3df;
    color: #5d4e37;
    border: 1px solid #d4c5a0;
}
.ai-pagination a:hover {
    background: #efe8cc;
    border-color: #c4b89a;
    transform: translateY(-1px);
    box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}

.ai-pagination .active {
    background: #3b7a6b;
    color: #fff;
    border-color: #3b7a6b;
    box-shadow: 0 3px 0 rgba(0,0,0,0.12);
}

.ai-pagination .disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.ai-pagination .ai-pg-info {
    font-size: 13px;
    color: #9a8b6e;
    margin: 0 10px;
    min-width: auto;
}

/* ================================================================
   4. 文章展示介面
   ================================================================ */

.ai-article {
    max-width: 800px;
    margin: 0 auto;
    background: #fdf8ed;
    border: 2px solid #d4c5a0;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 4px 16px rgba(93, 78, 55, 0.1);
    line-height: 1.9;
    position: relative;
}

.ai-article .ai-article-title {
    text-align: center;
    color: #3b7a6b;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

/* Sticky 頭部資訊欄 — 下滑時固定在內容區頂部 */
.ai-article-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fdf8ed;
    padding: 14px 0;
    margin: 0 -40px;           /* 抵消 .ai-article 的 padding，達到全寬 */
    padding-left: 40px;
    padding-right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 2px solid #d4c5a0;
    box-shadow: 0 4px 12px rgba(93, 78, 55, 0.10);
    transition: box-shadow 0.3s;
}

/* 當 sticky 啟動時加深陰影（JS 動態添加 class） */
.ai-article-sticky-bar.is-stuck {
    box-shadow: 0 4px 20px rgba(93, 78, 55, 0.18);
    border-radius: 0 0 20px 20px;
    margin-bottom: 8px;
}

.ai-article .ai-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #8a7a5e;
    font-size: 14px;
    white-space: nowrap;
}

.ai-meta-divider {
    color: #d4c5a0;
}

/* 語言播放按鈕群組 */
.ai-audio-lang-btns {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* 語言播放按鈕 — 藥丸形狀，與主題一致 */
.ai-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 3px 0 rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: #fff;
}

/* 廣東話按鈕 — 藍色 */
.ai-lang-btn-canto {
    background: #5b9bd5;
}
.ai-lang-btn-canto:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(0,0,0,0.12), 0 8px 16px rgba(91, 155, 213, 0.3);
}
.ai-lang-btn-canto:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.12);
}

/* 普通話按鈕 — 紅色 */
.ai-lang-btn-mando {
    background: #e5736e;
}
.ai-lang-btn-mando:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(0,0,0,0.12), 0 8px 16px rgba(229, 115, 110, 0.3);
}
.ai-lang-btn-mando:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.12);
}

.ai-article .ai-article-content {
    font-size: 18px;
    line-height: 1.9;
    color: #5d4e37;
    margin-top: 24px;
    margin-bottom: 32px;
}

.ai-article .ai-article-content img {
    max-width: 100%;
    border-radius: 16px;
    margin: 16px 0;
}

/* 題目區 */
.ai-questions-section h3 {
    color: #5d4e37;
    margin-bottom: 16px;
}

.ai-question-item {
    background: #fffef9;
    border: 1px solid #e8dcc8;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.ai-question-item:hover {
    border-color: #d4c5a0;
}

.ai-question-text {
    font-weight: 700;
    color: #5d4e37;
    margin: 0 0 12px;
    font-size: 15px;
}

.ai-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #5d4e37;
    border: 1px solid transparent;
}

.ai-option-label:hover {
    background: #f7f3df;
}

.ai-option-label input[type="radio"] {
    accent-color: #3b7a6b;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 提交按鈕 */
.ai-submit-btn {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    background: #3b7a6b;
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 5px 0 rgba(0,0,0,0.15), 0 8px 16px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.ai-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 rgba(0,0,0,0.15), 0 12px 24px rgba(0,0,0,0.12);
}

.ai-submit-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.08);
}

.ai-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ================================================================
   5. 互動效果補充
   ================================================================ */

/* 3D 懸浮卡片（用於等級選擇、補讀日期等） */
.ai-float-card {
    background: #fffef9;
    border: 2px solid #d4c5a0;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 6px 12px rgba(0,0,0,0.06);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    color: #5d4e37;
    display: block;
}

.ai-float-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 rgba(0,0,0,0.1), 0 14px 24px rgba(0,0,0,0.1);
}

.ai-float-card:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.08), 0 3px 6px rgba(0,0,0,0.06);
}

.ai-float-card .ai-float-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.ai-float-card .ai-float-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
}

.ai-float-card .ai-float-sub {
    font-size: 13px;
    color: #9a8b6e;
}

/* 已停用狀態 */
.ai-float-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.6);
}

/* Tab 切換按鈕組 */
.ai-tab-group {
    display: inline-flex;
    gap: 4px;
    background: #f7f3df;
    border-radius: 50px;
    padding: 4px;
    margin-bottom: 20px;
}

.ai-tab-btn {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #5d4e37;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.ai-tab-btn:hover {
    background: rgba(59, 122, 107, 0.1);
}

.ai-tab-btn.active {
    background: #3b7a6b;
    color: #fff;
    box-shadow: 0 2px 0 rgba(0,0,0,0.1), 0 3px 8px rgba(0,0,0,0.08);
}

/* 統計數字卡片 */
.ai-stat-card {
    background: #fffef9;
    border-radius: 20px;
    padding: 20px 24px;
    border-left: 5px solid #3b7a6b;
    box-shadow: 0 2px 8px rgba(93, 78, 55, 0.08);
}

.ai-stat-card .ai-stat-label {
    font-size: 13px;
    color: #9a8b6e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ai-stat-card .ai-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #5d4e37;
}

/* 分隔線 */
.ai-divider {
    height: 12px;
    margin: 24px 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='12'%3E%3Cpath fill='none' stroke='%23d4c5a0' stroke-width='2' d='M0 6 Q30 0 60 6 T120 6'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center;
}

/* Toast 通知（動物島風格） */
.ai-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 6px 0 rgba(0,0,0,0.12), 0 10px 20px rgba(0,0,0,0.1);
    animation: aiToastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 400px;
}

.ai-toast-success { background: #6dbd8a; }
.ai-toast-error   { background: #fc736d; }
.ai-toast-warning { background: #e8a850; }
.ai-toast-info    { background: #889df0; }
.ai-toast-reward-epic {
    background: linear-gradient(135deg, #f093fb, #f5576c, #ffa726);
    font-weight: 700;
    animation: aiToastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), aiRewardPulse 1.5s ease-in-out infinite 0.5s;
}
@keyframes aiRewardPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.6); }
    50%      { box-shadow: 0 0 20px 8px rgba(245, 87, 108, 0.3); }
}

@keyframes aiToastIn {
    from { transform: translateX(120%) scale(0.8); opacity: 0; }
    to   { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes aiToastOut {
    from { transform: translateX(0) scale(1); opacity: 1; }
    to   { transform: translateX(120%) scale(0.8); opacity: 0; }
}

/* 模態對話框疊加層 */
.ai-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(93, 78, 55, 0.5);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: aiFadeIn 0.2s ease;
}

.ai-modal {
    background: #fdf8ed;
    border: 3px solid #d4c5a0;
    border-radius: 24px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 12px 0 rgba(0,0,0,0.08), 0 20px 40px rgba(0,0,0,0.15);
    animation: aiSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-modal h3 {
    margin: 0 0 16px;
    color: #3b7a6b;
    font-size: 20px;
}

.ai-modal p {
    color: #5d4e37;
    line-height: 1.7;
    margin: 0 0 24px;
}

.ai-modal .ai-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

@keyframes aiFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes aiSlideUp {
    from { transform: translateY(30px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ================================================================
   6. 頁尾裝飾
   ================================================================ */

.ai-footer-tree {
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 60'%3E%3Cpath fill='%233b7a6b' d='M0 60 L800 60 L800 50 Q700 10 650 25 Q600 5 550 20 Q500 0 450 15 Q400 8 350 20 Q300 5 250 18 Q200 0 150 15 Q100 8 50 22 Q0 15 0 28 Z'/%3E%3C/svg%3E") repeat-x bottom;
    background-size: auto 60px;
    margin-top: 40px;
}

/* ================================================================
   7. RWD 響應式
   ================================================================ */

@media (orientation: portrait) {
    .ai-article {
        padding: 20px;
        border-radius: 16px;
    }
    .ai-article .ai-article-title {
        font-size: 22px;
    }
    .ai-article-sticky-bar {
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    .ai-article .ai-article-meta {
        font-size: 12px;
        gap: 10px;
        flex-wrap: wrap;
    }
    .ai-lang-btn {
        font-size: 12px;
        padding: 6px 16px;
    }
    .ai-modal {
        padding: 24px;
        border-radius: 20px;
    }
    .ai-table {
        font-size: 12px;
    }
    .ai-table thead th,
    .ai-table tbody td {
        padding: 8px 10px;
    }
}

/* ================================================================
   8. 第一次登入使用指南 (Onboarding Tour)
   ================================================================ */

/* 半透明覆蓋層 */
.tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(93, 78, 55, 0.6);
    z-index: 9998;
    animation: aiFadeIn 0.3s ease;
    transition: opacity 0.3s ease;
}

/* 高亮目標元素 — 提升 z-index 使其穿透覆蓋層 */
.tour-highlight {
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.9), 0 0 0 10px rgba(59, 122, 107, 0.6), 0 0 30px rgba(59, 122, 107, 0.4) !important;
    border-radius: 50px !important;
    transition: box-shadow 0.3s ease;
    animation: tourPulse 2s ease-in-out infinite;
}

/* 側欄高亮使用較大圓角 */
.student-sidebar.tour-highlight {
    border-radius: 0 !important;
}

@keyframes tourPulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.9), 0 0 0 10px rgba(59, 122, 107, 0.6), 0 0 30px rgba(59, 122, 107, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.95), 0 0 0 14px rgba(59, 122, 107, 0.5), 0 0 40px rgba(59, 122, 107, 0.35); }
}

/* 提示框 */
.tour-tooltip {
    position: fixed;
    z-index: 10000;
    background: #fdf8ed;
    border: 3px solid #d4c5a0;
    border-radius: 20px;
    padding: 24px 28px;
    max-width: 340px;
    width: auto;
    box-shadow: 0 12px 0 rgba(93, 78, 55, 0.08), 0 20px 40px rgba(93, 78, 55, 0.18);
    animation: aiSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tour-tooltip-title {
    font-size: 18px;
    font-weight: 700;
    color: #3b7a6b;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tour-tooltip-content {
    font-size: 15px;
    color: #5d4e37;
    line-height: 1.7;
    margin: 0 0 20px 0;
}

.tour-tooltip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* 步驟指示點 */
.tour-step-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tour-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d4c5a0;
    transition: all 0.3s ease;
}

.tour-step-dot.active {
    background: #3b7a6b;
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 3px rgba(59, 122, 107, 0.2);
}

.tour-step-dot.done {
    background: #6dbd8a;
}

/* 跳過按鈕 */
.tour-skip-btn {
    font-size: 13px;
    color: #9a8b6e;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 50px;
    transition: all 0.2s;
}

.tour-skip-btn:hover {
    background: rgba(93, 78, 55, 0.08);
    color: #5d4e37;
}

/* 行動端適配 */
@media (orientation: portrait) {
    .tour-tooltip {
        max-width: 280px;
        padding: 18px 20px;
        border-radius: 16px;
    }
    
    .tour-tooltip-title {
        font-size: 16px;
    }
    
    .tour-tooltip-content {
        font-size: 14px;
    }
}
