/* 古朴风格CSS变量 */
:root {
    --primary: #8B1A1A;
    --primary-dark: #6d1515;
    --gold: #C9A84C;
    --gold-light: #e8d5a3;
    --text: #3d3d3d;
    --text-muted: #5a5a5a;
    --bg: #f5f0e6;
    --bg-alt: #ebe3d3;
    --border: #d4c9b5;
    --white: #fff;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: linear-gradient(to bottom, #f5f0e6 0%, #ede4d4 100%);
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #8B1A1A 0%, #6d1515 100%);
    color: white;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.nav-links {
    display: flex;
    gap: 5px;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu {
    position: relative;
}

.user-menu .username {
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background 0.3s;
}

.user-menu:hover .username,
.user-menu:focus-within .username {
    background: rgba(255,255,255,0.15);
}

.user-menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-radius: 4px;
    margin-top: 0;
    overflow: hidden;
    z-index: 250;
}

.user-menu:hover .dropdown,
.user-menu:focus-within .dropdown {
    display: block;
}

.user-menu .dropdown a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.user-menu .dropdown a:hover {
    background: #f5f5f5;
}

.btn-login,
.btn-register,
.btn-app {
    padding: 6px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-login {
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
}

.btn-login:hover {
    background: rgba(255,255,255,0.15);
}

.btn-register {
    background: #C9A84C;
    color: #2c1810;
}

.btn-register:hover {
    background: #d4b55d;
}

.btn-app {
    color: #fff;
    border: 1px solid #C9A84C;
    background: rgba(201, 168, 76, 0.18);
}

.btn-app:hover {
    background: #C9A84C;
    color: #2c1810;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #8B1A1A;
    padding: 10px;
    z-index: 99;
}

.mobile-menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu.active {
    display: block;
}

.app-update-banner {
    display: none;
    position: sticky;
    top: 60px;
    z-index: 98;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #fff7df 0%, #f4e1a7 100%);
    border-bottom: 1px solid #d8bd63;
    color: #3d2a1a;
    box-shadow: 0 3px 10px rgba(60, 39, 18, 0.12);
}

.app-update-banner.active {
    display: flex;
}

.app-update-banner .app-update-text {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 600;
}

.app-update-banner .app-update-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-update-banner .app-update-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 4px;
    background: #8B1A1A;
    color: #fff;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
}

.app-update-banner .app-update-close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 4px;
    background: rgba(139, 26, 26, 0.1);
    color: #6d1515;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

/* 消息提示 */
.flash-messages {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.alert-error {
    background: linear-gradient(135deg, #fdf2f2 0%, #fce4e4 100%);
    color: #8B1A1A;
    border: 1px solid #d4a5a5;
}

.alert-success {
    background: linear-gradient(135deg, #f2f9f2 0%, #e4f5e4 100%);
    color: #2d5a2d;
    border: 1px solid #a5c4a5;
}

.alert button {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: inherit;
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #3d2a1a 0%, #2c3e50 100%);
    color: #e8d5a3;
    padding: 30px;
    text-align: center;
    border-top: 3px solid #8B1A1A;
}

.footer-content p {
    margin: 5px 0;
    opacity: 0.9;
}

.footer-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    justify-content: center;
    margin: 12px 0 4px;
}

.footer-links a {
    color: #f1dfaa;
    font-size: 0.9rem;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff4cf;
    text-decoration: underline;
}

.footer-version-line {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 0.82rem;
    color: rgba(232, 213, 163, 0.82);
}

.footer-version-separator {
    opacity: 0.55;
}

/* 响应式 */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 8px;
        gap: 6px;
    }

    .nav-logo {
        width: 44px;
        height: 44px;
    }

    .nav-brand span {
        display: none;
    }

    .nav-brand,
    .mobile-menu-btn {
        flex-shrink: 0;
    }

    .nav-user {
        flex: 1;
        min-width: 0;
        justify-content: flex-end;
        gap: 4px;
    }

    .btn-login,
    .btn-register,
    .btn-app {
        padding: 4px 7px;
        font-size: 0.78rem;
        line-height: 1.2;
        border-radius: 4px;
    }

    .mobile-menu-btn {
        font-size: 1.1rem;
        padding: 4px;
    }

    .app-update-banner {
        justify-content: space-between;
        gap: 8px;
        padding: 8px 10px;
    }

    .app-update-banner .app-update-text {
        font-size: 0.82rem;
    }

    .app-update-banner .app-update-action {
        min-height: 30px;
        padding: 5px 9px;
        font-size: 0.78rem;
    }

    .app-update-banner .app-update-close {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 380px) {
    .btn-login,
    .btn-register,
    .btn-app {
        padding: 4px 6px;
        font-size: 0.74rem;
    }
}

@media (max-width: 340px) {
    .btn-login i,
    .btn-register i,
    .btn-app i {
        display: none;
    }
}
