/* =========================================================================
   practice-trend.css — 练习趋势折线图
   移植自 zyzReading-main，保留翻转卡片交互，视觉上适配「纸质暖调」主题：
   去掉玻璃拟态与彩色阴影，改为纸卡 + 细线 + 朱砂色折线。
   ========================================================================= */

.practice-trend-card {
    --practice-trend-radius: 3px;
    --practice-trend-line-start: #9c3d2e;
    --practice-trend-line-mid: #c07a4a;
    --practice-trend-line-end: #a9743f;
    --practice-trend-point: #9c3d2e;

    position: relative;
    margin-top: 24px;
    min-height: 330px;
    perspective: 1600px;
    cursor: pointer;
    outline: none;
    border-radius: var(--practice-trend-radius);
}

.practice-trend-card:focus-visible {
    box-shadow: 0 0 0 2px rgba(156, 61, 46, 0.24);
}

/* ---------- 翻转容器 ---------- */
.practice-trend-card__rotor {
    position: relative;
    min-height: 330px;
    border-radius: inherit;
    transform-style: preserve-3d;
    transition: transform 780ms cubic-bezier(0.16, 1, 0.3, 1);
}

.practice-trend-card.is-flipped .practice-trend-card__rotor {
    transform: rotateY(180deg);
}

/* ---------- 卡片两面 ---------- */
.practice-trend-card__face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(22px, 3vw, 30px);
    border-radius: var(--practice-trend-radius);
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    /* 纸质卡片（替换原玻璃拟态） */
    background: #fffdf8;
    border: 1px solid #e0d6c6;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.practice-trend-card__face::before {
    display: none;
}

.practice-trend-card__face > * {
    position: relative;
    z-index: 1;
}

.practice-trend-card__back {
    transform: rotateY(180deg);
}

/* ---------- 标题区 ---------- */
.practice-trend-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.practice-trend-card__title-line {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    min-width: 0;
}

.practice-trend-card__eyebrow {
    margin: 0 0 6px;
    color: #857763;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.practice-trend-card__title {
    margin: 0;
    color: #241f18;
    font-family: Georgia, 'Times New Roman', 'Songti SC', 'STSong', 'Noto Serif SC', serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.practice-trend-card__range {
    flex: 0 0 auto;
    max-width: 34%;
    padding: 7px 12px;
    border: 1px solid #d5c9b4;
    border-radius: 2px;
    background: #faf7f1;
    color: #4e4538;
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    box-shadow: none;
}

/* ---------- 指标胶囊 ---------- */
.practice-trend-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: -2px;
}

.practice-trend-card__metrics > div {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    min-width: 78px;
    padding: 7px 10px;
    border: 1px solid #e0d6c6;
    border-radius: 2px;
    background: #faf7f1;
}

.practice-trend-card__metric-value {
    color: #241f18;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.practice-trend-card__metric-label {
    color: #6b5f4d;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ---------- 画布 ---------- */
.practice-trend-chart-shell {
    position: relative;
    flex: 1 1 auto;
    min-height: 206px;
    overflow: hidden;
    border-radius: 2px;
}

#practice-trend-canvas {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 206px;
}

.practice-trend-empty {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #857763;
    font-size: 0.94rem;
    font-weight: 700;
    text-align: center;
    pointer-events: none;
}

.practice-trend-card.is-empty .practice-trend-empty {
    display: flex;
}

.practice-trend-card.is-empty #practice-trend-canvas {
    opacity: 0.22;
}

/* ---------- 背面：范围选择 ---------- */
.practice-trend-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: auto;
}

.practice-trend-option {
    position: relative;
    min-height: 74px;
    padding: 12px;
    border: 1px solid #d5c9b4;
    border-radius: 2px;
    background: #faf7f1;
    color: #362f26;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.practice-trend-option:hover,
.practice-trend-option:focus-visible {
    background: #f3ede2;
    border-color: #9c3d2e;
    color: #9c3d2e;
    transform: translateY(-1px);
    outline: none;
}

.practice-trend-option.active,
.practice-trend-option[aria-pressed="true"] {
    background: #f6ece6;
    border-color: #9c3d2e;
    color: #9c3d2e;
    box-shadow: none;
}

.practice-trend-option.active::after,
.practice-trend-option[aria-pressed="true"]::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 10px;
    height: 2px;
    border-radius: 0;
    background: #9c3d2e;
    opacity: 0.7;
    box-shadow: none;
}
