:root {
    --deep-blue: #339BD8; 
    --wb-pink: #FF82A0; 
    --grad-bg: linear-gradient(150deg, #F0F8FF 0%, #E0F0FF 40%, #FFDEE9 100%);
    --glass: rgba(255, 255, 255, 0.67);
    --glass-heavy: rgba(255, 255, 255, 0.67);
    --frankie-pink: #FFB7C5; 
    --johnny-blue: #339BD8;  
    --pig-blue: #B7DAEA;
    --pig-blue-rgb: 183,218,234;
    --background-pink: #FFDEE9;
    --background-pink-rgb: 255, 222,233;
    --background-blue: #E0F0FF;
    --background-blue-rgb: 224,240,255;
    --glass-line: rgba(255,255,255,0.72);
    --glass-shadow: 0 12px 34px rgba(54,103,153,0.10);
    --glass-blur: blur(24px) saturate(1.45);
}

body, html { 
    margin: 0; padding: 0; 
    height: 100%; height: 100dvh;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    background: #F2F7FD;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container { 
    width: 100%; height: 100%; height: 100dvh; 
    display: flex; flex-direction: column; 
    overflow: hidden; position: relative; z-index: 1;
}

.glass-nav { 
    background: var(--glass); position: sticky; top: 0; z-index: 1000; 
    padding-top: max(env(safe-area-inset-top, 0px),0px) !important; 
    height: auto !important; min-height: 48px !important; 
    border-bottom: 0.5px solid rgba(0,0,0,0.05); 
    box-sizing: border-box; flex-shrink: 0;
}

.view { 
    flex: 1; width: 100%; overflow-y: auto; display: none; 
    padding-bottom: 100px; box-sizing: border-box; -webkit-overflow-scrolling: touch;
}

.view.active { display: block; animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

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

.glass-blur { backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.2); }
.nav-content { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.nav-title { font-size: 18px; font-weight: 800; background: linear-gradient(90deg, var(--frankie-pink), var(--johnny-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* 底部导航栏 */
.tab-bar { 
    position: fixed; bottom: 0; width: 100%; 
    background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(30px); 
    border-top: 1px solid rgba(255, 255, 255, 0.8); display: flex; 
    justify-content: space-around; padding-bottom: env(safe-area-inset-bottom); 
    height: calc(60px + env(safe-area-inset-bottom)); z-index: 2000; 
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.04); 
}
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #8E8E93; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.tab-item.active { color: var(--johnny-blue); font-weight: 800; transform: translateY(-1px); }
.tab-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 2px;}

/* 倒计时 */
#countdownArea {display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 0; gap: 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none;}
#countdownArea::-webkit-scrollbar { display: none; }
.countdown-widget { 
    flex: 0 0 82%; scroll-snap-align: center; margin: 4px 0; border-radius: 24px; padding: 16px 20px; 
    background: linear-gradient(217deg, rgba(var(--pig-blue-rgb), 0.7) 17%, rgba(var(--background-blue-rgb), 0.7) 50%, rgba(var(--background-pink-rgb), 0.7) 88%) !important; 
    backdrop-filter: blur(20px) !important; border: 1px solid rgba(255, 255, 255, 0.6) !important; 
    text-align: center; position: relative; box-shadow: 0 8px 32px rgba(31, 38, 135, 0.08) !important; 
    transition: transform 0.1s; cursor: pointer; 
}
.cd-title { color: var(--johnny-blue); font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.cd-days { font-size: 40px; font-weight: 900; background: linear-gradient(217deg, var(--frankie-pink) 27%, var(--johnny-blue) 77%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin: 2px 0; line-height: 1.1; }
.cd-date { color: var(--wb-pink); font-size: 11px; font-weight: 700; }

/* 帖子卡片 */
.post-card { 
    background: rgba(255, 255, 255, 0.3); margin: 14px 16px; border-radius: 24px; padding: 18px; 
    position: relative; backdrop-filter: blur(25px); border: 1px solid rgba(255, 255, 255, 0.5); 
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05); 
}
.post-header { display: flex; align-items: center; margin-bottom: 12px; cursor: pointer; }
.post-time { font-size: 11px; color: #8E8E93; margin-top: 2px; font-weight: 500; }
.user-ava { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; margin-right: 12px; border: 2px solid #FFF; box-shadow: 0 3px 10px rgba(0,0,0,0.06); }
.user-name { font-weight: 700; font-size: 15px; color: #222; }
.id-frankie { color: var(--frankie-pink) !important; }
.id-johnny { color: var(--johnny-blue) !important; }

.img-grid { display: grid; gap: 6px; margin: 12px 0; width: 100%; max-width: 317px; }
.img-grid.grid-1 { grid-template-columns: repeat(1, 1fr); width: 40%; max-width: 217px; min-width: 127px;}
.img-grid.grid-4 { grid-template-columns: repeat(2, 2fr); width: 67%; max-width: 327px; min-width: 217px;}
.img-grid.grid-other { grid-template-columns: repeat(3, 1fr); width:auto; max-width: 377px; min-width: 277px; } 
.img-grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: rgba(0,0,0,0.05); border-radius: 8px; }

.action-bar { display: flex; gap: 28px; padding-top: 12px; }
.act-btn { display: flex; align-items: center; gap: 6px; color: #555; font-size: 13px; cursor: pointer; transition: transform 0.1s; }
.act-btn:active { transform: scale(0.9); }
.act-btn.is-liked { color: var(--wb-pink); }
.svg-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-liked .svg-icon { fill: var(--wb-pink); stroke: var(--wb-pink); }

/* 表单与按钮 */
.form-container { padding: 0 20px; box-sizing: border-box; width: 100%; overflow-x: hidden;}
input, textarea, select { 
    width: 100%; min-width: 0; padding: 14px 16px; margin: 8px 0; 
    border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 16px; 
    background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px); 
    font-size: 14.5px; outline: none; box-sizing: border-box; display: block; 
    transition: border-color 0.2s, background 0.2s;
}
input:focus, textarea:focus, select:focus { background: rgba(255, 255, 255, 0.9); border-color: var(--deep-blue); }
.btn-main { 
    width: 100%; padding: 16px; background: var(--deep-blue); color: #fff; border: none; 
    border-radius: 18px; font-weight: 700; font-size: 16px; cursor: pointer; 
    margin-top: 10px; box-sizing: border-box; box-shadow: 0 6px 20px rgba(51, 153, 216, 0.25); 
    transition: transform 0.15s ease, opacity 0.2s ease; 
}
.btn-main:active { transform: scale(0.98); }

/* 评论区 */
.cmt-item { background: rgba(255, 255, 255, 0.5); border-radius: 18px; padding: 14px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.7); position: relative; box-shadow: 0 3px 17px rgba(0,0,0,0.06); }
.cmt-user-row { display: flex; align-items: center; margin-bottom: 8px; }
.cmt-ava { width: 32px; height: 32px; border-radius: 50%; margin-right: 8px; border: 2px solid #fff; }
.cmt-name { font-weight: 700; font-size: 14px; }
.cmt-body { font-size: 14px; color: #333; margin: 6px 0; line-height: 1.5; cursor: pointer; padding: 4px 0; }
.cmt-meta { font-size: 10px; color: #8E8E93; display: flex; justify-content: space-between; align-items: center; }
.cmt-reply-ref { background: rgba(0,0,0,0.05); padding: 8px; border-radius: 12px; font-size: 11px; margin-bottom: 8px; color: #666; border-left: 2px solid var(--deep-blue); }
.cmt-like-btn { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #888; cursor: pointer; }
.cmt-like-btn.is-liked { color: var(--wb-pink); }
.cmt-like-btn svg { width: 14px; height: 14px; }

/* 提示与弹窗 */
.custom-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); z-index: 2147483647 !important; display: flex; align-items: center; justify-content: center; }
.toast-message { position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-20px); background: linear-gradient(135deg, rgba(240, 248, 255, 0.95), rgba(255, 222, 233, 0.95)); backdrop-filter: blur(15px); color: var(--deep-blue); font-weight: 700; padding: 12px 24px; border-radius: 30px; font-size: 14px; z-index: 2147483647; box-shadow: 0 8px 25px rgba(51, 153, 216, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.8); border: 1px solid rgba(255, 255, 255, 0.5); opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none; white-space: nowrap; }
.toast-message.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 环境背景光球 */
.ambient-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--grad-bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.65; animation: floatOrb 20s infinite alternate ease-in-out; }
.orb-1 { width: 320px; height: 320px; background: linear-gradient(135deg, rgba(var(--pig-blue-rgb),1), rgba(var(--background-blue-rgb),1)); top: -50px; left: -60px; }
.orb-2 { width: 380px; height: 380px; background: linear-gradient(135deg, rgba(var(--background-pink-rgb),1), rgba(255,183,197,1)); bottom: -80px; right: -80px; animation-delay: -7s; }
.orb-3 { width: 260px; height: 260px; background: linear-gradient(135deg, rgba(var(--background-blue-rgb),1), rgba(194,233,251,1)); top: 40%; left: 50%; transform: translate(-50%, -50%); animation-delay: -12s; }
@keyframes floatOrb { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(30px, 40px) scale(1.15); } }

/* 液态玻璃与手风琴 */
.liquid-card { background: linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.45)); border: 1px solid var(--glass-line); border-radius: 23px; padding: 17px; box-shadow: var(--glass-shadow); backdrop-filter: var(--glass-blur); min-width: 0; }
.acc-group-card { padding: 14px; margin-bottom: 8px; }
.acc-head-btn { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent; padding: 4px; cursor: pointer; text-align: left; }
.acc-icon-box { width: 36px; height: 36px; flex: 0 0 36px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(145deg, rgba(206,233,255,0.78), rgba(255,224,238,0.75)); color: #527fa6; }
.acc-icon-box svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.acc-text { flex: 1; min-width: 0; }
.acc-text b { display: block; font-size: 13px; color: #314a62; font-weight: 800; }
.acc-text small { display: block; margin-top: 3px; color: #8795a5; font-size: 10px; line-height: 1.4; }
.acc-chevron { width: 20px; height: 20px; transition: transform 0.25s ease; flex: 0 0 auto; }
.acc-chevron svg { width: 100%; height: 100%; fill: none; stroke: #a3b2c1; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acc-body { display: none; padding-top: 10px; margin-top: 6px; border-top: 1px solid rgba(0,0,0,0.06); }
.acc-body.open { display: block; }
.acc-sub-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #5c7085; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; margin-bottom: 2px; transition: all 0.18s ease; }
.acc-sub-btn:hover { background: rgba(255,255,255,0.65); }
.acc-sub-btn.active { background: linear-gradient(120deg, rgba(51,155,216,0.14), rgba(255,130,160,0.1)); color: var(--deep-blue); font-weight: 800; border-color: rgba(51,155,216,0.2); }
.acc-dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd8e4; flex: 0 0 6px; }
.acc-sub-btn.active .acc-dot { background: var(--deep-blue); box-shadow: 0 0 0 3px rgba(51,155,216,0.2); }
.acc-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 8px 4px; }

/* 桌面端顶部导航 (横屏) */
.desktop-nav { display: none; position: relative; z-index: 2100; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 14px; padding: calc(10px + env(safe-area-inset-top)) 22px 10px; background: rgba(247,251,255,0.74); backdrop-filter: var(--glass-blur); border-bottom: 1px solid rgba(255,255,255,0.88); box-shadow: 0 4px 22px rgba(50,94,140,0.06); }
.desktop-brand { display: flex; align-items: center; gap: 9px; font-weight: 850; letter-spacing: 0.04em; color: var(--deep-blue); white-space: nowrap; font-size: 15px; }
.desktop-nav-items { display: flex; align-items: center; gap: 6px; }
.desktop-nav button { display: flex; align-items: center; gap: 5px; border: 1px solid transparent; background: transparent; color: #617184; border-radius: 14px; padding: 9px 13px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.desktop-nav button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.desktop-nav button.active { background: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.95); color: var(--deep-blue); box-shadow: 0 4px 15px rgba(51,155,216,0.12); }
.desktop-nav button.nav-publish { color: white; background: linear-gradient(120deg, var(--deep-blue), var(--wb-pink)); box-shadow: 0 6px 18px rgba(51,155,216,0.2); }
.desktop-nav button.nav-publish svg { stroke: white; }
.desktop-nav-utils { display: flex; align-items: center; gap: 8px; position: relative; }
.desktop-nav-utils button { display: flex; align-items: center; gap: 5px; border: 1px solid transparent; background: transparent; color: #617184; border-radius: 12px; padding: 8px 11px; font-size: 12px; font-weight: 600; cursor: pointer; }

/* 桌面搜索框 */
.desktop-search-container { position: relative; display: none; align-items: center; background: rgba(255,255,255,0.6); border-radius: 20px; padding: 0 12px; height: 34px; border: 1px solid rgba(255,255,255,0.8); }
.desktop-search-container input { border: none; background: transparent; padding: 0 8px; margin: 0; height: 100%; width: 180px; font-size: 13px; }
.desktop-search-container input:focus { background: transparent; outline: none; }
.desktop-search-results { position: absolute; top: 45px; right: 0; width: 380px; max-height: 70vh; overflow-y: auto; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border: 1px solid rgba(255,255,255,0.8); display: none; flex-direction: column; padding: 10px; z-index: 3000; }
.search-group-title { font-size: 13px; font-weight: bold; color: var(--deep-blue); padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,0.05); margin-bottom: 8px; margin-top: 8px; cursor: pointer; display: flex; justify-content: space-between;}
.search-group-title:first-child { margin-top: 0; }
.search-item { padding: 10px; border-radius: 8px; background: rgba(0,0,0,0.02); margin-bottom: 6px; font-size: 13px; cursor: pointer; line-height: 1.5; }
.search-item:hover { background: rgba(0,0,0,0.06); }

/* 发布页左右分栏 */
.publish-layout { display: block; }
.publish-preview { display: none; }

/* 档案馆卡片 */
.archive-card { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 10px; border: 1px solid transparent; border-radius: 17px; background: transparent; color: #40566d; text-align: left; cursor: pointer; transition: all 0.18s ease; min-width: 0; margin-bottom: 4px; }
.archive-card:hover, .archive-card.active { background: rgba(255,255,255,0.82); border-color: rgba(255,255,255,0.95); outline: none; box-shadow: 0 4px 14px rgba(51,155,216,0.08); }
.archive-card-icon { width: 36px; height: 36px; flex: 0 0 36px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(145deg, rgba(206,233,255,0.78), rgba(255,224,238,0.75)); color: #527fa6; }
.archive-card-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.archive-card-text { flex: 1; min-width: 0; }
.archive-card-text b { display: block; font-size: 13px; font-weight: 800; color: #314a62; }
.archive-card-text small { display: block; margin-top: 4px; color: #8795a5; font-size: 10px; line-height: 1.4; }
.archive-card-chevron { font-size: 23px; color: #a3b2c1; flex: 0 0 auto; }

/* 其他辅助类 */
#jumpMonthBtn { display: flex; position: fixed; right: 20px; bottom: 90px; z-index: 100; width: 48px; height: 48px; border-radius: 50%; background: var(--glass-heavy); backdrop-filter: blur(10px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); align-items: center; justify-content: center; cursor: pointer; font-size: 20px; }
.home-detail { display: flex; flex-direction: column; }
.home-feed-pane, .home-detail-pane { width: 100%; flex: 1; }
.post-text-collapsed { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.post-text-toggle { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--deep-blue); cursor: pointer; font-weight: 500; }
.setting-item { display: flex; align-items: center; gap: 12px; padding: 14px 12px; background: rgba(255,255,255,0.5); border-radius: 16px; margin-bottom: 8px; cursor: pointer; transition: background 0.2s; }
.setting-item:active { background: rgba(255,255,255,0.8); }
.setting-item span:first-of-type { flex: 1; font-size: 14px; color: #333; }

/* ================== 响应式布局 (断点 700px) ================== */
@media (min-width: 700px) {
    .desktop-nav { display: flex; }
    .desktop-search-container { display: flex; }
    #mainTabBar { display: none !important; }
    .view { padding-bottom: 30px !important; }
    #homeView > .glass-nav, #archiveView > .glass-nav, #checkinView > .glass-nav, #profileView > .glass-nav { display: none !important; }

    /* 首页 2.5:7.5 分栏 */
    #homeView.active { display: grid !important; grid-template-columns: 27% 73%; align-content: start; align-items: start; overflow: hidden !important; padding: 0 !important; height: calc(100dvh - 62px); }
    /* 档案馆 30:70 分栏 */
    #archiveView.active { display: grid !important; grid-template-columns: 30% 70%; align-content: start; align-items: start; overflow: hidden !important; padding: 0 !important; height: calc(100dvh - 62px); }
    /* 打卡页 6:4 分栏 */
    #checkinView.active { display: grid !important; grid-template-columns: 6fr 4fr !important; align-content: start; overflow: hidden !important; padding: 0 !important; height: calc(100dvh - 62px); }
    /* 个人主页 1:1 分栏 */
    #profileView.active { display: grid !important; grid-template-columns: 1fr 1fr !important; align-content: start; overflow: hidden !important; padding: 0 !important; height: calc(100dvh - 62px); }

    .home-master, .archive-master, .checkin-master, .profile-master { 
        display: block !important; overflow-y: auto; overflow-x: hidden; padding: 16px 12px 20px; 
        border-right: 1px solid rgba(255,255,255,0.7); background: linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.45)); 
        backdrop-filter: var(--glass-blur); height: 100%; box-sizing: border-box; scrollbar-width: thin; 
    }
    .home-detail, .archive-detail, .checkin-detail, .profile-detail { 
        display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; 
        padding: 16px 20px 30px; height: 100%; scrollbar-width: thin; 
    }

    #mainTabBarHome, #tagFilterBar, #subTimelineTabs { display: none !important; }
    #jumpMonthBtn { bottom: 30px; right: 30px; }

    /* 发布页左右栏 */
    .publish-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; max-width: 1100px; margin: 0 auto; padding: 20px; }
    .publish-preview { display: block; position: sticky; top: 80px; align-self: start; background: rgba(255,255,255,0.6); padding: 20px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.8); }
}

@media (max-width: 699px) {
    .home-master { display: none !important; }
    .home-detail { display: block !important; padding: 0 !important; width: 100% !important; }
    #mainTabBarHome { display: flex !important; }
    #archiveView.active, #checkinView.active, #profileView.active { display: block !important; height: auto !important; overflow-y: auto !important; padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
    .archive-master, .checkin-master, .profile-master { display: block !important; overflow: visible !important; padding: 10px 16px 0 !important; border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.6); height: auto !important; background: transparent !important; backdrop-filter: none !important; }
    .archive-detail, .checkin-detail, .profile-detail { display: block !important; overflow: visible !important; padding: 10px 16px 20px !important; height: auto !important; background: transparent !important; backdrop-filter: none !important; }
    
    #tagFilterBar { display: flex !important; }
    #subTimelineTabs { display: flex !important; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(51,155,216,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(51,155,216,0.4); }
