/* =========================================================
 * 工具站扁平风格 app 外壳
 * body.app-shell 提供顶栏、页脚、底部 Dock 和全局设计变量
 * body.app-home 额外启用首页启动页样式
 * ========================================================= */

body.app-shell {
    --app-bg: #f3f4f6;
    --app-bg-soft: #ffffff;
    --app-text: #111827;
    --app-muted: #5b6472;
    --app-faint: #8b93a1;
    --app-line: #e2e5ea;
    --app-line-strong: #cdd2da;
    --app-card: #ffffff;
    --app-card-solid: #ffffff;
    --app-soft: #f0f2f5;
    --app-soft-hover: #e6e9ee;
    --app-accent: #2563eb;
    --app-accent-strong: #1d4ed8;
    --app-accent-soft: rgba(37, 99, 235, .12);
    --app-primary: #2563eb;
    --app-primary-strong: #1d4ed8;
    --app-green: #16a34a;
    --app-shadow: none;
    --app-shadow-lg: none;
    --app-radius: 14px;
    --app-max: 1120px;

    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    padding-bottom: 0;
}

html[data-app-home] body.app-shell {
    background-attachment: fixed;
}

body.app-shell *,
body.app-shell *::before,
body.app-shell *::after {
    box-sizing: border-box;
}

body.app-shell a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

body.app-shell button {
    font: inherit;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

body.app-shell h1,
body.app-shell h2,
body.app-shell h3,
body.app-shell p {
    margin: 0;
}

body.app-shell p {
    line-height: 1.5;
}

body.app-shell [hidden] {
    display: none !important;
}

@media (prefers-color-scheme: dark) {
    body.app-shell {
        --app-bg: #0f1115;
        --app-bg-soft: #161a20;
        --app-text: #f3f4f6;
        --app-muted: #a6adba;
        --app-faint: #7f8794;
        --app-line: #272c35;
        --app-line-strong: #363d49;
        --app-card: #171b22;
        --app-card-solid: #171b22;
        --app-soft: #1e232c;
        --app-soft-hover: #282f3a;
        --app-accent: #60a5fa;
        --app-accent-strong: #3b82f6;
        --app-accent-soft: rgba(96, 165, 250, .16);
        --app-primary: #2563eb;
        --app-primary-strong: #1d4ed8;

        background: var(--app-bg);
    }
}

/* ---------- 可访问性 ---------- */
.app-skip {
    position: fixed;
    z-index: 200;
    top: -80px;
    left: 16px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--app-primary);
    color: #fff !important;
    font-size: 14px;
    transition: top .2s ease;
}

.app-skip:focus {
    top: 14px;
}

/* ---------- 顶部导航 ---------- */
.app-topbar {
    position: sticky;
    z-index: 60;
    top: 0;
    padding-top: env(safe-area-inset-top);
    border-bottom: 1px solid var(--app-line);
    background: var(--app-bg-soft);
}

.app-topbar-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    width: min(var(--app-max), calc(100% - 48px));
    height: 60px;
    margin: 0 auto;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.025em;
}

.app-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--app-soft);
}

.app-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topnav {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-topnav::-webkit-scrollbar {
    display: none;
}

.app-topnav a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--app-muted);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .18s ease, color .18s ease;
}

.app-topnav a:hover {
    background: var(--app-soft);
    color: var(--app-text);
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.app-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--app-soft);
    color: var(--app-muted);
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.app-icon-btn:hover {
    background: var(--app-soft-hover);
    color: var(--app-text);
}

.app-icon-btn:active {
    transform: scale(.94);
}

.app-install-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 15px;
    border: 0;
    border-radius: 8px;
    background: var(--app-primary);
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease;
}

.app-install-btn:hover {
    background: var(--app-primary-strong);
}

.app-install-btn:active {
    transform: scale(.96);
}

/* ---------- 页面容器 ---------- */
.app-main {
    display: block;
    flex: 1 0 auto;
}

.app-page {
    width: min(var(--app-max), calc(100% - 48px));
    margin: 0 auto;
    padding: 42px 0 20px;
}

/* ---------- Hero ---------- */
.app-hero {
    position: relative;
    padding: 34px 0 30px;
    isolation: isolate;
}

