/* ================= 基础变量与重置 ================= */
:root { 
    --primary: #0056b3; 
    --primary-hover: #004494;
    --primary-rgb: 0, 86, 179;
    --bg: #f4f5f6; 
    --text: #1a1a1a; 
    --text-light: #666;
    --border: #e8e8e8; 
    --header-h: 60px;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    background: var(--bg); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    color: var(--text); 
    line-height: 1.5; 
    -webkit-font-smoothing: antialiased;
}

/* ================= 头部导航栏 ================= */
.header { 
    background: #fff; 
    height: var(--header-h); 
    border-bottom: 1px solid var(--border); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.header-inner { 
    max-width: 1200px; 
    margin: 0 auto; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 20px; 
}

/* Logo 样式 */
.logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.logo-icon { width: 32px; height: 32px; margin-right: 12px; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.logo:hover .logo-icon { transform: scale(1.1) rotate(-8deg); }
.logo-text-group { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-size: 19px; font-weight: 800; color: #001a33; letter-spacing: -0.2px; }
.logo-brand { color: var(--primary); }
.logo-tag { font-size: 9px; color: #999; font-weight: 700; letter-spacing: 1px; margin-top: 1px; }

/* ================= 导航菜单核心布局 ================= */
.nav-container { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    flex-grow: 1; 
    margin-left: 30px; 
    height: 100%;
}

.nav-menu { display: flex; list-style: none; height: 100%; }
.nav-item { position: relative; height: 100%; }

.nav-link { 
    text-decoration: none; 
    color: var(--text); 
    font-weight: 500; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    padding: 0 15px; 
    font-size: 14px;
    transition: 0.2s; 
}

.nav-link:not(.no-arrow)::after {
    content: "";
    width: 0; height: 0;
    margin-left: 6px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #999;
    transition: 0.3s;
}

.nav-item:hover .nav-link { color: var(--primary); }
.nav-item:hover .nav-link::after { border-top-color: var(--primary); transform: rotate(180deg); }
.highlight { color: var(--primary) !important; font-weight: 700 !important; }

.dropdown {
    position: absolute;
    top: var(--header-h);
    left: 0;
    background: #fff;
    min-width: 180px;
    border: 1px solid var(--border);
    border-top: none;
    box-shadow: var(--shadow);
    border-radius: 0 0 6px 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 100;
}

.more-tools .dropdown { left: auto; right: 0; min-width: 200px; }
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-link {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    border-bottom: 1px solid #f8f9fa;
    transition: 0.2s;
}
.dropdown-link:last-child { border-bottom: none; }
.dropdown-link:hover { background: #f0f7ff; color: var(--primary); padding-left: 25px; }

.dropdown-group-title {
    padding: 8px 20px;
    font-size: 11px;
    color: #bbb;
    font-weight: bold;
    background: #fafafa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ================= 顶部右侧 & 按钮 ================= */
.header-right { display: flex; align-items: center; gap: 20px; }
.business-links { display: flex; gap: 15px; font-size: 13px; }
.business-links a { text-decoration: none; color: var(--text-light); white-space: nowrap; transition: 0.2s; }
.business-links a:hover { color: var(--primary); }

.auth-btns, .user-logged { display: flex; gap: 10px; align-items: center; }
.btn { 
    padding: 6px 16px; 
    border-radius: 6px; 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    text-decoration: none; 
    border: 1px solid transparent; 
    transition: 0.3s;
}
.btn-login { color: var(--text); border: 1px solid var(--border); }
.btn-login:hover { background: #f8f9fa; border-color: var(--primary); color: var(--primary); }
.btn-register { background: var(--primary); color: #fff; }
.btn-register:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2); }

.logout-link { font-size: 12px; color: #999; text-decoration: none; margin-left: 5px; }
.logout-link:hover { color: #d93025; }

/* ================= 登录注册表单专用样式 (新增) ================= */
.auth-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 60px 20px; 
    min-height: 70vh; 
}

.auth-card { 
    background: #fff; 
    padding: 35px; 
    border-radius: 12px; 
    box-shadow: var(--shadow); 
    width: 100%; 
    max-width: 400px; 
    border: 1px solid var(--border);
}

.auth-header { text-align: center; margin-bottom: 25px; }
.auth-header h2 { font-size: 24px; color: var(--primary); margin-bottom: 10px; }
.auth-header p { color: var(--text-light); font-size: 14px; }

.form-group { margin-bottom: 20px; }
.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 13px; 
    font-weight: 600; 
    color: var(--text); 
}

.form-input { 
    width: 100%; 
    padding: 12px 15px; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    outline: none; 
    transition: 0.3s; 
    font-size: 14px;
}

.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1); }

.vcode-group { display: flex; gap: 10px; }
.btn-vcode { 
    white-space: nowrap; 
    padding: 0 15px; 
    border: 1px solid var(--primary); 
    color: var(--primary); 
    background: transparent; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 13px;
}
.btn-vcode:disabled { border-color: #ccc; color: #ccc; }

.btn-auth { 
    width: 100%; 
    padding: 14px; 
    background: var(--primary); 
    color: #fff; 
    border: none; 
    border-radius: 6px; 
    font-weight: bold; 
    cursor: pointer; 
    font-size: 16px; 
    margin-top: 10px;
}
.btn-auth:hover { background: var(--primary-hover); }

.auth-footer { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-light); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: bold; }

/* ================= 手机端响应式修复 ================= */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 5px; z-index: 1001; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: 0.3s; }

@media (max-width: 992px) {
    .menu-toggle { display: block; }

    .nav-container {
        display: none !important;
        position: absolute;
        top: var(--header-h);
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
        padding: 0; 
        border-bottom: 1px solid var(--border);
        height: auto !important;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }
    .nav-container.active { display: flex !important; }

    .nav-menu { flex-direction: column; width: 100%; height: auto !important; }
    .nav-item { width: 100%; height: auto !important; border-bottom: 1px solid #f8f9fa; }
    .nav-link { width: 100%; height: 55px; padding: 0 20px; justify-content: space-between; }

    .dropdown {
        position: static;
        display: none;
        opacity: 1; visibility: visible; transform: none;
        box-shadow: none; background: #fafafa;
        width: 100%; border-radius: 0; border: none;
    }
    .nav-item.open .dropdown { display: block; }

    .header-right { 
        padding: 20px;
        width: 100%; 
        border-top: 1px solid #f0f0f0;
        margin-top: 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .business-links, .auth-btns, .user-logged {
        display: flex;
        flex-direction: row !important;
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }
    .business-links a, .auth-btns a, .user-logged a.btn {
        flex: 1;
        text-align: center;
        padding: 12px 5px;
        font-size: 13px;
    }
}

/* ================= 内容区 & 页脚 ================= */
.main-container { max-width: 1200px; margin: 30px auto; padding: 0 20px; min-height: 70vh; }
.footer { text-align: center; padding: 40px 20px; color: #888; border-top: 1px solid var(--border); background: #fff; font-size: 14px; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 15px; }
.footer-links a { color: #666; text-decoration: none; font-size: 13px; }