/* ============================================================
   念你 · 全局样式
   ============================================================ */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; overflow:auto; }
body {
    background:#FCF7F0;
    font-family:-apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    font-weight:400;
    line-height:1.8;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    display:flex;
    align-items:center;
    justify-content:center;
}
.phone-frame {
    width:100%;
    max-width:420px;
    background:#FCF7F0;
    border-radius:0;
    overflow:visible;
    display:flex;
    flex-direction:column;
    position:relative;
    box-shadow:0 20px 60px rgba(60,36,21,0.08);
}
.page-list { display:flex; flex-direction:column; overflow:visible; transition:opacity 0.25s ease, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.page-list.hidden { opacity:0; transform:scale(0.96); pointer-events:none; }
.page-write {
    position:fixed;
    top:0; left:0; right:0; bottom:0;
    width:100%;
    height:100vh;
    height:100dvh;
    background:#FCF7F0;
    z-index:1000;
    display:flex;
    flex-direction:column;
    opacity:0;
    pointer-events:none;
    transition:opacity 0.3s ease, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    transform:translateY(20px);
    padding:0 24px 100px;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
}
.page-write.open { opacity:1; pointer-events:auto; transform:translateY(0); }
.page-write .write-body,
.page-write .write-header { max-width:560px; width:100%; margin:0 auto; }
.list-scroll { overflow:visible; padding:0 20px 20px; }
.list-scroll::-webkit-scrollbar, .page-write::-webkit-scrollbar { width:6px; }
.list-scroll::-webkit-scrollbar-track, .page-write::-webkit-scrollbar-track { background:transparent; }
.list-scroll::-webkit-scrollbar-thumb, .page-write::-webkit-scrollbar-thumb { background:rgba(180,150,130,0.25); border-radius:4px; }
@media (min-width:520px) {
    body { background:#F7F1E8; padding:20px; display:flex; align-items:center; justify-content:center; min-height:100vh; height:auto; }
    .phone-frame { max-width:560px; max-height:none; height:auto; border-radius:0; box-shadow:0 20px 60px rgba(60,36,21,0.10), 0 0 0 1px rgba(180,150,130,0.06); overflow:visible; margin:0 auto; }
    .page-list { overflow:visible; height:auto; }
    .list-scroll { overflow:visible; height:auto; padding-bottom:20px; }
    .page-write {
        padding:40px 24px 100px;
        background:rgba(252,247,240,0.98);
        backdrop-filter:blur(8px);
        -webkit-backdrop-filter:blur(8px);
        justify-content:center;
        align-items:center;
        transform:translateY(0);
        transition:opacity 0.3s ease;
    }
    .page-write .write-body { flex:0 1 auto; max-height:70vh; overflow-y:auto; }
    .page-write .write-header { flex-shrink:0; }
    .bottom-nav { position:sticky; bottom:0; flex-shrink:0; }
}
@media (max-width:519px) {
    .phone-frame { max-height:none; border-radius:0; box-shadow:none; }
    body { background:#FCF7F0; padding:0; }
    .list-scroll {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }
    .page-write { padding:16px 16px 80px; background:#FCF7F0; backdrop-filter:none; -webkit-backdrop-filter:none; }
}
@media (prefers-color-scheme:dark) {
    body { background:#1A1512; }
    .phone-frame { background:#1A120E; }
    .page-write { background:#1A120E; }
    .bottom-nav { background:rgba(26,18,14,0.88); border-top-color:rgba(180,150,130,0.08); }
    .bottom-nav .nav-item { color:#8B7355; }
    .bottom-nav .nav-item.active { color:#EDE0D6; }
    .bottom-nav .nav-item.center .icon { box-shadow:0 4px 16px rgba(212,146,122,0.20); }
    @media (min-width:520px) {
        body { background:#0F0C0A; }
        .phone-frame { box-shadow:0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03); }
        .page-write { background:rgba(26,18,14,0.98); }
    }
    @media (max-width:519px) { .page-write { background:#1A120E; } }
}
@media (max-width:440px) {
    .list-scroll { padding:0 16px 16px; }
    .page-write { padding:12px 16px 80px; }
    .bottom-nav { height:58px; padding:6px 0 env(safe-area-inset-bottom,4px) 0; }
    .bottom-nav .nav-item .icon { font-size:20px; }
    .bottom-nav .nav-item.center .icon { width:48px; height:48px; font-size:24px; }
}
@media (max-width:380px) {
    .bottom-nav .nav-item .label { font-size:9px; }
    .bottom-nav .nav-item { padding:2px 8px; }
    .bottom-nav .nav-item.center .icon { width:44px; height:44px; font-size:22px; }
}

/* 顶部锚点隐藏 */
#top-anchor {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    opacity: 0;
}
/* 强制手机端使用 window 滚动 */
@media (max-width:519px) {
    html, body {
        height: auto !important;
        min-height: 100vh !important;
        overflow: auto !important;
    }
    body {
        display: block !important;
        padding: 0 !important;
    }
    .list-scroll {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }
    .page-list {
        overflow: visible !important;
        height: auto !important;
    }
    .phone-frame {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}
/* 强制手机端使用 window 滚动（不要修改此块） */
@media (max-width:519px) {
    html, body {
        height: auto !important;
        min-height: 100vh !important;
        overflow: auto !important;
    }
    body {
        display: block !important;
        padding: 0 !important;
    }
    .list-scroll {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }
    .page-list {
        overflow: visible !important;
        height: auto !important;
    }
    .phone-frame {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}
/* ===== 强制优化写留言面板的文本框和按钮（不改变其他代码） ===== */
/* 文本框：与页面其他输入框风格一致 */
.write-body textarea {
    border: 1.5px solid rgba(180,150,130,0.15) !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,0.5) !important;
    padding: 16px 18px !important;
    font-size: 17px !important;
    font-family: inherit !important;
    line-height: 1.9 !important;
    color: #1E130E !important;
    resize: none !important;
    outline: none !important;
    transition: border-color 0.2s, background 0.2s !important;
}
.write-body textarea:focus {
    border-color: #D4927A !important;
    background: #fff !important;
}
.write-body textarea::placeholder {
    color: #B8A090 !important;
}

/* “寄出”按钮：与“✨ AI 帮我想”完全一致 */
.write-body .submit-btn {
    background: linear-gradient(135deg, #D4927A, #E8B4A0) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;        /* 与AI按钮一致 */
    padding: 10px 24px !important;         /* 与AI按钮一致 */
    font-size: 15px !important;            /* 与AI按钮一致 */
    font-weight: 500 !important;
    font-family: inherit !important;
    letter-spacing: 0.5px !important;      /* 与AI按钮相近 */
    box-shadow: 0 2px 16px rgba(212,146,122,0.25) !important;
    cursor: pointer !important;
    transition: transform 0.15s, box-shadow 0.15s !important;
    width: auto !important;
    display: inline-block !important;
    margin-top: 4px !important;
}
.write-body .submit-btn:active {
    transform: scale(0.97) !important;
    box-shadow: 0 1px 8px rgba(212,146,122,0.15) !important;
}
.write-body .submit-btn:disabled {
    opacity: 0.5 !important;
    transform: none !important;
}