/* ===================================================================
//
//  Style Sheet for TribitHub
//  Version: 1.3 (Automatic Dark Mode Update)
//  Author: Gemini
//
// =================================================================*/

/* -------------------------------------------------------------------
 * ## 1. CSS 变量 (亮色主题为默认)
 * ------------------------------------------------------------------- */

:root {
    /* 主题切换的过渡效果 */
    --theme-transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;

    /* == Light Theme (Default) == */
    /* 背景色 */
    --bg-body: #F7F9FA;
    --bg-container: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-boxed: #E9ECEF;

    /* 文本颜色 */
    --text-primary: #15181D;
    --text-secondary: #5A6475;
    --text-headings: #101217;

    /* 边框和分隔线 */
    --border-color: #E9ECEF;
    --border-color-strong: #DDE2E7;

    /* 主色调 */
    --color-primary: #0062E6;
    --color-primary-hover: #0050b8;
    
    /* 页头品牌文字颜色 */
    --header-brand-text: #242830;
    
    /* 状态颜色 (在两种模式下保持一致) */
    --color-success: #02CB6A;
    --color-error: #FF4F4F;
}

/* -------------------------------------------------------------------
 * ## 2. 自动暗色模式 (通过媒体查询)
 * ------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
    :root {
        /* == Dark Theme (Applied automatically) == */
        /* 背景色 */
        --bg-body: #15181D;
        --bg-container: #1D2026;
        --bg-input: #242830;
        --bg-boxed: #101217;

        /* 文本颜色 */
        --text-primary: #E7E9EA;
        --text-secondary: #8A94A7;
        --text-headings: #FFFFFF;

        /* 边框和分隔线 */
        --border-color: #242830;
        --border-color-strong: #38404b;

        /* 主色调 */
        --color-primary: #3d8bfd;
        --color-primary-hover: #579dff;
        
        /* 页头品牌文字颜色 */
        --header-brand-text: var(--text-headings);
    }
}


/* -------------------------------------------------------------------
 * ## 3. 基础和重置样式 (无需改动)
 * ------------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    font-size: 16px;
    transition: var(--theme-transition);
}

body.is-boxed {
    background-color: var(--bg-boxed);
}

.body-wrap {
    background-color: var(--bg-body);
    transition: var(--theme-transition);
    overflow-x: hidden; /* 防止横向滚动 */
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    color: var(--text-headings);
    font-weight: 600;
}
.h1, .h2, .h3, .h4 { font-weight: 600; }
.h1 { font-size: 48px; }
.h2 { font-size: 36px; }
.h3 { font-size: 24px; }
.h4 { font-size: 20px; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }

/* 列表重置 */
.list-reset {
    list-style: none;
    padding: 0;
    margin: 0;
}


/* -------------------------------------------------------------------
 * ## 4. 布局 (无需改动)
 * ------------------------------------------------------------------- */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section-inner {
    padding: 48px 0;
}

.section-header {
    margin-bottom: 48px;
}

.section-title {
    font-size: 32px;
}

.section-paragraph {
    font-size: 18px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


/* -------------------------------------------------------------------
 * ## 5. 组件 (按钮, 表单, 消息, 页头, 页脚) (无需改动)
 * ------------------------------------------------------------------- */

/* -- 按钮 -- */
.button {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--border-color-strong);
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.button:hover {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

.button.button-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.button.button-primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.button.button-block {
    display: block;
    width: 100%;
}

.button.button-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* -- 表单 -- */
.field {
    margin-bottom: 16px;
}

.label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.input, .textarea {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color-strong);
    border-radius: 4px;
    color: var(--text-primary);
    transition: var(--theme-transition), border-color 0.2s ease;
}

.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.3);
}

.textarea {
    resize: vertical;
    min-height: 120px;
}


/* -- 状态消息 -- */
.status-message {
    text-align: center;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    min-height: 21px; /* 避免布局跳动 */
    padding: 8px;
    border-radius: 4px;
}

.status-message.success-message {
    background-color: rgba(2, 203, 106, 0.1);
    color: var(--color-success);
}

.status-message.error-message {
    background-color: rgba(255, 79, 79, 0.1);
    color: var(--color-error);
}


