/* 首页专属样式。设计 token、按钮、顶栏、故事卡片等共享部分见 base.css。 */

body.has-sheet { overflow: hidden; }

h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .01em;
    margin: 0 0 .4rem;
}

/* ============================================================
   AI 连接状态胶囊
   ============================================================ */

.ai-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    max-width: 220px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
}
.ai-status:hover { border-color: var(--text-3); }
.ai-status__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
    background: var(--text-3);
}

.ai-status[data-state="unset"] {
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    background: var(--accent-soft);
    color: var(--accent-text);
}
.ai-status[data-state="unset"] .ai-status__dot {
    background: var(--accent);
    animation: pulse 2s ease-out infinite;
}
.ai-status[data-state="ok"] .ai-status__dot,
.ai-status[data-state="free"] .ai-status__dot {
    background: var(--ok);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
    100% { box-shadow: 0 0 0 8px transparent; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    /* 原画铺到半透明顶栏下面 */
    margin-top: calc(-1 * var(--topbar-h));
    padding-top: var(--topbar-h);
    min-height: min(860px, 100svh);
    background: #0b0c10;
    color: var(--on-art);
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}
.hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% 22%;
    animation: hero-drift 24s var(--ease-out) both;
}
.hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(11, 12, 16, .96) 0%, rgba(11, 12, 16, .85) 36%, rgba(11, 12, 16, .35) 68%, rgba(11, 12, 16, .6) 100%),
        linear-gradient(0deg, var(--hero-fade) 0%, rgba(11, 12, 16, 0) 28%);
}

@keyframes hero-drift {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

.hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    align-items: center;
    gap: clamp(32px, 5vw, 72px);
    padding-block: clamp(48px, 8vw, 96px);
}

.hero__kicker {
    display: inline-flex;
    margin: 0 0 1.25rem;
    padding: 6px 14px;
    border: 1px solid rgba(242, 184, 75, .35);
    border-radius: 999px;
    background: rgba(242, 184, 75, .1);
    color: var(--gold-text);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
}

.hero h1 {
    margin: 0 0 1.25rem;
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 5.6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: .01em;
    text-wrap: balance;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .45);
}

.hero__sub {
    max-width: 32em;
    margin: 0 0 2rem;
    color: var(--on-art-2);
    font-size: clamp(1.05rem, 1.4vw, 1.18rem);
    line-height: 1.85;
}

.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__note {
    margin: 1.25rem 0 0;
    color: var(--on-art-3);
    font-size: .85rem;
}
.hero__note a { color: var(--gold-text); text-underline-offset: 3px; }

/* ---------- 游戏画面示意 ---------- */

.preview {
    justify-self: end;
    width: 100%;
    max-width: 520px;
    margin: 0;
    padding-bottom: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    background: rgba(14, 15, 20, .78);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    backdrop-filter: blur(18px) saturate(130%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.preview__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: var(--on-art-3);
    font-size: .78rem;
}
.preview__dots { display: inline-flex; gap: 6px; }
.preview__dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
}
.preview__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview__status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 22px 0;
}
.preview__status span {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    color: var(--on-art-2);
    font-size: .74rem;
}

.preview__text {
    margin: 14px 22px 18px;
    color: var(--on-art);
    font-family: var(--font-display);
    font-size: 1.02rem;
    line-height: 1.95;
}

.preview__choices {
    display: grid;
    gap: 8px;
    margin: 0 22px;
    padding: 0;
    list-style: none;
}
.preview__choices li {
    position: relative;
    padding: 10px 14px 10px 34px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    color: rgba(243, 239, 232, .88);
    font-size: .88rem;
    line-height: 1.5;
    transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.preview__choices li::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 1px;
    background: var(--gold);
    transform: translateY(-50%) rotate(45deg);
}
.preview__choices li:first-child {
    border-color: rgba(242, 184, 75, .5);
    background: rgba(242, 184, 75, .08);
}
.preview__choices li:nth-child(2) { transition-delay: .12s; }
.preview__choices li:nth-child(3) { transition-delay: .24s; }

