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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --error: #ef4444;
    --info: #3b82f6;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}
.main-container { flex: 1; }

/* ====== 导航栏 ====== */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
}
.nav-container {
    max-width: 1100px; margin: 0 auto; padding: 0 24px;
    height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { font-size: 1.4rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-links a {
    text-decoration: none; color: var(--text); font-size: 0.95rem;
    font-weight: 500; padding: 6px 12px; border-radius: 8px; transition: all 0.2s;
}
.nav-links a:hover { background: var(--bg); color: var(--primary); }
.btn-primary { background: var(--primary) !important; color: white !important; padding: 8px 20px !important; }
.btn-primary:hover { background: var(--primary-dark) !important; }

/* 下拉菜单 */
.dropdown { position: relative; }
.dropdown-btn {
    background: none; border: none; font-size: 0.95rem; font-weight: 500;
    color: var(--text); cursor: pointer; padding: 8px 14px; border-radius: 8px;
    transition: all 0.2s; font-family: inherit; display: flex; align-items: center; gap: 6px;
}
.dropdown-btn:hover { background: var(--bg); color: var(--primary); }
.user-btn { padding: 6px 12px; }
.avatar { font-size: 1.2rem; }
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: var(--shadow-lg); min-width: 160px; z-index: 200; padding: 6px 0;
}
.dropdown-right { left: auto; right: 0; }
.dropdown-menu.show { display: block; }
.dropdown-menu a {
    display: block; padding: 8px 16px; font-size: 0.9rem; color: var(--text);
    text-decoration: none; border-radius: 0; white-space: nowrap;
}
.dropdown-menu a:hover { background: var(--bg); color: var(--primary); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* ====== Flash 消息 ====== */
.flash-messages { max-width: 1100px; margin: 16px auto 0; padding: 0 24px; }
.flash { padding: 12px 20px; border-radius: var(--radius); margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ====== 首页 Hero ====== */
.hero {
    max-width: 1100px; margin: 0 auto; padding: 80px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 48px;
    min-height: calc(100vh - 200px); position: relative; overflow: hidden;
}
.hero-content { max-width: 500px; }
.hero-title { font-size: 3rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero-title .highlight {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-subtitle { font-size: 1.2rem; color: var(--text-light); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; }
.btn-hero-primary, .btn-hero-secondary {
    padding: 14px 32px; border-radius: var(--radius); font-size: 1.05rem;
    font-weight: 600; text-decoration: none; transition: all 0.3s; display: inline-block;
}
.btn-hero-primary { background: var(--primary); color: white; box-shadow: 0 4px 14px rgba(99,102,241,0.4); }
.btn-hero-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-hero-secondary { background: var(--bg-card); color: var(--primary); border: 2px solid var(--border); }
.btn-hero-secondary:hover { border-color: var(--primary); transform: translateY(-2px); }

/* Hero 装饰 */
.hero-decoration { position: relative; width: 350px; height: 350px; flex-shrink: 0; }
.circle { position: absolute; border-radius: 50%; opacity: 0.15; }
.circle-1 { width: 300px; height: 300px; background: var(--primary); top: 0; right: 0; animation: float 6s ease-in-out infinite; }
.circle-2 { width: 200px; height: 200px; background: #a855f7; bottom: 0; left: 20px; animation: float 8s ease-in-out infinite reverse; }
.circle-3 { width: 100px; height: 100px; background: var(--primary-light); top: 80px; left: 60px; animation: float 7s ease-in-out infinite 1s; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-20px)} }

.features { max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.feature-card { background: var(--bg-card); padding: 32px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); transition: transform 0.3s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-light); font-size: 0.9rem; }

/* ====== 认证页面 ====== */
.auth-container { max-width: 440px; margin: 60px auto; padding: 0 24px; }
.auth-card { background: var(--bg-card); padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 1.6rem; text-align: center; margin-bottom: 4px; }
.auth-subtitle { text-align: center; color: var(--text-light); margin-bottom: 28px; font-size: 0.9rem; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px;
    font-size: 0.95rem; transition: border-color 0.2s; outline: none; font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-group small { color: var(--text-light); font-size: 0.8rem; margin-top: 4px; display: block; }
.btn-submit {
    width: 100%; padding: 12px; background: var(--primary); color: white; border: none;
    border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s; margin-top: 8px;
}
.btn-submit:hover { background: var(--primary-dark); }
.btn-cancel {
    display: inline-block; padding: 12px 32px; border: 2px solid var(--border);
    border-radius: 8px; font-size: 1rem; color: var(--text); text-decoration: none; margin-left: 12px;
}
.auth-links { text-align: center; margin-top: 20px; font-size: 0.9rem; }
.auth-links a { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-links a:hover { text-decoration: underline; }
.auth-links span { margin: 0 8px; color: var(--border); }

/* ====== Dashboard ====== */
.dashboard, .profile-page { max-width: 1100px; margin: 40px auto; padding: 0 24px; }
.dashboard-header, .profile-header { margin-bottom: 32px; }
.dashboard-header h1, .profile-header h1 { font-size: 2rem; margin-bottom: 4px; }
.dashboard-header p, .profile-header p { color: var(--text-light); }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 40px; }
.action-card {
    background: var(--bg-card); padding: 24px; border-radius: var(--radius);
    box-shadow: var(--shadow); text-decoration: none; color: var(--text);
    transition: transform 0.3s, box-shadow 0.3s; display: block;
}
.action-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.action-primary { border: 2px solid var(--primary); }
.action-icon { font-size: 2rem; margin-bottom: 8px; }
.action-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.action-card p { color: var(--text-light); font-size: 0.85rem; }

/* 简历卡片列表 */
.recent-resumes h2 { font-size: 1.3rem; margin-bottom: 16px; }
.resume-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; }
.resume-card {
    background: var(--bg-card); padding: 20px; border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--border);
}
.resume-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.resume-template-badge { background: #ede9fe; color: #7c3aed; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.resume-date { color: var(--text-light); font-size: 0.8rem; }
.resume-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.resume-meta { color: var(--text-light); font-size: 0.85rem; margin-bottom: 12px; }
.resume-card-actions { display: flex; gap: 8px; }
.btn-sm { padding: 6px 14px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; display: inline-block; }
.btn-outline { background: white; color: var(--primary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); }
.btn-danger { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }

/* 简历列表（个人中心） */
.resume-list { margin-top: 32px; }
.resume-list h2 { font-size: 1.3rem; margin-bottom: 16px; }
.resume-list-item { display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; border: 1px solid var(--border); }
.resume-list-info h3 { font-size: 1.05rem; margin-bottom: 4px; }
.resume-list-info p { color: var(--text-light); font-size: 0.85rem; }
.badge { background: #ede9fe; color: #7c3aed; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; margin-right: 8px; }
.resume-list-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-light); }

/* 统计 */
.profile-stats { display: flex; gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); padding: 20px 32px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; flex: 1; }
.stat-number { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-light); font-size: 0.85rem; margin-top: 4px; }

