/* 基础样式和变量 */
:root {
    --primary-color: #4a6fa5;
    --primary-dark: #3a5a8c;
    --secondary-color: #6d9dc5;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --text-light: #666;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* 导航栏样式 */
.navbar {
    background: var(--card-background);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}

.nav-brand h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0;
    line-height: 1.2;
}

.nav-brand span {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-left: 0;
    margin-top: 0.2rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: 1px solid transparent;
    display: block;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* 登录注册按钮样式 */
.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-login {
    background-color: var(--primary-color);
    color: white !important;
    border: 1px solid var(--primary-color);
}

.btn-login:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-register {
    background-color: var(--secondary-color);
    color: white !important;
    border: 1px solid var(--secondary-color);
}

.btn-register:hover {
    background-color: #5a8db5;
    border-color: #5a8db5;
}

/* 用户信息区域样式 */
.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
}

.nav-user span {
    text-align: center;
}

.logout-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--text-color);
}

.logout-btn:hover {
    background-color: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

/* 移动端菜单切换按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-toggle-active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle-active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle-active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 退出确认模态框样式 */
.logout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.logout-modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--box-shadow);
}

.logout-modal-content h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.logout-modal-content p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.logout-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 主内容区域 */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 1rem;
}

/* 页脚样式 */
.footer {
    background: var(--card-background);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-light);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* 卡片样式 */
.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.1);
}

/* 提示信息样式 */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 0.25rem;
}

/* ===== 反馈气泡样式 ===== */
.feedback-bubble {
    position: fixed;
    top: 75%;
    right: 30px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary-color), #5a8db5);
    color: white;
    border-radius: 25px;
    box-shadow:
        0 8px 30px rgba(74, 111, 165, 0.3),
        0 2px 10px rgba(74, 111, 165, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-bubble:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow:
        0 12px 40px rgba(74, 111, 165, 0.4),
        0 4px 15px rgba(74, 111, 165, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, var(--primary-dark), #4a7ca5);
}

.feedback-bubble:active {
    transform: translateY(-50%) scale(0.98);
}

.bubble-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    position: relative;
    z-index: 2;
}

.bubble-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.feedback-bubble:hover .bubble-icon {
    transform: scale(1.1) rotate(5deg);
}

.bubble-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.text-main {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.text-sub {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
}

.bubble-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    animation: bubble-pulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes bubble-pulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ===== 登录成功弹窗样式 ===== */
.login-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.login-success-modal .modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.modal-header h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-body {
    margin: 1.5rem 0;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-light);
}

.btn-confirm {
    background: #ccc;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

.btn-confirm.active {
    background: var(--primary-color);
    cursor: pointer;
}

.btn-confirm.active:hover {
    background: var(--primary-dark);
}

/* ===== 消息提示动画样式 ===== */
.message-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    z-index: 10000;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    max-width: 400px;
    text-align: center;
    transition: all 0.3s ease-in-out;
    pointer-events: none;
}

.message-animation.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.message-animation.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

/* 消息类型样式 */
.message-success {
    background: #4a6fa5;
    color: white;
    border: 1px solid #3a5a8c;
}

.message-error {
    background: #ef4444;
    color: white;
    border: 1px solid #dc2626;
}

.message-info {
    background: #3b82f6;
    color: white;
    border: 1px solid #2563eb;
}

.message-warning {
    background: #f59e0b;
    color: white;
    border: 1px solid #d97706;
}

/* ===== 加载动画样式 ===== */
.loading-spinner {
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a6fa5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.alert {
    padding: 1rem;
    margin: 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* 专业加载动画样式 */
.professional-loading {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(74, 111, 165, 0.15);
    border: 1px solid rgba(74, 111, 165, 0.1);
    min-width: 200px;
}

.mindful-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
}

.breathing-circle {
    width: 40px;
    height: 40px;
    border: 3px solid #e3f2fd;
    border-top: 3px solid #4a6fa5;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: mindful-rotate 2s linear infinite;
}

.pulse-ring {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(74, 111, 165, 0.2);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: mindful-pulse 2s ease-out infinite;
}

.loading-content {
    color: #374151;
}

.loading-message {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #4a6fa5;
}

.loading-subtitle {
    font-size: 0.9rem;
    margin: 0;
    color: #6b7280;
    font-style: italic;
}

@keyframes mindful-rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
        border-top-color: #4a6fa5;
    }
    50% {
        border-top-color: #6d9dc5;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
        border-top-color: #4a6fa5;
    }
}

@keyframes mindful-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
        border-color: rgba(74, 111, 165, 0.3);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.7;
        border-color: rgba(109, 157, 197, 0.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
        border-color: rgba(74, 111, 165, 0.1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        height: 60px;
        padding: 0 1rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--card-background);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        gap: 0.5rem;
    }

    .nav-menu-active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        padding: 1rem;
        text-align: center;
        border: 1px solid var(--border-color);
        margin-bottom: 0.5rem;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* 移动端用户信息区域样式 */
    .nav-user {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
        border-top: 1px solid var(--border-color);
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }

    .nav-user span {
        display: block;
        width: 100%;
        margin: 0 auto;
    }

    .logout-btn {
        width: 100%;
        padding: 1rem;
        margin-top: 0.5rem;
        display: block;
        text-align: center;
    }

    /* 确保导航链接之间有足够的间距 */
    .nav-link {
        margin-bottom: 0.5rem;
    }

    /* 为导航菜单项添加更明确的边界 */
    .nav-menu > * {
        width: 100%;
    }

    .main-content {
        padding: 1rem;
        min-height: calc(100vh - 120px);
    }

    .logout-modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }

    .logout-modal-actions {
        flex-direction: column;
    }

    .logout-modal-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* 移动端反馈气泡适配 */
    .feedback-bubble {
        top: 75%;
        right: 20px;
    }

    .bubble-content {
        padding: 0.9rem 1.2rem;
        gap: 0.6rem;
    }

    .bubble-icon {
        font-size: 1.2rem;
    }

    .text-main {
        font-size: 0.85rem;
    }

    .text-sub {
        font-size: 0.7rem;
    }

    .login-success-modal .modal-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-brand h1 {
        font-size: 1.5rem;
    }

    .nav-brand span {
        font-size: 0.8rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    /* 移动端小屏幕下的额外优化 */
    .nav-user span {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }

    .logout-btn {
        font-size: 0.85rem;
        padding: 0.8rem;
    }
}