/* 全局样式 - 移动优先设计 */
:root {
    --bg-color: #f8f9fc;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --danger-color: #ef4444;
    --success-color: #10b981;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.4);
    backdrop-filter: blur(10px);
    width: 100%;
}

.card h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.card .subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 28px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* 验证码输入组 */
.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group .form-control {
    flex: 1;
}

.input-group button {
    flex-shrink: 0;
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
    white-space: nowrap;
}

/* 按钮样式 */
.btn {
    height: 48px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    background: var(--primary-color);
    color: white;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

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

.btn-light {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-light:hover {
    background: #e2e8f0;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.radio-item {
    flex: 1;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-item label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.radio-item input[type="radio"]:checked + label {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 文件上传 */
.file-upload {
    border: 1.5px dashed var(--border-color);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafbfc;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: #f0f4fe;
}

.file-upload input {
    display: none;
}

.file-upload .upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

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

.file-upload .file-name {
    margin-top: 8px;
    font-size: 13px;
    color: var(--success-color);
    word-break: break-all;
}

/* 链接 */
.link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.link a:hover {
    text-decoration: underline;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success-color);
    color: white;
    border: none;
}

.toast.error {
    background: var(--danger-color);
    color: white;
    border: none;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 头像和提示 */
.avatar-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4361ee 0%, #10b981 100%); 
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: 600;
}

/* ========== 仪表盘通用组件 ========== */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid #edf2f7;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-title {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2d3fe7;
    font-size: 20px;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #0f1825;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 13px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.negative {
    color: #ef4444;
}

/* 图表容器 */
.chart-container {
    background: white;
    border-radius: 24px;
    padding: 20px;
    border: 1px solid #edf2f7;
    margin-bottom: 30px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 10px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #0f1825;
}

.chart-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

/* 导航菜单 */
.dashboard-nav {
    background: white;
    border-radius: 20px;
    padding: 12px;
    border: 1px solid #edf2f7;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-item {
    padding: 12px 20px;
    border-radius: 14px;
    color: #64748b;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover {
    background: #f8fafc;
    color: #2d3fe7;
}

.nav-item.active {
    background: #2d3fe7;
    color: white;
}

.nav-item i {
    font-size: 18px;
}

/* 内容卡片 */
.content-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #edf2f7;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #0f1825;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid #edf2f7;
}

.data-table td {
    padding: 16px 12px;
    font-size: 15px;
    color: #0f1825;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tr:hover td {
    background: #f8fafc;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
}

.badge.success {
    background: #d1fae5;
    color: #059669;
}

.badge.warning {
    background: #fed7aa;
    color: #b45309;
}

.badge.info {
    background: #dbeafe;
    color: #2563eb;
}

/* 按钮 */
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 12px;
    height: auto;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: #0f1825;
}

.btn-outline:hover {
    border-color: #2d3fe7;
    color: #2d3fe7;
    background: #f0f3ff;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}