.preview__input {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 12px 22px 0;
    padding: 10px 14px;
    border: 1px dashed rgba(255, 255, 255, .18);
    border-radius: 12px;
    color: var(--on-art-3);
    font-size: .86rem;
    transition: opacity .45s var(--ease-out) .36s;
}
.preview__caret {
    width: 2px;
    height: 1.1em;
    margin-left: 2px;
    background: var(--gold);
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.preview figcaption {
    margin: 14px 22px 0;
    color: rgba(243, 239, 232, .42);
    font-size: .74rem;
}

/* 打字中：选项与输入框先藏起来，打完依次浮现 */
.preview[data-stage="typing"] .preview__choices li { opacity: 0; transform: translateY(6px); }
.preview[data-stage="typing"] .preview__input { opacity: 0; }

/* ============================================================
   Continue
   ============================================================ */

#continue { margin-top: 28px; }
.continue-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.continue-head h2 { margin: 0; color: var(--accent-text); font-size: .8rem; font-weight: 600; letter-spacing: .06em; }
.continue-tools { display: flex; gap: 16px; }

/* 存档备份 / 导入：文字按钮，不抢「继续」的注意力 */
.link-btn {
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--text-3);
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
    transition: color .2s;
}
.link-btn:hover { color: var(--accent-text); }
/* 每个故事一份存档，按最近游玩排序 */
.continue-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.continue {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.continue__thumb {
    width: 52px;
    height: 68px;
    flex: none;
    border-radius: var(--radius-sm);
    object-fit: cover;
}
.continue__info { flex: 1; min-width: 0; }
.continue__info p { margin: 0; }
.continue__title {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.continue__meta { margin-top: 2px !important; color: var(--text-3); font-size: .8rem; }
.continue .btn { flex: none; }
.continue__delete { flex: none; color: var(--text-3); }
.continue__delete[data-confirm] { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ============================================================
   开局小窗
   ============================================================ */

.start-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text);
}
.start-dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
.start-dialog__card {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.start-dialog__head { display: flex; align-items: center; gap: 14px; }
.start-dialog__thumb { width: 56px; height: 72px; flex: none; border-radius: var(--radius-sm); object-fit: cover; }
.start-dialog__label { margin: 0; color: var(--accent-text); font-size: .78rem; font-weight: 600; letter-spacing: .06em; }
.start-dialog__title { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.4; }
.start-dialog__save {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text-2);
    font-size: .88rem;
    line-height: 1.6;
}
.start-dialog[data-mode="restart"] .start-dialog__save { color: var(--danger); }
.start-dialog__fresh { display: grid; gap: 10px; }
.start-dialog__fresh .field { margin: 0; }
.start-dialog input[type="text"],
.start-dialog textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text);
    font: inherit;
}
.start-dialog input[type="text"]:focus,
.start-dialog textarea:focus { outline: none; border-color: var(--accent); }
.start-dialog textarea { margin-top: 8px; resize: vertical; }
.start-dialog__more summary { color: var(--text-2); font-size: .88rem; cursor: pointer; }
.start-dialog__gender { display: flex; align-items: center; gap: 16px; margin: 0; padding: 0; border: 0; }
.start-dialog__gender legend { float: left; margin-right: 4px; color: var(--text-2); font-size: .88rem; font-weight: 600; }
.start-dialog__gender label { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; cursor: pointer; }
.start-dialog__gender input { accent-color: var(--accent); }
.start-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ============================================================
   Stories
   ============================================================ */

.stories { padding-block: clamp(48px, 7vw, 88px) 16px; }

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 32px;
    margin-bottom: 24px;
}
.section-sub { margin: 0; color: var(--text-2); }

.search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(100%, 320px);
}
.search .icon {
    position: absolute;
    left: 15px;
    width: 18px;
    height: 18px;
    color: var(--text-3);
    pointer-events: none;
}
.search input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 42px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: .86rem;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }

/* ---------- 货架 ---------- */

.shelf { margin-top: 40px; }

