/* ============================================================
   学习打卡 · 共享样式（色板 + 页头 + 翻卡 + 按钮）
   统一色板（2026-08-14 定版）：深藏蓝/暗金褐/米白/警示暗红
   ============================================================ */

:root {
    /* ===== 色板（与主界面/水语语音一致） ===== */
    --primary-500: #1A2A5C;
    --primary-400: #5F6A8D;
    --primary-200: #AFB4C6;
    --primary-50:  #EDEEF2;
    --secondary-500: #B8860B;
    --secondary-400: #CDAA54;
    --secondary-200: #E6D5AA;
    --secondary-50:  #F9F5EB;

    --indigo:       var(--primary-500);
    --indigo-dark:  #16244E;
    --gold:         var(--secondary-500);
    --gold-light:   var(--secondary-200);
    --cream:        #F7F2E7;
    --card:         #FFFDF6;
    --nav-bg:       #EDE6D8;
    --border-soft:  #E4DCC8;
    --danger:       #A04438;
    --white:        #FFFFFF;
    --text:         #232833;
    --text-soft:    #76819A;

    --font-kai: "LXGW WenKai", "霞鹜文楷", "KaiTi", "楷体", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-kai);
    background-color: var(--cream);
    background-image:
        linear-gradient(rgba(26, 42, 92, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 42, 92, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-wrap { width: 100%; max-width: 860px; padding: 0 16px; }

/* ============ 页面头部 ============ */
.page-header {
    text-align: center;
    padding: 28px 0 12px;
}
.back-link {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--indigo);
    text-decoration: none;
    font-size: 14px;
    border: 1px solid var(--indigo);
    padding: 4px 14px;
    border-radius: 999px;
    transition: background .2s, color .2s;
}
.back-link:hover { background: var(--indigo); color: #fff; }
.page-title {
    font-size: 30px;
    color: var(--indigo);
    font-weight: 700;
    letter-spacing: 2px;
}
.page-subtitle { color: var(--text-soft); font-size: 14px; margin-top: 6px; }
.title-divider { width: 260px; margin: 12px auto 0; display: block; opacity: .7; }

.page-footer {
    text-align: center;
    color: var(--text-soft);
    font-size: 12px;
    padding: 26px 0 30px;
}

/* ============ 通用按钮 ============ */
.btn {
    font-family: var(--font-kai);
    font-size: 16px;
    padding: 10px 22px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s, opacity .2s;
    color: #fff;
    background: var(--indigo);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,42,92,.25); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-gold { background: var(--gold); }
.btn-ghost {
    background: transparent;
    color: var(--indigo);
    border: 1.5px solid var(--indigo);
}
.btn-ghost:hover { background: var(--primary-50); box-shadow: none; }

/* ============ 学习卡（3D 翻转） ============ */
.stage-card {
    max-width: 560px;
    margin: 26px auto 18px;
    perspective: 1200px;
}
.flip-card {
    position: relative;
    width: 100%;
    min-height: 300px;
    transform-style: preserve-3d;
    transition: transform .5s;
    cursor: pointer;
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--card);
    border: 2px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(26,42,92,.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px;
    min-height: 300px;
    text-align: center;
}
.flip-front { z-index: 2; }
.flip-back  { transform: rotateY(180deg); }

/* 卡片上的字/词/图 */
.char-img { max-width: 180px; max-height: 180px; object-fit: contain; }
.card-ipa {
    font-size: 40px;
    color: var(--indigo);
    font-weight: 700;
    line-height: 1.4;
    word-break: break-all;
}
.card-char { font-size: 120px; color: var(--indigo); font-weight: 700; line-height: 1.1; }
.card-meaning { font-size: 22px; color: var(--text); margin-top: 8px; }
.card-mean-sub { font-size: 15px; color: var(--text-soft); margin-top: 8px; }
.card-gloss {
    font-size: 15px;
    color: var(--text-soft);
    margin-top: 12px;
    max-height: 130px;
    overflow-y: auto;
    line-height: 1.7;
    text-align: left;
}
/* ★ 词卡插图空位（留给美工配图）★ */
.illu-slot {
    width: 96px;
    height: 96px;
    margin: 0 auto 10px;
    border: 2px dashed var(--border-soft);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-size: 12px;
    background: var(--secondary-50);
}
.illu-slot img { max-width: 100%; max-height: 100%; object-fit: contain; }

.card-tip {
    text-align: center;
    color: var(--text-soft);
    font-size: 13px;
    margin-top: 4px;
}

/* ============ 学习页：进度条 / 按钮区 / 完成提示 ============ */
.learn-progress {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-soft);
}
.learn-progress b { color: var(--indigo); }
.progress-bar {
    max-width: 560px;
    height: 8px;
    background: var(--border-soft);
    border-radius: 999px;
    margin: 10px auto 0;
    overflow: hidden;
}
.progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--indigo), var(--gold));
    border-radius: 999px;
    transition: width .3s;
}

.judge-btns {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 20px auto 0;
    max-width: 560px;
}
.btn-know { background: #2E7D32; }
.btn-know:hover { box-shadow: 0 4px 12px rgba(46,125,50,.3); }
.btn-dontknow { background: var(--danger); }
.btn-dontknow:hover { box-shadow: 0 4px 12px rgba(160,68,56,.3); }

.done-box {
    max-width: 560px;
    margin: 40px auto 0;
    text-align: center;
    background: var(--card);
    border: 2px solid var(--gold-light);
    border-radius: 16px;
    padding: 34px 24px;
}
.done-box .done-emoji { font-size: 52px; }
.done-box h2 { color: var(--indigo); margin: 10px 0 8px; }
.done-box p { color: var(--text-soft); font-size: 14px; margin-bottom: 18px; }