.app-hero-glow {
    display: none;
}

.app-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--app-faint);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-date {
    color: var(--app-muted);
    letter-spacing: .02em;
}

.app-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--app-muted);
    letter-spacing: .02em;
}

.app-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--app-green);
}

.app-hero h1 {
    max-width: 860px;
    margin-top: 20px;
    font-size: clamp(38px, 5.8vw, 64px);
    font-weight: 700;
    line-height: 1.03;
    letter-spacing: -.055em;
}

.app-hero h1 span {
    color: var(--app-muted);
}

.app-lead {
    max-width: 610px;
    margin-top: 20px !important;
    color: var(--app-muted);
    font-size: clamp(16px, 1.7vw, 19px);
    line-height: 1.55;
    letter-spacing: -.012em;
}

.app-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.app-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-card);
    color: var(--app-text);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.app-pill:hover {
    border-color: var(--app-line-strong);
    background: var(--app-soft);
}

.app-pill:active {
    background: var(--app-soft-hover);
}

.app-pill--primary {
    border-color: transparent;
    background: var(--app-primary);
    color: #fff !important;
}

.app-pill--primary:hover {
    border-color: transparent;
    background: var(--app-primary-strong);
    color: #fff !important;
}

/* ---------- 搜索 ---------- */
.app-search-shell {
    position: relative;
    margin: 14px 0 12px;
}

.app-search {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 14px 0 20px;
    border: 1px solid var(--app-line);
    border-radius: 12px;
    background: var(--app-card);
    color: var(--app-muted);
    cursor: text;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.app-search:focus-within {
    border-color: var(--app-accent);
    background: var(--app-card);
    box-shadow: 0 0 0 3px var(--app-accent-soft);
}

.app-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--app-text);
    font: inherit;
    font-size: 16.5px;
    letter-spacing: -.012em;
    -webkit-appearance: none;
}

.app-search input::placeholder {
    color: var(--app-faint);
}

.app-search input::-webkit-search-cancel-button {
    display: none;
}

.app-search-clear {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 0;
    border-radius: 999px;
    background: var(--app-soft);
    color: var(--app-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.app-search-clear:hover {
    background: var(--app-soft-hover);
    color: var(--app-text);
}

.app-search-kbd {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid var(--app-line);
    border-radius: 7px;
    background: var(--app-soft);
    color: var(--app-faint);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
}

.app-search-status {
    min-height: 19px;
    padding: 9px 4px 0;
    color: var(--app-muted);
    font-size: 12.5px;
}

.app-quick-stats {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 4px 0;
    color: var(--app-faint);
    font-size: 12.5px;
}

.app-quick-stats strong {
    color: var(--app-text);
    font-weight: 650;
}

.app-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--app-faint);
    opacity: .55;
}

/* ---------- 区块标题 ---------- */
.app-section {
    margin-top: 58px;
    scroll-margin-top: 84px;
}

.app-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.app-kicker {
    margin-bottom: 5px !important;
    color: var(--app-faint);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.app-section h2 {
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.app-section-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
    padding: 7px 0;
    color: var(--app-accent) !important;
    font-size: 14px;
    font-weight: 600;
    transition: opacity .18s ease;
}

.app-section-link:hover {
    opacity: .7;
}

.app-section-note {
    flex: 0 0 auto;
    padding-bottom: 3px;
    color: var(--app-faint);
    font-size: 12.5px;
}

/* ---------- 诗词站入口 ---------- */
.app-section--poem {
    margin-top: 38px;
}

.app-poem-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 28px;
    border: 1px solid var(--app-line);
    border-radius: 14px;
    background:
        radial-gradient(circle at 92% 10%, rgba(163, 59, 43, .1), transparent 16rem),
        var(--app-card);
    color: var(--app-text);
    transition: border-color .18s ease, transform .18s ease;
}

.app-poem-card:hover {
    border-color: rgba(163, 59, 43, .38);
    transform: translateY(-1px);
}