.shelf__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.shelf__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
}
.shelf__count {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-3);
    font-family: var(--font-ui);
    font-size: .74rem;
    font-weight: 600;
}
.shelf__sub { margin: .3rem 0 0; color: var(--text-3); font-size: .9rem; }

.shelf__nav { display: flex; gap: 6px; flex: none; }
.shelf__nav .icon-btn { border-color: var(--line-strong); }
.shelf:not(.is-scrollable) .shelf__nav { visibility: hidden; }

.shelf__track {
    --card-w: clamp(150px, 40vw, 224px);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--card-w);
    gap: 16px;
    /* 横向滚动区延伸到页面边距里，首张卡仍与内容区左对齐 */
    margin-inline: calc(-1 * var(--gutter));
    padding: 6px var(--gutter) 18px;
    scroll-padding-inline: var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.shelf__track::-webkit-scrollbar { display: none; }

@media (hover: none) {
    .shelf__nav { display: none; }
}

/* ---------- 搜索态：货架摊平成网格 ---------- */

.shelves.is-searching {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(180px, 42vw), 1fr));
    gap: 16px;
    margin-top: 8px;
}
.shelves.is-searching .shelf,
.shelves.is-searching .shelf__track { display: contents; }
.shelves.is-searching .shelf__head,
.shelves.is-searching .chips { display: none; }

.empty { padding: 48px 0; color: var(--text-3); text-align: center; }

/* ============================================================
   How it works
   ============================================================ */

.how { padding-block: clamp(64px, 9vw, 112px) 16px; }

.how__intro { max-width: 46rem; }
.how__intro p { margin: .75rem 0 0; color: var(--text-2); font-size: 1.02rem; line-height: 1.9; }

.features,
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.features { margin-top: 32px; }

.feature,
.step {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--surface), var(--bg-soft));
}
.feature h3,
.step h3 { margin: 0 0 6px; font-size: 1.06rem; font-weight: 700; }
.feature p,
.step p { margin: 0; color: var(--text-2); font-size: .93rem; line-height: 1.8; }

.feature__icon { width: 28px; height: 28px; margin-bottom: 14px; color: var(--accent-text); }

.how__steps-title { margin-top: 64px; }