/* ====== 简历编辑器 ====== */
.resume-editor { max-width: 900px; margin: 40px auto; padding: 0 24px; }
.editor-header { margin-bottom: 32px; }
.editor-header h1 { font-size: 1.8rem; }
.form-section {
    background: var(--bg-card); padding: 28px; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 20px; border: 1px solid var(--border);
}
.form-section h2 { font-size: 1.15rem; margin-bottom: 20px; color: var(--primary); }
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.repeatable-item {
    position: relative; border: 1px solid var(--border); border-radius: 8px;
    padding: 16px; margin-bottom: 12px; background: #fafbfc;
}
.repeatable-item .btn-remove {
    position: absolute; top: 8px; right: 8px; background: #fef2f2; color: var(--error);
    border: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 0.8rem;
}
.btn-add {
    background: none; border: 2px dashed var(--border); color: var(--primary);
    padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 0.9rem;
    width: 100%; transition: all 0.2s; font-weight: 500;
}
.btn-add:hover { border-color: var(--primary); background: #eef2ff; }
.form-actions { display: flex; align-items: center; margin-top: 32px; }
.form-actions .btn-submit { width: auto; padding: 14px 48px; margin-top: 0; }
.form-actions .btn-cancel { padding: 14px 32px; }

/* ====== 页脚 ====== */
.footer { text-align: center; padding: 24px; color: var(--text-light); font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: auto; }

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .hero { flex-direction: column; text-align: center; padding: 40px 24px; }
    .hero-title { font-size: 2.2rem; }
    .hero-decoration { width: 200px; height: 200px; }
    .hero-actions { justify-content: center; }
    .features { grid-template-columns: 1fr; }
    .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
    .resume-list-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .resume-cards { grid-template-columns: 1fr; }
    .resume-preview, .modern-resume, .minimal-resume { margin: 10px; padding: 20px; }
    .modern-resume { flex-direction: column; }
    .modern-left, .modern-right { width: 100%; }
    .profile-stats { flex-direction: column; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .features { grid-template-columns: repeat(2, 1fr); }
}