.app-poem-seal {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(145deg, #b84936, #922f22);
    color: #fff8ef;
    font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

.app-poem-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-poem-copy .app-kicker {
    color: #a33b2b;
}

.app-poem-copy strong {
    font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.3;
}

.app-poem-desc {
    color: var(--app-muted);
    font-size: 13px;
    line-height: 1.5;
}

.app-poem-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    margin-left: auto;
    color: #a33b2b;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
    .app-poem-card {
        background:
            radial-gradient(circle at 92% 10%, rgba(184, 73, 54, .18), transparent 16rem),
            var(--app-card);
    }

    .app-poem-copy .app-kicker,
    .app-poem-action {
        color: #e5a092;
    }
}

/* ---------- 我的工具 ---------- */
.app-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.app-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 12px 6px;
    border-radius: 12px;
    text-align: center;
    transition: background .18s ease;
}

.app-icon-card:hover {
    background: var(--app-soft);
}

.app-icon-card:active {
    transform: scale(.96);
}

.app-icon-title {
    max-width: 100%;
    overflow: hidden;
    color: var(--app-text);
    font-size: 12.5px;
    font-weight: 560;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- App 图标 ---------- */
.app-app-icon {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: hsl(calc(var(--tone) * 1deg) 68% 52%);
    color: #fff;
}

.app-app-icon--small {
    width: 60px;
    height: 60px;
    border-radius: 14px;
}

.app-glyph {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
}

.app-glyph svg {
    width: 100%;
    height: 100%;
}

.app-app-icon--small .app-glyph {
    width: 30px;
    height: 30px;
}

/* ---------- 时间工具 / 横向 app 卡 ---------- */
.app-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 12px;
}

.app-tile {
    position: relative;
    border: 1px solid var(--app-line);
    border-radius: 14px;
    background: var(--app-card);
    transition: border-color .18s ease, background .18s ease;
    overflow: hidden;
}

.app-tile:hover {
    border-color: var(--app-line-strong);
    background: var(--app-soft);
}

.app-tile-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 86px;
    padding: 15px 17px;
}

.app-tile-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-tile-title {
    color: var(--app-text);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.app-tile-sub {
    display: -webkit-box;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 12.5px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.app-tile-category {
    margin-top: 2px;
    color: var(--app-faint);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
}

/* ---------- 收藏按钮 ---------- */
.app-fav {
    position: absolute;
    z-index: 2;
    top: 9px;
    right: 9px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--app-soft);
    color: var(--app-muted);
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.app-fav::before {
    content: "♡";
    font-size: 15px;
    line-height: 1;
}

.app-fav.active {
    background: rgba(255, 59, 48, .12);
    color: #ff3b30;
}

.app-fav.active::before {
    content: "♥";
}

.app-fav:hover {
    background: var(--app-soft-hover);
}

.app-fav:active {
    transform: scale(.88);
}

.app-fav-count {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- 分类卡 ---------- */
.app-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.app-category-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-height: 140px;
    padding: 18px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-card);
    transition: border-color .18s ease, background .18s ease;
}

.app-category-card:hover {
    border-color: var(--app-line-strong);
    background: var(--app-soft);
}

.app-category-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: hsl(calc(var(--tone) * 1deg) 68% 52%);
    color: #fff;
}

.app-category-icon svg {
    width: 24px;
    height: 24px;
}

.app-category-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-right: 18px;
}

.app-category-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.025em;
}