.steps {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.step { counter-increment: step; }
.step::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    margin-bottom: 12px;
    color: var(--accent-text);
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

/* ============================================================
   FAQ
   ============================================================ */

.faq { padding-block: clamp(64px, 9vw, 112px); }

.faq__list {
    max-width: 52rem;
    margin-top: 20px;
    border-top: 1px solid var(--line);
}
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 4px;
    cursor: pointer;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.faq summary::after {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-right: 2px solid var(--text-3);
    border-bottom: 2px solid var(--text-3);
    transform: translateY(-2px) rotate(45deg);
    transition: transform .25s var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq summary:hover h3 { color: var(--accent-text); }
.faq details p {
    max-width: 44rem;
    margin: 0 4px 20px;
    color: var(--text-2);
    line-height: 1.85;
}

/* ============================================================
   Footer：故事索引
   ============================================================ */

.story-index h2 {
    margin: 0 0 16px;
    color: var(--text-2);
    font-family: var(--font-ui);
    font-size: .95rem;
    font-weight: 600;
}
.story-index ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 4px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.story-index a {
    color: var(--text-3);
    font-size: .9rem;
    line-height: 1.9;
    text-decoration: none;
    transition: color .2s;
}
.story-index a:hover { color: var(--accent-text); }

.story-index + .footer__bottom {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* ============================================================
   Settings sheet
   ============================================================ */

.sheet { margin: 0; }

.sheet__backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: calc(var(--topbar-h) + 12px) var(--gutter) 16px;
    background: rgba(5, 6, 8, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.sheet__backdrop.visible { opacity: 1; pointer-events: auto; }

.sheet__card {
    width: min(460px, 100%);
    max-height: calc(100svh - var(--topbar-h) - 28px);
    overflow: auto;
    padding: 20px 22px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    transition: transform .25s var(--ease-out);
}
.sheet__backdrop.visible .sheet__card { transform: none; }

.sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sheet__head h2 { margin: 0; font-family: var(--font-ui); font-size: 1.15rem; }

.sheet__context {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: .88rem;
    font-weight: 600;
}
.sheet__hint { margin: 8px 0 18px; color: var(--text-3); font-size: .85rem; }

.field { min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.field > label,
.field > legend {
    display: block;
    margin-bottom: 6px;
    padding: 0;
    color: var(--text-2);
    font-size: .82rem;
    font-weight: 600;
}

.sheet input[type="text"],
.sheet input[type="password"],
.sheet select,
.sheet textarea {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text);
    font-size: .92rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.sheet textarea { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.sheet input:focus,
.sheet select:focus,
.sheet textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sheet input::placeholder,
.sheet textarea::placeholder { color: var(--text-3); }
.field.is-invalid input { border-color: var(--danger); }

.field__row { display: flex; gap: 8px; }
.field__row select { flex: 1; min-width: 0; }
.field__row .btn { flex: none; height: 42px; }

.field__msg { min-height: 1.3em; margin: 8px 0 0; color: var(--text-3); font-size: .82rem; line-height: 1.6; }
.field__msg[data-tone="ok"] { color: var(--ok); }
.field__msg[data-tone="error"] { color: var(--danger); }
.field__link { display: inline-block; margin-top: 10px; color: var(--accent-text); font-size: .84rem; text-underline-offset: 3px; }
.field__hint { margin: 6px 0 12px; color: var(--text-3); font-size: .8rem; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .2s, color .2s, background-color .2s;
}
.preset:hover { border-color: var(--text-3); color: var(--text); }
.preset[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 600;
}

.sheet__advanced { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.sheet__advanced summary {
    padding: 4px 0;
    color: var(--text-2);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
}
.sheet__advanced[open] summary { margin-bottom: 4px; }

.sheet__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* ============================================================
   Toast
   ============================================================ */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 80;
    max-width: min(92vw, 480px);
    padding: 12px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-size: .9rem;
    transform: translateX(-50%);
    animation: toast-in .25s var(--ease-out);
}
.toast[data-tone="error"] { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.toast[data-tone="ok"] { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 960px) {
    .hero { min-height: 0; }
    .hero__inner { grid-template-columns: 1fr; }
    .hero__bg::after {
        background:
            linear-gradient(180deg, rgba(11, 12, 16, .55) 0%, rgba(11, 12, 16, .82) 42%, rgba(11, 12, 16, .95) 75%),
            linear-gradient(0deg, var(--hero-fade) 0%, rgba(11, 12, 16, 0) 18%);
    }
    .preview { justify-self: stretch; max-width: none; }
    .features,
    .steps { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .ai-status { max-width: 150px; padding: 0 12px; }

    .hero__ctas .btn { flex: 1 1 auto; }
    .preview__text { font-size: .96rem; margin-inline: 18px; }
    .preview__choices,
    .preview__input,
    .preview figcaption { margin-inline: 18px; }
    .preview__status { padding-inline: 18px; }

    .search { width: 100%; }
    .chips {
        flex-wrap: nowrap;
        margin-inline: calc(-1 * var(--gutter));
        padding-inline: var(--gutter);
        overflow-x: auto;
        scrollbar-width: none;
    }
    .chips::-webkit-scrollbar { display: none; }

    .continue { gap: 10px; }
    .continue-list { grid-template-columns: minmax(0, 1fr); } /* 1fr 会被不换行的长标题撑宽 */
    /* 手机上开局小窗贴底，像抽屉 */
    .start-dialog { width: 100vw; max-width: none; margin: auto 0 0; }
    .start-dialog__card { border-radius: 20px 20px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

    /* 设置面板在手机上改成底部抽屉 */
    .sheet__backdrop { align-items: flex-end; padding: 0; }
    .sheet__card {
        width: 100%;
        max-height: 88svh;
        border-radius: 20px 20px 0 0;
        border-bottom: 0;
        transform: translateY(24px);
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }
}
