/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 主容器 */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 左侧导航栏 */
.sidebar {
    width: 280px;
    background-color: #2c3e50;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

/* 导航栏头部 */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #ff6b6b;
}

/* 导航菜单 */
.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-menu ul {
    list-style: none;
}

/* 导航项 */
.nav-item {
    margin-bottom: 5px;
}

.nav-item a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

/* 导航项激活状态 */
.nav-item.active a {
    background-color: #34495e;
    border-left-color: #ff6b6b;
    color: #fff;
}

/* 导航项悬停效果 */
.nav-item:hover a {
    background-color: #3a506b;
    color: #fff;
}

/* 右侧内容区 */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    overflow-y: auto;
    background-color: #f5f7fa;
}

/* 内容模块 */
.content-module {
    display: none;
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 激活的内容模块 */
.content-module.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模块标题 */
.content-module h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

/* 模块提示 */
.module-hint {
    background-color: #f0f8ff;
    color: #4169e1;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #4169e1;
}

/* 表单样式 */
.module-form {
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
}

/* 表单行 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 表单组 */
.form-group {
    flex: 1;
    min-width: 250px;
}

/* 全宽表单组 */
.form-group.full-width {
    flex: 100%;
}

/* 表单标签 */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

/* 带提示的标签 */
.remark-hint {
    color: #999;
    font-size: 12px;
    font-weight: normal;
    margin-left: 10px;
}

/* 输入框样式 */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

/* 输入框聚焦状态 */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* 带单位的输入框 */
.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    padding-right: 50px;
}

.unit {
    position: absolute;
    right: 16px;
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

/* 职业输入框容器 */
.occupation-input {
    position: relative;
}

/* 多行输入框 */
.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

/* 主要按钮 */
.btn-primary {
    background-color: #ff6b6b;
    color: #fff;
}

.btn-primary:hover {
    background-color: #ff5252;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 次要按钮 */
.btn-secondary {
    background-color: #f5f7fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* 表单操作区 */
.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* 对话窗口入口 */
.chat-window-entry {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.chat-window-entry h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.chat-window-entry p {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

/* 错误信息 */
.error-message {
    display: none;
    color: #ff4757;
    font-size: 12px;
    margin-top: 5px;
}

.error-message.show {
    display: block;
}

/* 加载状态 */
.btn.loading {
    position: relative;
    padding-right: 40px;
    background-color: #ff8a80;
    cursor: wait;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    /* 缩小导航栏 */
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        padding: 20px;
    }
    
    .content-module {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    /* 移动端布局 */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    /* 表单行堆叠 */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        min-width: auto;
    }
    
    /* 调整按钮大小 */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* 调整标题大小 */
    .content-module h1 {
        font-size: 20px;
    }
}

/* 平板设备适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .form-row {
        gap: 15px;
    }
    
    .form-group {
        min-width: 200px;
    }
}

/* 打印样式 */
@media print {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .content-module {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    .btn {
        display: none;
    }
}

/* 滚动条样式 */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 禁用状态 */
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: #f5f7fa;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 焦点状态优化 */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

/* 输入框自动填充样式 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    border: 1px solid #ff6b6b;
    -webkit-text-fill-color: #333;
    -webkit-box-shadow: 0 0 0px 1000px #fff inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* 响应式字体大小 */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 1200px) {
    html {
        font-size: 16px;
    }
}