.app-category-summary {
    display: -webkit-box;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 12.5px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.app-category-meta {
    margin-top: 4px;
    color: var(--app-faint);
    font-size: 11.5px;
    font-weight: 560;
}

.app-category-arrow {
    position: absolute;
    right: 16px;
    bottom: 16px;
    color: var(--app-faint);
    opacity: .8;
}

/* ---------- 全部工具 ---------- */
.app-filter-row {
    display: flex;
    gap: 7px;
    margin: 0 -2px 16px;
    padding: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-filter-row::-webkit-scrollbar {
    display: none;
}

.app-filter {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: var(--app-card);
    color: var(--app-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.app-filter:hover {
    background: var(--app-soft-hover);
    color: var(--app-text);
}

.app-filter.is-active {
    border-color: transparent;
    background: var(--app-text);
    color: var(--app-bg);
}

.app-filter:active {
    transform: scale(.96);
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    gap: 10px;
}

.app-grid .app-tile-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 11px;
    min-height: 166px;
    padding: 16px;
}

.app-grid .app-app-icon {
    width: 52px;
    height: 52px;
    border-radius: 11px;
}

.app-grid .app-glyph {
    width: 26px;
    height: 26px;
}

.app-grid .app-tile-copy {
    gap: 3px;
    width: 100%;
    padding-right: 4px;
}

.app-grid .app-tile-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.app-grid .app-tile-sub {
    font-size: 11.5px;
    -webkit-line-clamp: 2;
}

.app-grid .app-tile-category {
    font-size: 10px;
}

.app-empty {
    padding: 56px 20px;
    border: 1px dashed var(--app-line-strong);
    border-radius: var(--app-radius);
    color: var(--app-muted);
    text-align: center;
}

.app-empty span {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.app-empty span svg {
    width: 36px;
    height: 36px;
}

.app-empty strong {
    display: block;
    color: var(--app-text);
    font-size: 16px;
}

.app-empty p {
    margin-top: 5px !important;
    font-size: 13px;
}

/* ---------- 安装卡片 ---------- */
.app-install-card {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 58px;
    padding: 24px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--app-primary);
    color: #fff !important;
    overflow: hidden;
}

.app-install-icon img {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 12px;
}

.app-install-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.app-install-copy h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.03em;
}

.app-install-copy p {
    margin-top: 3px !important;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    line-height: 1.5;
}

.app-install-card .app-pill {
    flex: 0 0 auto;
    border-color: transparent;
    background: #ffffff;
    color: var(--app-primary) !important;
}

.app-install-card .app-pill:hover {
    border-color: transparent;
    background: #eef2ff;
    color: var(--app-primary) !important;
}

/* ---------- 页脚 ---------- */
.app-footer {
    margin-top: 70px;
    border-top: 1px solid var(--app-line);
    padding: 34px 0 36px;
    color: var(--app-muted);
    font-size: 12.5px;
}

.app-footer-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 30px;
    width: min(var(--app-max), calc(100% - 48px));
    margin: 0 auto;
}

.app-footer-brand img {
    display: block;
    width: 34px;
    height: 34px;
    margin-bottom: 11px;
    border-radius: 9px;
    background: var(--app-soft);
}

.app-footer-brand strong {
    display: block;
    color: var(--app-text);
    font-size: 14px;
    font-weight: 650;
}

.app-footer-brand p {
    max-width: 260px;
    margin-top: 4px !important;
    line-height: 1.55;
}

.app-footer-nav,
.app-footer-categories {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 7px 18px;
    padding-top: 5px;
}

.app-footer-nav a,
.app-footer-categories a {
    color: var(--app-muted);
    transition: color .18s ease;
}

.app-footer-nav a:hover,
.app-footer-categories a:hover {
    color: var(--app-text);
}

.app-footer-categories a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.app-footer-categories a > span {
    display: inline-flex;
    align-items: center;
}

.app-footer-categories svg {
    width: 14px;
    height: 14px;
}

.app-footer-categories small {
    color: var(--app-faint);
    font-size: 10px;
}

.app-footer-bottom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    width: min(var(--app-max), calc(100% - 48px));
    margin: 26px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--app-line);
    color: var(--app-faint);
}

.app-footer-bottom p {
    line-height: 1.5;
}

.app-footer-bottom a {
    color: var(--app-faint);
}

/* ---------- 移动端底部导航 ---------- */
.app-dock {
    display: none;
}

/* ---------- 安装说明面板 ---------- */
.app-sheet {
    width: min(440px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--app-line);
    border-radius: 16px;
    background: var(--app-card-solid);
    color: var(--app-text);
}

.app-sheet::backdrop {
    background: rgba(15, 17, 21, .5);
}

.app-sheet[open] {
    animation: app-sheet-in .24s cubic-bezier(.2, .8, .2, 1);
}

@keyframes app-sheet-in {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px 0;
}

.app-sheet-head h2 {
    font-size: 20px;
    letter-spacing: -.03em;
}

