/* ============================================================
 * english-learn.css — 英语学习中心样式
 * P1: 仪表盘 + 抽认卡
 * 依赖: global.css (变量/Reset/布局)
 * ============================================================ */

/* === 仪表盘 === */

.learn-dashboard {
    padding: 24px 30px;
    max-width: 920px;
    margin: 0 auto;
}

.learn-hero {
    border-radius: 16px;
    padding: 36px 32px;
    text-align: center;
    margin-bottom: 24px;
}

.learn-hero-inner { display: inline-block; }

.learn-hero-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.learn-hero-title {
    font-family: var(--font-heading, Georgia, serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 6px;
}

.learn-hero-subtitle {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin: 0;
}

/* 游客提示 */
.learn-guest-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
    border: 1px solid #fbbf24;
}

.learn-guest-icon { font-size: 24px; }
.learn-guest-text { font-size: 14px; color: var(--text-secondary, #64748b); }
.learn-guest-text a { color: #0891b2; font-weight: 600; }

/* 统计卡片 */
.learn-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.learn-stat-card {
    border-radius: 14px;
    padding: 24px 16px;
    text-align: center;
}

.learn-stat-num {
    font-family: Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.learn-stat-label {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
}

/* 操作按钮 */
.learn-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.learn-action-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 14px;
    padding: 20px 24px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.learn-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.learn-action-primary {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #fff;
}

.learn-action-primary .learn-action-title { color: #fff; }
.learn-action-primary .learn-action-desc { color: rgba(255,255,255,0.85); }

.learn-action-icon { font-size: 32px; }

.learn-action-text { display: flex; flex-direction: column; }

.learn-action-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.learn-action-desc {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    margin-top: 2px;
}

/* 学习计划标签 */
.learn-plans-section {
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
}

.learn-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 16px;
}

.learn-tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.learn-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 20px;
    padding: 8px 16px;
    text-decoration: none;
    font-size: 14px;
    transition: transform 0.15s;
}

.learn-tag-chip:hover { transform: translateY(-1px); }

.learn-tag-name { font-weight: 600; }
.learn-tag-count {
    font-size: 12px;
    opacity: 0.6;
    background: rgba(8,145,178,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.learn-empty-hint {
    color: var(--text-secondary, #64748b);
    font-size: 14px;
}

/* 近7天图表 */
.learn-recent-section {
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
}

.learn-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 140px;
    gap: 8px;
}

.learn-chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.learn-chart-bar-wrap {
    flex: 1;
    display: flex;
    align-items: flex-end;
    width: 100%;
    justify-content: center;
}

.learn-chart-bar {
    width: 60%;
    max-width: 40px;
    background: linear-gradient(180deg, #06b6d4, #0891b2);
    border-radius: 6px 6px 0 0;
    transition: height 0.4s ease;
    min-height: 0;
}

.learn-chart-label {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    margin-top: 8px;
}

/* ============================================================
 * 抽认卡
 * ============================================================ */

.flashcard-page {
    padding: 16px 30px;
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(96vh - 32px);
}

/* 顶部栏 */
.flashcard-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.flashcard-back {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    white-space: nowrap;
}

.flashcard-back:hover { color: #0891b2; }

.flashcard-progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.flashcard-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.flashcard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #0891b2);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.flashcard-progress-text {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.flashcard-tag-badge {
    font-size: 12px;
    font-weight: 600;
    background: rgba(8,145,178,0.1);
    color: #0891b2;
    padding: 4px 12px;
    border-radius: 12px;
}

/* 卡片容器 */
.flashcard-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.flashcard-card-container {
    perspective: 1200px;
    width: 100%;
    max-width: 560px;
}

.flashcard-card {
    position: relative;
    width: 100%;
    height: 360px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
}

.flashcard-card.flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 20px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

/* 正面 */
.flashcard-front {
    background: var(--content-ui-2-bg, #fff);
}

.flashcard-word {
    font-family: Georgia, serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
}

.flashcard-phonetic {
    font-size: 16px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 16px;
}

.flashcard-tts-btn {
    border: 1px solid #0891b2;
    background: rgba(8,145,178,0.05);
    color: #0891b2;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.flashcard-tts-btn:hover { background: rgba(8,145,178,0.15); }

.flashcard-hint {
    position: absolute;
    bottom: 20px;
    font-size: 13px;
    color: var(--text-tertiary, #94a3b8);
}

/* 背面 */
.flashcard-back {
    background: var(--content-ui-2-bg, #fff);
    transform: rotateY(180deg);
    overflow-y: auto;
}

.flashcard-word-small {
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 4px;
}

.flashcard-pos {
    font-size: 13px;
    color: #0891b2;
    font-weight: 600;
    margin-bottom: 12px;
}

.flashcard-meaning {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    width: 100%;
}

.flashcard-meaning li {
    font-size: 15px;
    color: var(--text-primary, #1e293b);
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.flashcard-meaning li:last-child { border-bottom: none; }

.flashcard-examples {
    width: 100%;
    margin-bottom: 12px;
}

.flashcard-example-item {
    padding: 8px 12px;
    background: rgba(8,145,178,0.04);
    border-radius: 8px;
    margin-bottom: 8px;
}

.flashcard-example-item .ex-en {
    font-size: 14px;
    color: var(--text-primary, #1e293b);
    margin-bottom: 2px;
}

.flashcard-example-item .ex-cn {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
}

.flashcard-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.flashcard-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(8,145,178,0.1);
    color: #0891b2;
}

.flashcard-tag.root-tag {
    background: rgba(139,92,246,0.1);
    color: #8b5cf6;
}

/* 评分按钮 */
.flashcard-rating {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 560px;
}

.flashcard-rate-btn {
    flex: 1;
    border: none;
    border-radius: 14px;
    padding: 14px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s, box-shadow 0.15s;
    font-size: 13px;
}

.flashcard-rate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.flashcard-rate-btn .rate-icon { font-size: 24px; }
.flashcard-rate-btn .rate-label { font-weight: 600; }

.rate-unknown { background: rgba(239,68,68,0.1); color: #ef4444; }
.rate-fuzzy   { background: rgba(245,158,11,0.1); color: #f59e0b; }
.rate-know    { background: rgba(16,185,129,0.1); color: #10b981; }
.rate-master  { background: rgba(8,145,178,0.1); color: #0891b2; }

/* 翻转提示 */
.flashcard-flip-hint {
    font-size: 13px;
    color: var(--text-tertiary, #94a3b8);
    text-align: center;
}

/* 空状态 */
.flashcard-empty {
    border-radius: 20px;
    padding: 60px 32px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flashcard-empty-icon { font-size: 64px; margin-bottom: 16px; }
.flashcard-empty-text { font-size: 20px; font-weight: 600; color: var(--text-primary, #1e293b); }
.flashcard-empty-hint { font-size: 14px; color: var(--text-secondary, #64748b); margin-top: 8px; }
.flashcard-empty-hint a { color: #0891b2; }

/* 完成总结 */
.flashcard-summary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flashcard-summary-inner {
    border-radius: 20px;
    padding: 40px 48px;
    text-align: center;
}

.flashcard-summary-icon { font-size: 64px; margin-bottom: 16px; }

.flashcard-summary-title {
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 24px;
}

.flashcard-summary-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 32px;
}

.flashcard-summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flashcard-summary-stat .summary-num {
    font-family: Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.flashcard-summary-stat .summary-label {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    margin-top: 4px;
}

.flashcard-summary-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.flashcard-summary-btn {
    border-radius: 12px;
    padding: 12px 28px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    transition: transform 0.15s;
}

.flashcard-summary-btn:hover { transform: translateY(-2px); }

/* ============================================================
 * 响应式
 * ============================================================ */

@media (max-width: 768px) {
    .learn-dashboard { padding: 16px; }
    .learn-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .learn-actions { grid-template-columns: 1fr; }

    .flashcard-page { padding: 12px 16px; }
    .flashcard-card { height: 300px; }
    .flashcard-word { font-size: 32px; }
    .flashcard-rating { flex-wrap: wrap; }
    .flashcard-rate-btn { min-width: calc(50% - 6px); }
    .flashcard-summary-stats { gap: 24px; }
    .flashcard-summary-inner { padding: 28px 24px; }
}