/* 主页：桌面端可用「粘性页脚」；移动端页脚须跟在内容之后，避免粘在视口底部 */
body.page-home {
    padding-bottom: 0;
}

/* 主页 index.html：弹性布局；min-height 仅在较宽屏启用，避免手机上网页很短时页脚悬在屏幕中间 */
.home-layout {
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 24px;
}

.home-header {
    text-align: center;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

.home-header .brand {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.home-header .brand-logo {
    width: 96px;
    height: 96px;
}

.home-header .brand-text h1 {
    font-size: 2.2rem;
    color: #4d5c72;
    letter-spacing: 0.02em;
    font-weight: 650;
}

.home-header .brand-text p {
    font-size: 1rem;
    color: #6e7d93;
}

.home-header::after {
    content: none;
}

.home-subtitle {
    margin-top: 10px;
    font-size: 0.9rem;
    opacity: 1;
    color: #7a879c;
}

.home-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 主页页脚：宽屏时 margin-top:auto 贴视口底；窄屏由下方媒体查询改为自然流 */
.home-layout .footer {
    margin-top: auto;
    padding-top: 1rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.home-layout .footer p {
    margin: 0.3em 0;
}

.home-main-title {
    color: var(--color-text-muted, #5b6e8c);
    font-size: 1rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.home-card {
    padding: 18px;
    height: 100%;
}

.home-card-title {
    font-size: 1.05rem;
    color: var(--color-text, #2c3e4f);
    margin-bottom: 8px;
}

.home-card-sub {
    font-size: 0.86rem;
    color: var(--color-text-muted, #5b6e8c);
    margin-bottom: 14px;
}

.home-card-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-card-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: #2c5a8c;
    font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(110, 130, 200, 0.28);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.home-card-links a:hover {
    background: var(--primary-gradient-nav-hover, linear-gradient(135deg, rgba(107, 158, 255, 0.22) 0%, rgba(124, 110, 255, 0.18) 100%));
    border-color: rgba(124, 110, 255, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(107, 158, 255, 0.18);
}

.home-card-links .label {
    font-weight: 600;
}

.home-card-links .desc {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 6px;
}

.home-card-links .arrow {
    font-size: 1rem;
    opacity: 0.85;
}

.home-intro-text {
    font-size: 0.9rem;
    color: var(--color-text-muted, #5b6e8c);
    line-height: 1.75;
}

/* 手机/窄屏：取消整页 min-height 与 main 拉伸，页脚排在全部内容之后 */
@media (max-width: 48rem) {
    body.page-home {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }
    .home-layout {
        min-height: 0 !important;
        gap: 18px;
    }
    .home-main {
        flex: 0 1 auto;
    }
    .home-layout .footer {
        margin-top: 1.25rem;
    }
    .changelog-wrap {
        bottom: env(safe-area-inset-bottom, 0px);
    }
}

@media (min-width: 48.0625rem) {
    .home-layout {
        min-height: calc(100vh - var(--space-nav-height));
    }
}

@media (max-width: 900px) {
    .home-layout {
        gap: 18px;
    }
    .home-header .brand-logo {
        width: 84px;
        height: 84px;
    }
    .home-header .brand-text h1 {
        font-size: 1.95rem;
    }
    .home-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 主页 header 与更新公告（原内联样式） */
.header-wrap { position: relative; }
.top-right { position: absolute; top: 16px; right: 20px; display: flex; align-items: center; gap: 12px; z-index: 10; }
.top-right a, .top-right span { color: var(--color-link, #5b7cbd); text-decoration: none; font-size: 0.9rem; }
.top-right a {
    padding: 6px 14px; border-radius: 10px; border: 1px solid rgba(110, 130, 200, 0.35);
    background: rgba(255, 255, 255, 0.75); transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.top-right a:hover { color: #2c5a8c; background: rgba(124, 110, 255, 0.1); border-color: rgba(124, 110, 255, 0.45); }
.top-right .logout-btn {
    padding: 6px 14px; border-radius: 40px; border: 1px solid rgba(255, 138, 122, 0.45);
    background: rgba(255, 138, 122, 0.1); color: #c74a3a; cursor: pointer; font-size: 0.9rem;
    transition: background 0.2s;
}
.top-right .logout-btn:hover { background: rgba(255, 138, 122, 0.18); }
.top-right .account-name { padding: 0 4px; }
.global-top-right { 
    position: fixed; 
    top: 0; 
    right: 0; 
    z-index: 9998; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 12px 20px; 
    background: var(--color-bg-nav, rgba(255, 255, 255, 0.88)); 
    border-bottom-left-radius: 16px; 
    box-shadow: var(--shadow-nav, 0 2px 12px rgba(0, 0, 0, 0.04));
    backdrop-filter: blur(12px);
}
.global-top-right a { 
    color: var(--color-link, #5b7cbd); 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 500;
    padding: 8px 16px; 
    border-radius: 10px; 
    border: 1px solid rgba(110,130,200,0.35); 
    background: var(--primary-gradient-nav, linear-gradient(135deg, rgba(107, 158, 255, 0.12) 0%, rgba(124, 110, 255, 0.1) 100%));
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.global-top-right a:hover { 
    color: #2c5a8c; 
    background: var(--primary-gradient-nav-hover, linear-gradient(135deg, rgba(107, 158, 255, 0.22) 0%, rgba(124, 110, 255, 0.18) 100%)); 
    border-color: rgba(124,110,255,0.45); 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 158, 255, 0.15);
}
.global-top-right .gt-account { 
    color: var(--color-text, #2c3e4f); 
    padding: 0 8px; 
    font-weight: 500;
    font-size: 0.95rem;
}
.global-top-right .gt-logout { 
    padding: 8px 16px; 
    border-radius: 40px; 
    border: 1px solid rgba(255,138,122,0.45); 
    background: rgba(255,138,122,0.1);
    color: #c74a3a; 
    cursor: pointer; 
    font-size: 0.9rem; 
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.global-top-right .gt-logout:hover { 
    background: rgba(255,138,122,0.18);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,138,122,0.15);
    color: #c74a3a;
}
.changelog-wrap { position: fixed; right: 0; bottom: 0; z-index: 1000; font-size: 0.9rem; }
.changelog-panel {
    position: absolute; right: 0; bottom: 48px; width: 320px; max-width: calc(100vw - 24px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(110, 130, 200, 0.22); border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.08);
    overflow: hidden; transition: opacity 0.2s, transform 0.2s;
}
.changelog-panel[aria-hidden="true"] { opacity: 0; pointer-events: none; transform: translateY(8px); }
.changelog-head {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
    background: rgba(124, 110, 255, 0.08); border-bottom: 1px solid rgba(110, 130, 200, 0.18);
    color: var(--color-text, #2c3e4f); font-weight: 600;
}
.changelog-title { font-size: 0.95rem; }
.changelog-close {
    width: 28px; height: 28px; padding: 0; border: none; border-radius: 8px;
    background: rgba(255,255,255,0.08); color: #a0aed8; font-size: 1.2rem; line-height: 1;
    cursor: pointer; transition: background 0.2s, color 0.2s;
}
.changelog-close:hover { background: rgba(255,138,122,0.15); color: #c74a3a; }
.changelog-body {
    max-height: 280px; overflow-y: auto; padding: 12px 14px;
}
.changelog-body::-webkit-scrollbar { width: 6px; }
.changelog-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 3px; }
.changelog-body::-webkit-scrollbar-thumb { background: rgba(103,132,255,0.4); border-radius: 3px; }
.changelog-loading { color: var(--color-text-muted, #5b6e8c); margin: 0; font-size: 0.85rem; }
.changelog-item { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(110,130,200,0.12); }
.changelog-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.changelog-item-version { display: inline-block; padding: 2px 8px; border-radius: 6px; margin-bottom: 6px; font-weight: 600; font-size: 0.85rem; color: #1f8a5c; background: rgba(42, 157, 106, 0.12); }
.changelog-item-content { color: var(--color-text-muted, #5b6e8c); line-height: 1.5; font-size: 0.85rem; white-space: pre-wrap; word-break: break-word; }
.changelog-tab {
    display: block; width: 100%; padding: 10px 16px; border: none; border-radius: 10px 10px 0 0;
    background: var(--primary-gradient-nav, linear-gradient(135deg, rgba(107, 158, 255, 0.12) 0%, rgba(124, 110, 255, 0.1) 100%));
    color: #2c5a8c; font-size: 0.9rem; font-weight: 500; cursor: pointer;
    border: 1px solid rgba(110, 130, 200, 0.28); border-bottom: none;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06); transition: background 0.2s, color 0.2s;
}
.changelog-tab:hover { background: var(--primary-gradient-nav-hover, linear-gradient(135deg, rgba(107, 158, 255, 0.22) 0%, rgba(124, 110, 255, 0.18) 100%)); color: #2c3e4f; }

/* 公告弹窗 */
.announcement-modal-wrap {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
}
.announcement-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.22s ease;
}
.announcement-modal-wrap.announcement-modal-open .announcement-modal-mask {
    opacity: 1;
}
.announcement-modal-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(110, 130, 200, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.announcement-modal-wrap.announcement-modal-open .announcement-modal-dialog {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.announcement-modal-wrap.announcement-modal-important .announcement-modal-dialog {
    border-color: rgba(230, 170, 90, 0.45);
    background: rgba(255, 252, 246, 0.98);
}
.announcement-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(110, 130, 200, 0.18);
    background: rgba(124, 110, 255, 0.06);
    border-radius: 28px 28px 0 0;
}
.announcement-modal-wrap.announcement-modal-important .announcement-modal-head {
    background: rgba(255, 180, 80, 0.15);
    border-bottom-color: rgba(255, 180, 80, 0.3);
}
.announcement-modal-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text, #2c3e4f);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}
.announcement-modal-title-text {
    color: #43536b;
}
.announcement-modal-title-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.announcement-modal-time {
    font-size: 0.76rem;
    color: #7a879c;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(123, 142, 184, 0.12);
    border: 1px solid rgba(123, 142, 184, 0.2);
}
.announcement-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.announcement-tag-important {
    color: #b45b31;
    background: rgba(243, 178, 129, 0.18);
    border: 1px solid rgba(224, 153, 101, 0.35);
}
.announcement-tag-new {
    color: #436ec5;
    background: rgba(145, 176, 255, 0.2);
    border: 1px solid rgba(113, 150, 240, 0.35);
}
.announcement-modal-wrap.announcement-modal-important .announcement-modal-title {
    color: #8a5a18;
}
.announcement-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #a0aed8;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}
.announcement-modal-close:hover {
    background: rgba(255, 122, 138, 0.25);
    color: #ff9aaa;
}
.announcement-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-muted, #5b6e8c);
    flex: 1;
    min-height: 0;
}
.announcement-modal-wrap.announcement-modal-important .announcement-modal-body {
    color: #5c4a32;
}
.announcement-modal-body::-webkit-scrollbar {
    width: 6px;
}
.announcement-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}
.announcement-modal-body::-webkit-scrollbar-thumb {
    background: rgba(103, 132, 255, 0.4);
    border-radius: 3px;
}
.announcement-modal-footer {
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(110, 130, 200, 0.15);
    border-radius: 0 0 28px 28px;
}
.announcement-modal-btn-ok {
    display: block;
    width: 100%;
    padding: 10px 20px;
    border: 1px solid rgba(124, 110, 255, 0.45);
    border-radius: 40px;
    background: rgba(124, 110, 255, 0.12);
    color: #4b3bdb;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.announcement-modal-btn-ok:hover {
    background: rgba(124, 110, 255, 0.2);
    color: #3d2fc4;
}
.announcement-modal-wrap.announcement-modal-important .announcement-modal-footer {
    border-top-color: rgba(255, 180, 80, 0.25);
}
.announcement-modal-wrap.announcement-modal-important .announcement-modal-btn-ok {
    background: rgba(230, 170, 90, 0.18);
    border-color: rgba(200, 140, 60, 0.45);
    color: #8a5a18;
}
.announcement-modal-wrap.announcement-modal-important .announcement-modal-btn-ok:hover {
    background: rgba(230, 170, 90, 0.28);
    color: #6a4510;
}