.app-sheet-close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--app-soft);
    color: var(--app-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.app-sheet-body {
    padding: 12px 24px 24px;
}

.app-sheet-lead {
    color: var(--app-muted);
    font-size: 14px;
    line-height: 1.6;
}

.app-sheet-steps {
    margin: 16px 0 0;
    padding-left: 20px;
    color: var(--app-muted);
    font-size: 13.5px;
    line-height: 1.7;
}

.app-sheet-steps li + li {
    margin-top: 8px;
}

/* ---------- Toast ---------- */
.app-toast {
    position: fixed;
    z-index: 120;
    left: 50%;
    bottom: calc(88px + env(safe-area-inset-bottom));
    max-width: calc(100% - 40px);
    padding: 10px 18px;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-card-solid);
    color: var(--app-text);
    font-size: 13px;
    font-weight: 560;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity .2s ease, transform .2s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- 平板 ---------- */
@media (max-width: 900px) {
    .app-topnav {
        display: none;
    }

    .app-footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .app-footer-brand {
        grid-column: 1 / -1;
    }
}

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
    .app-topbar-inner,
    .app-page,
    .app-footer-inner,
    .app-footer-bottom {
        width: calc(100% - 36px);
    }

    .app-topbar-inner {
        height: 56px;
        gap: 10px;
    }

    .app-brand-name {
        max-width: 150px;
    }

    .app-install-btn span {
        display: none;
    }

    .app-install-btn {
        width: 36px;
        padding: 0;
        justify-content: center;
    }

    .app-page {
        padding-top: 22px;
    }

    .app-hero {
        padding: 18px 0 22px;
    }

    .app-hero-glow {
        right: -30%;
        width: 330px;
    }

    .app-hero h1 {
        margin-top: 16px;
        font-size: clamp(34px, 10.8vw, 46px);
        letter-spacing: -.052em;
    }

    .app-lead {
        margin-top: 14px !important;
        font-size: 15px;
    }

    .app-hero-actions {
        margin-top: 22px;
    }

    .app-search {
        height: 54px;
        padding-left: 16px;
        border-radius: 12px;
    }

    .app-search input {
        font-size: 16px;
    }

    .app-search-kbd {
        display: none;
    }

    .app-section {
        margin-top: 44px;
    }

    .app-section-head {
        align-items: center;
        margin-bottom: 14px;
    }

    .app-section-note {
        display: none;
    }

    .app-card-grid {
        grid-template-columns: 1fr;
    }

    .app-poem-card {
        flex-wrap: wrap;
        gap: 14px;
        padding: 20px;
    }

    .app-poem-action {
        width: 100%;
        margin-left: 62px;
    }

    .app-category-grid {
        grid-template-columns: 1fr;
    }

    .app-category-card {
        min-height: 126px;
        padding: 18px;
    }

    .app-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .app-grid .app-tile-link {
        min-height: 160px;
        padding: 14px;
    }

    .app-install-card {
        flex-wrap: wrap;
        gap: 14px;
        margin-top: 44px;
        padding: 20px;
        border-radius: 14px;
    }

    .app-install-copy {
        flex: 1 1 calc(100% - 74px);
    }

    .app-install-card .app-pill {
        width: 100%;
        margin-top: 2px;
    }

    .app-footer {
        margin-top: 52px;
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .app-footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .app-footer-brand {
        grid-column: auto;
    }

    .app-footer-bottom {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .app-dock {
        position: fixed;
        z-index: 80;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        left: 12px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 2px;
        padding: 7px 6px;
        border: 1px solid var(--app-line);
        border-radius: 14px;
        background: var(--app-bg-soft);
    }

    .app-dock a,
    .app-dock button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 50px;
        padding: 4px 2px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--app-faint);
        font-size: 10px;
        font-weight: 560;
        cursor: pointer;
        transition: background .18s ease, color .18s ease;
    }

    .app-dock svg {
        width: 22px;
        height: 22px;
    }

    .app-dock a.is-active,
    .app-dock a:hover,
    .app-dock button:hover {
        background: var(--app-soft);
        color: var(--app-text);
    }

    .app-toast {
        bottom: calc(88px + env(safe-area-inset-bottom));
    }

    .app-sheet {
        width: 100%;
        max-width: 100%;
        margin: auto 0 0;
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ---------- 独立 App 模式 ---------- */
@media (display-mode: standalone) {
    body.app-shell {
        overscroll-behavior-y: none;
    }

    .app-topbar {
        padding-top: max(env(safe-area-inset-top), 8px);
    }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    body.app-shell *,
    body.app-shell *::before,
    body.app-shell *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