/* -- 页头 -- */
.site-header {
    padding: 24px 0;
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand-text {
    font-weight: 600;
    font-size: 24px;
    color: var(--header-brand-text);
}

.header-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-links a {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
}

.header-links a:hover {
    color: var(--text-primary);
}

.header-toggle {
    display: none; /* 默认在桌面端隐藏 */
}


/* -- 页脚 -- */
.site-footer-minimal {
    padding: 40px 0;
    text-align: center;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 14px;
}


/* -------------------------------------------------------------------
 * ## 6. 特定页面与区域样式 (字体增大)
 * ------------------------------------------------------------------- */

/* -- 登录/注册/忘记密码页面 -- */
.login-page, body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-container, .register-container {
    max-width: 420px;
    width: 100%;
    padding: 40px;
    background-color: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--theme-transition);
}

.login-title {
    text-align: center;
    margin-bottom: 24px;
}

/* -- 法律文本页面 (隐私/条款) -- */
.legal-content h3 {
    margin-top: 2em;
    margin-bottom: 1em;
}

.legal-content ul {
    color: var(--text-secondary);
    padding-left: 20px;
}
.legal-content ul li {
    margin-bottom: 0.5em;
}

/* -- 首页 Hero 区域增强 -- */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
}

.hero .hero-inner {
    width: 100%;
}

.hero .hero-title {
    font-size: 56px;
}

/* -------------------------------------------------------------------
 * ## 7. 特殊组件 (无需改动)
 * ------------------------------------------------------------------- */

/* -- 英雄区域动画 (来自 index.html) -- */
.hero-figure-box {
    position: absolute;
    background-color: var(--border-color-strong);
    border-radius: 4px;
}

/* -- 特色功能区域 (来自 pricing.html) -- */
.features-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}
.feature-inner {
    padding: 24px;
    height: 100%;
}
.feature-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 64px;
    height: 64px;
    background-color: var(--bg-input);
    border-radius: 50%;
}

/* -- 用户信息按钮 (登录后显示) -- */
.user-profile-container {
    display: flex;
    align-items: center;
}

.user-profile-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color-strong);
    border-radius: 9999px;
    text-decoration: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.user-profile-button:hover {
    background-color: var(--border-color);
    border-color: var(--border-color-strong);
}

.user-profile-button .username {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
}

.user-profile-button .user-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--text-primary);
    transition: var(--theme-transition);
}

.user-profile-button .user-icon svg {
    fill: var(--bg-body);
    transition: var(--theme-transition);
}


/* -------------------------------------------------------------------
 * ## 8. 响应式设计 (Media Queries)
 * ------------------------------------------------------------------- */

@media (max-width: 768px) {

    /* -- 调整基础字体和标题大小 -- */
    .h1 { font-size: 38px; }
    .h2, .section-title { font-size: 28px; }
    .h3 { font-size: 22px; }
    .section-paragraph { font-size: 16px; }

    /* -- 首页主标题字体 -- */
    .hero .hero-title {
        font-size: 42px;
    }

    /* -- 调整布局间距 -- */
    .section { padding: 60px 0; }
    .container, .container-sm { padding: 0 16px; }

    /* -- 首页 Hero 区域在移动端的高度 -- */
    .hero {
        min-height: 70vh;
    }

    /* -- 移动端导航栏 -- */
    .header-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 24px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001; /* 确保在最上层 */
    }
    .header-toggle span {
        width: 100%;
        height: 2px;
        background: var(--text-primary);
        border-radius: 10px;
        transition: all 0.3s ease;
    }
    
    /* 汉堡菜单激活时的动画 */
    .header-toggle.is-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .header-toggle.is-active span:nth-child(2) {
        opacity: 0;
    }
    .header-toggle.is-active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* 展开的移动端菜单样式 */
    .header-links {
        display: none;
        flex-direction: column;
        align-items: flex-start; /* 左对齐 */
        gap: 30px; /* 增加间距 */
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 80px 40px 40px; /* 调整内边距 */
        background-color: var(--bg-body);
        z-index: 1000;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
    
    .header-links.is-active {
        display: flex; /* 点击后显示 */
    }

    .header-links a {
        font-size: 20px; /* 增大字体 */
    }

    /* -- 首页 Hero 部分 -- */
    .hero-inner {
        flex-direction: column;
        text-align: center;
    }
    .hero-copy {
        margin-bottom: 40px;
    }
    .hero-cta {
        justify-content: center; /* 让按钮居中 */
    }
    .hero-figure {
        display: none; /* 在移动端隐藏复杂的背景动画以提升性能和简洁性 */
    }

    /* -- 登录/注册表单 -- */
    .login-container, .register-container {
        padding: 32px 24px;
    }
}
/* ===================================================================
//
//  新增样式: 用户信息按钮
//
// =================================================================*/

