/* 全局样式 */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: #f8fafc;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* 顶部导航 */
.header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.75rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    font-weight: 500;
    color: var(--dark);
    padding: 0.5rem 0;
    position: relative;
}

.nav a:hover, .nav a.active {
    color: var(--primary);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    background: var(--light);
    border-radius: 0.5rem;
    overflow: hidden;
}

.search-box input {
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    width: 200px;
    outline: none;
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.user-menu .btn-login, .user-menu .btn-register {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.btn-login {
    color: var(--dark);
}

.btn-register {
    background: var(--primary);
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    cursor: pointer;
}

.user-info .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info .dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    display: none;
}

.user-info:hover .dropdown {
    display: block;
}

.user-info .dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--dark);
    transition: background 0.2s;
}

.user-info .dropdown a:hover {
    background: var(--light);
}

/* 横幅 */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero h1 .highlight {
    color: #fbbf24;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-buttons .btn-outline {
    border-color: white;
    color: white;
}

.hero-buttons .btn-outline:hover {
    background: white;
    color: var(--primary);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    opacity: 0.8;
    font-size: 0.875rem;
}

/* 分类 */
.categories {
    padding: 4rem 0;
    background: white;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.category-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.3s;
}

.category-card:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px);
}

.category-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.category-card:hover i {
    color: white;
}

.category-card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.category-card p {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* 任务列表 */
.featured-tasks {
    padding: 4rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header .more {
    color: var(--primary);
    font-weight: 500;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1fr 200px 150px 120px;
    gap: 1.5rem;
    align-items: center;
    transition: all 0.2s;
}

.task-card:hover {
    box-shadow: var(--shadow-md);
}

.task-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.task-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--light);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--gray);
}

.tag-urgent {
    background: #fef2f2;
    color: var(--danger);
}

.task-budget {
    text-align: center;
}

.budget-amount {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--danger);
}

.budget-label {
    font-size: 0.75rem;
    color: var(--gray);
}

.task-meta {
    text-align: right;
    font-size: 0.875rem;
    color: var(--gray);
}

.task-meta div {
    margin-bottom: 0.25rem;
}

.task-action .btn {
    width: 100%;
}

/* 步骤 */
.how-it-works {
    padding: 4rem 0;
    background: white;
}

.steps {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
}

.step {
    text-align: center;
    max-width: 180px;
}

.step-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.875rem;
    color: var(--gray);
}

.step-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 1.5rem;
}

/* 技术员 */
.top-developers {
    padding: 4rem 0;
}

.developer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.developer-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.developer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.developer-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.developer-card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.developer-card .title {
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
}

.developer-card .skills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.developer-card .skill-tag {
    padding: 0.125rem 0.5rem;
    background: var(--light);
    border-radius: 9999px;
    font-size: 0.75rem;
}

.developer-card .stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.developer-card .stats span {
    color: var(--gray);
}

.developer-card .stats strong {
    color: var(--primary);
}

/* 页脚 */
.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section p {
    opacity: 0.7;
    font-size: 0.875rem;
}

.footer-section a {
    display: block;
    opacity: 0.7;
    font-size: 0.875rem;
    padding: 0.25rem 0;
    transition: opacity 0.2s;
}

.footer-section a:hover {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.875rem;
    opacity: 0.6;
}

/* 响应式 */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
    }
    
    .nav {
        display: none;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 2rem;
    }
    
    .category-grid,
    .developer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .task-card {
        grid-template-columns: 1fr;
    }
    
    .steps {
        flex-wrap: wrap;
    }
    
    .step-arrow {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* 登录/注册页面 */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group .hint {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

.form-actions {
    margin-top: 1.5rem;
}

.form-actions .btn {
    width: 100%;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray);
}

.form-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* 任务详情页 */
.page-header {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--gray);
}

.breadcrumb span {
    margin: 0 0.5rem;
}

.page-title {
    font-size: 1.75rem;
}

.task-detail {
    padding: 2rem 0;
}

.task-detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.task-main {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.task-main h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.task-desc {
    line-height: 1.8;
    white-space: pre-wrap;
}

.task-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.sidebar-card h4 {
    margin-bottom: 1rem;
}

.requester-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.requester-info .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.requester-info .name {
    font-weight: 600;
}

.requester-info .stats {
    font-size: 0.75rem;
    color: var(--gray);
}

.price-box {
    text-align: center;
    padding: 1rem;
    background: #fef2f2;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.price-box .amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--danger);
}

.price-box .label {
    color: var(--gray);
    font-size: 0.875rem;
}

/* 个人中心 */
.dashboard {
    padding: 2rem 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
}

.dashboard-sidebar {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
}

.dashboard-menu h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.dashboard-menu h4:first-child {
    margin-top: 0;
}

.dashboard-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--dark);
    transition: all 0.2s;
}

.dashboard-menu a:hover,
.dashboard-menu a.active {
    background: var(--light);
    color: var(--primary);
}

.dashboard-content {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--light);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-card .label {
    color: var(--gray);
    font-size: 0.875rem;
}

/* 响应式 */
@media (max-width: 1024px) {
    .task-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
}
