/* 首页 ——「薄荷软糖 Mint Candy」设计应用（talkie-ui-design/design.html v1.1）
   层级：品牌 → 主角（AI 口语大卡）→ 数据（新词/复习）→ 工具（配音条）→ 底部
   全部走 theme.css 变量 + 少量设计稿专用色，DOM 契约（id/class）不变 */

.home-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: calc(env(safe-area-inset-top) + 14px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
    box-sizing: border-box;
}

/* 进场 staggered 上浮（设计稿动效 5：仅 4 层各延迟 0.08s） */
.home-screen > * {
    animation: home-rise .5s var(--ease) both;
}
.home-screen > *:nth-child(2) { animation-delay: .08s; }
.home-screen > *:nth-child(3) { animation-delay: .16s; }
.home-screen > *:nth-child(4) { animation-delay: .24s; }
.home-screen > *:nth-child(5) { animation-delay: .32s; }

@keyframes home-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- ① 品牌层：logo 左 + 词库玻璃芯片右 ---------- */
.home-hero {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 4px;
}

.hero-title-img {
    display: block;
    height: 40px;
    width: auto;
    margin: 0;
    -webkit-user-drag: none;
    user-select: none;
}

.home-bank {
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

/* ---------- ② 主角层：AI 口语大卡（全屏唯一 CTA） ---------- */
.home-talk {
    flex: 1.2;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--r-xl);
    padding: 22px 20px 20px;
    box-shadow: var(--sh-pop);
}

/* 卡片顶部径向薄荷光晕 */
.home-talk::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(220px 120px at 50% 0%, rgba(150, 217, 173, .35), transparent 70%);
    pointer-events: none;
}
.home-talk > * { position: relative; }

.talk-mascot {
    width: min(150px, 30vh);
    height: min(150px, 30vh);
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 0 0 6px var(--green-mid), 0 12px 28px rgba(30, 58, 42, .22);
    animation: mascot-breath 3.2s ease-in-out infinite;
}

@keyframes mascot-breath {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 6px var(--green-mid), 0 12px 28px rgba(30, 58, 42, .22);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(150, 217, 173, .55), 0 16px 36px rgba(30, 58, 42, .26);
    }
}

.home-talk:active .talk-mascot { transform: scale(.97); }

.home-talk-label {
    font-family: var(--font-round);
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.home-talk-sub {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.home-talk-cta {
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    border-radius: var(--r-pill);
    padding: 10px 26px;
    box-shadow: 0 4px 0 rgba(15, 36, 26, .2);
    margin-top: 6px;
}

/* ---------- ③ 数据层：新词 / 复习双卡 ---------- */
.home-tiles {
    flex: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 16px 18px;
    background: var(--surface);
    border-radius: var(--r-card, 24px);
    box-shadow: var(--sh-card);
    text-decoration: none;
    color: var(--text);
    position: relative;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}

.tile:hover { transform: translateY(-3px); }
.tile:active { transform: translateY(-1px) scale(.99); }

.t-emoji {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 22px;
}

.tile-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--text-2);
}

.tile-num {
    font-family: var(--font-round);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--brand);
}

.t-bar {
    height: 6px;
    border-radius: var(--r-pill);
    background: var(--green-tint);
    margin-top: 10px;
    overflow: hidden;
    align-self: stretch;
}

.t-bar i {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--green-mid), var(--brand));
    transition: width .45s var(--ease);
}

/* 复习卡：软糖黄冷暖对比 */
.tile-sun .tile-num { color: var(--sun-deep); }
.tile-sun .t-bar { background: var(--sun-tint); }
.tile-sun .t-bar i { width: 100%; background: linear-gradient(90deg, var(--sun-bar), var(--sun)); }

.t-tag {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--sun);
    color: var(--sun-ink);
    font-size: 10px;
    font-weight: 800;
    border-radius: var(--r-pill) var(--r-pill) var(--r-pill) 4px;
    padding: 5px 10px;
    transform: rotate(6deg);
    z-index: 1;
    box-shadow: 0 2px 6px rgba(30, 58, 42, .15);
}

.t-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    margin-top: 2px;
}

/* 复习卡锁定态：没学过词时置灰 */
.tile-off {
    opacity: .55;
    filter: grayscale(.4);
    cursor: default;
}
.tile-off:active { transform: none; }

/* ---------- ④ 工具层：配音横条（图标 C） ---------- */
.home-dub {
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    background: var(--green-tint);
    border: 2px dashed rgba(47, 158, 99, .4);
    border-radius: 20px;
    text-decoration: none;
    color: var(--brand);
    transition: transform .22s var(--ease);
}

.home-dub:hover { transform: translateY(-2px); }
.home-dub:active { transform: translateY(-1px) scale(.99); }

.home-dub-icon {
    flex: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--brand);
    box-shadow: 0 4px 0 rgba(15, 36, 26, .3);
}

.home-dub-icon svg { width: 26px; height: 26px; display: block; }

.home-dub-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.home-dub-text b {
    font-family: var(--font-round);
    font-size: 17px;
    font-weight: 800;
    color: var(--brand);
}

.home-dub-text small {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    opacity: .75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.feature-arrow {
    flex: none;
    color: var(--brand);
    font-weight: 800;
    font-size: 16px;
}

/* ---------- ⑤ 底部操作区 ---------- */
.home-bottom {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
}

.login-btn {
    flex: 1;
    max-width: 220px;
    padding: 12px 30px;
    border-radius: var(--r-pill);
    background: var(--ink-navy);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 5px 0 rgba(15, 36, 26, .35);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.login-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(15, 36, 26, .35); }

.corner-fab {
    flex: none;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .85);
    border: none;
    box-shadow: 0 4px 12px rgba(30, 58, 42, .15);
    text-decoration: none;
    transition: transform .2s var(--ease);
}

.corner-fab:hover { transform: scale(1.06); }

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
    .hero-title-img { height: 34px; }
    .tile-num { font-size: 34px; }
    .home-talk-label { font-size: 21px; }
    .talk-mascot { width: min(132px, 26vh); height: min(132px, 26vh); }
}

/* ---------- iPhone 全屏适配（≤600px：容器全出血，内容单屏铺满不滚动） ---------- */
@media (max-width: 600px) {
    body.page-home {
        padding: 0;
        background: var(--bg-app-green);
        background-attachment: fixed;
    }

    body.page-home .container {
        max-width: none;
        width: 100%;
        margin: 0;
        min-height: 100dvh;
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg-app-green);
        padding: calc(env(safe-area-inset-top) + 12px) 18px calc(env(safe-area-inset-bottom) + 14px);
        display: flex;
        flex-direction: column;
    }

    /* 内容区撑满容器剩余高度；底部操作区钉在底部 */
    .home-screen {
        min-height: 0;
        flex: 1;
        gap: 16px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .home-bottom { margin-top: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .talk-mascot,
    .home-screen > * { animation: none; }
}