.user-profile-button {
    display: flex;
    align-items: center;
    gap: 8px; /* 图标和文字的间距 */
    padding: 6px 12px 6px 6px; /* 调整内边距，让左侧更贴合图标 */
    background-color: var(--bg-input);
    border: 1px solid var(--border-color-strong);
    border-radius: 9999px; /* 创建胶囊形状 */
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.user-profile-button:hover {
    background-color: var(--border-color);
    border-color: var(--border-color-strong);
}

.user-profile-button .username {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
}

.user-profile-button .user-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%; /* 圆形 */
    background-color: var(--text-primary); /* 在暗色模式下是亮的，在亮色模式下是暗的 */
    transition: var(--theme-transition);
}

.user-profile-button .user-icon svg {
    /* 图标的颜色取自页面的背景色，形成一个漂亮的“镂空”效果 */
    fill: var(--bg-body);
    transition: var(--theme-transition);
}

/* ===================================================================
//
//  新增样式: 扩大 Hero 区域，填充垂直留白
//
// =================================================================*/

/* 1. 让 .hero 区域本身占据大部分屏幕高度 */
.hero {
    /* 设置最小高度为视口高度的 80%。
       这样在不同尺寸的屏幕上，它都会显得很宽敞。
       使用 min-height 而非 height 可以防止在小屏幕上内容溢出。*/
    min-height: 85vh;

    /* 2. 使用 Flexbox 将内部的所有内容垂直居中 */
    display: flex;
    align-items: center;
    justify-content: center;

    /* 3. 移除或覆盖原有的上下 padding，因为 Flexbox 会处理居中，
       不再需要固定的 80px 边距。*/
    padding-top: 0;
    padding-bottom: 0;
}

/* 确保 .hero-inner 在 Flex 布局中宽度正确 */
.hero .hero-inner {
    width: 100%;
}

/* 响应式调整：在移动端，减小 hero 区域的高度，避免内容过于拥挤 */
@media (max-width: 768px) {
    .hero {
        min-height: 70vh;
    }
}

/* ===================================================================
//
//  新增样式: 增大首页主标题字体
//
// =================================================================*/

/* 1. 桌面端视图下的新字体大小 */
.hero .hero-title {
    font-size: 56px; /* 您可以根据喜好调整这个值，例如 60px 或 64px */
}

/* 2. 移动端视图下的新字体大小 (保持协调) */
@media (max-width: 768px) {
    .hero .hero-title {
        font-size: 42px; /* 相应地增大移动端字体 */
    }
}


/* ===================================================================
//
//  新增样式: 统一并美化登录/注册/密码重置页面
//
// =================================================================*/

.login-page, body.login-page {
    /* 使用变量，确保背景色能自适应主题 */
    background-color: var(--bg-body); 
}

.login-container, .register-container {
    border-width: 1px;
    border-style: solid;
    /* 使用变量，确保边框颜色能自适应主题 */
    border-color: var(--border-color-strong);
}

.login-title, .register-title {
    /* 使用变量，确保标题颜色能自适应主题 */
    color: var(--text-secondary); 
    font-weight: 600;
}

/* 调整输入框与按钮之间的间距 */
.login-container .field:last-of-type,
.register-container .field:last-of-type {
    margin-bottom: 24px;
}

/* “忘记密码” 和 “立即注册” 链接的样式 */
.login-container p,
.register-container p {
    text-align: center;
    font-size: 14px;
    margin: 16px 0 0;
}

.login-container p a,
.register-container p a {
    font-weight: 600;
}

/* 特别为“忘记密码”链接调整位置 */
.login-container p.forgot-password-link {
    text-align: right;
    margin-top: -10px;
    margin-bottom: 20px;
}


/* ===================================================================
//
//  New Advanced Footer Styles
//
// =================================================================*/

.site-footer-advanced {
    background-color: var(--bg-container);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    font-size: 14px;
    color: var(--text-secondary);
}

.site-footer-advanced a {
    color: var(--text-secondary);
    text-decoration: none;
}

.site-footer-advanced a:hover {
    color: var(--color-primary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    text-align: center;
}

.footer-legal-links {
    margin-bottom: 10px;
}

.footer-legal-links a {
    margin: 0 10px;
}