/*
Theme Name: TaskPlatform - 任务平台
Theme URI: https://example.com/taskplatform
Author: TaskPlatform Team
Author URI: https://example.com
Description: 一个功能完整的任务发布与接单平台 WordPress 主题，支持任务发布、浏览、接单、支付、评价等核心功能，可直接投入运营。
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: taskplatform
Tags: task, platform, freelance, jobs, marketplace
*/

/* ===== 基础重置与变量 ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

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

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

a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ===== 布局容器 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: var(--radius);
    font-size: 15px; font-weight: 500; cursor: pointer;
    border: none; transition: var(--transition); gap: 8px;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-outline {
    background: transparent; border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-weight: 500; font-size: 14px; color: var(--dark);
}
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px;
    border: 1px solid #d1d5db; border-radius: var(--radius);
    font-size: 15px; transition: var(--transition); background: var(--white);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--gray); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* ===== 卡片 ===== */
.card {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-light); }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--gray-light); }

/* ===== 导航 ===== */
.site-header {
    background: var(--white); box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.site-logo { font-size: 22px; font-weight: 700; color: var(--primary); }
.site-logo span { color: var(--secondary); }

.main-nav ul { display: flex; list-style: none; gap: 28px; }
.main-nav a {
    color: var(--dark); font-weight: 500; font-size: 15px;
    position: relative;
}
.main-nav a:hover { color: var(--primary); }
.main-nav .current-menu-item a { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.user-menu {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; position: relative;
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary-light); display: flex;
    align-items: center; justify-content: center;
    font-weight: 600; color: var(--primary); font-size: 14px;
}
.user-dropdown {
    position: absolute; top: 48px; right: 0;
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 180px;
    display: none; overflow: hidden;
}
.user-menu:hover .user-dropdown { display: block; }
.user-dropdown a {
    display: block; padding: 10px 16px;
    color: var(--dark); font-size: 14px;
}
.user-dropdown a:hover { background: var(--gray-light); color: var(--primary); }

.mobile-menu-toggle { display: none; font-size: 24px; cursor: pointer; }

/* ===== 页脚 ===== */
.site-footer {
    background: var(--dark); color: #9ca3af;
    padding: 48px 0 24px; margin-top: 60px;
}
.footer-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
}
.footer-brand .site-logo { color: var(--white); margin-bottom: 12px; display: inline-block; }
.footer-title { color: var(--white); font-size: 16px; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #9ca3af; font-size: 14px; }
.footer-links a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid #374151; margin-top: 32px;
    padding-top: 24px; text-align: center; font-size: 14px;
}

/* ===== 首页英雄区 ===== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: var(--white); padding: 80px 0; text-align: center;
}
.hero-title { font-size: 42px; font-weight: 700; margin-bottom: 16px; }
.hero-desc { font-size: 18px; opacity: 0.9; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-search {
    max-width: 700px; margin: 0 auto;
    display: flex; gap: 12px; background: var(--white);
    padding: 8px; border-radius: var(--radius-lg);
}
.hero-search input {
    flex: 1; border: none; padding: 12px 16px;
    font-size: 16px; outline: none;
}
.hero-stats {
    display: flex; justify-content: center; gap: 48px;
    margin-top: 48px;
}
.hero-stat h3 { font-size: 32px; font-weight: 700; }
.hero-stat p { font-size: 14px; opacity: 0.8; }

/* ===== 分类板块 ===== */
.section { padding: 60px 0; }
.section-title {
    text-align: center; font-size: 28px; font-weight: 700;
    margin-bottom: 40px;
}
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.section-header h2 { font-size: 22px; }

.category-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px;
}
.category-card {
    background: var(--white); padding: 24px;
    border-radius: var(--radius); text-align: center;
    box-shadow: var(--shadow); transition: var(--transition);
    cursor: pointer;
}
.category-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
}
.category-icon {
    width: 56px; height: 56px; border-radius: var(--radius);
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin: 0 auto 12px;
}
.category-card h3 { font-size: 15px; font-weight: 600; }
.category-card p { font-size: 13px; color: var(--gray); margin-top: 4px; }

/* ===== 任务卡片 ===== */
.task-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.task-card {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
    transition: var(--transition);
}
.task-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.task-card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--gray-light);
    display: flex; justify-content: space-between; align-items: center;
}
.task-status {
    padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.status-open { background: #d1fae5; color: #065f46; }
.status-progress { background: #dbeafe; color: #1e40af; }
.status-completed { background: #e5e7eb; color: #374151; }
.task-budget { font-size: 18px; font-weight: 700; color: var(--primary); }
.task-card-body { padding: 20px; }
.task-title {
    font-size: 17px; font-weight: 600; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.task-excerpt {
    font-size: 14px; color: var(--gray); margin-bottom: 16px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.task-meta {
    display: flex; gap: 16px; font-size: 13px; color: var(--gray);
}
.task-meta span { display: flex; align-items: center; gap: 4px; }
.task-card-footer {
    padding: 12px 20px; border-top: 1px solid var(--gray-light);
    display: flex; justify-content: space-between; align-items: center;
}
.task-poster {
    display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.poster-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-light); display: flex;
    align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: var(--primary);
}

/* ===== 任务详情页 ===== */
.task-single-layout {
    display: grid; grid-template-columns: 2fr 1fr; gap: 24px;
    padding: 40px 0;
}
.task-main .card-body { padding: 32px; }
.task-main h1 { font-size: 26px; margin-bottom: 16px; }
.task-description { font-size: 15px; line-height: 1.8; margin-bottom: 24px; }
.task-description h3 { font-size: 18px; margin: 20px 0 10px; }
.task-description ul { margin-left: 20px; margin-bottom: 16px; }
.task-info-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
    margin-top: 24px;
}
.task-info-item {
    background: var(--gray-light); padding: 16px; border-radius: var(--radius);
}
.task-info-item label { font-size: 12px; color: var(--gray); display: block; margin-bottom: 4px; }
.task-info-item span { font-size: 15px; font-weight: 600; }

.task-sidebar .card { margin-bottom: 20px; }
.task-sidebar .card-body { padding: 24px; }
.task-sidebar h3 { font-size: 16px; margin-bottom: 16px; }
.sidebar-price { font-size: 28px; font-weight: 700; color: var(--primary); text-align: center; }
.sidebar-price span { font-size: 14px; color: var(--gray); font-weight: 400; }
.sidebar-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ===== 发布任务 ===== */
.post-task-form { max-width: 800px; margin: 40px auto; }
.form-section {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 28px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.form-section h3 { font-size: 18px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--gray-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.price-input { position: relative; }
.price-input .currency { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray); }
.price-input input { padding-left: 32px; }

/* ===== 用户中心 ===== */
.dashboard-layout {
    display: grid; grid-template-columns: 260px 1fr; gap: 24px;
    padding: 32px 0;
}
.dashboard-sidebar .card { position: sticky; top: 80px; }
.dashboard-user {
    text-align: center; padding: 24px; border-bottom: 1px solid var(--gray-light);
}
.dashboard-user .user-avatar {
    width: 80px; height: 80px; font-size: 28px; margin: 0 auto 12px;
}
.dashboard-user h3 { font-size: 18px; }
.dashboard-user p { font-size: 13px; color: var(--gray); margin-top: 4px; }
.dashboard-nav { list-style: none; padding: 12px 0; }
.dashboard-nav li a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px; color: var(--dark); font-size: 14px;
    border-left: 3px solid transparent;
}
.dashboard-nav li a:hover, .dashboard-nav li.active a {
    background: var(--primary-light); color: var(--primary);
    border-left-color: var(--primary);
}

.dashboard-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white); padding: 20px; border-radius: var(--radius);
    box-shadow: var(--shadow); text-align: center;
}
.stat-card h4 { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card p { font-size: 13px; color: var(--gray); margin-top: 4px; }

.dashboard-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
.dashboard-table th {
    text-align: left; padding: 12px 16px;
    background: var(--gray-light); font-weight: 600;
}
.dashboard-table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-light); }
.dashboard-table tr:hover { background: #fafafa; }

/* ===== 消息系统 ===== */
.message-layout {
    display: grid; grid-template-columns: 300px 1fr;
    height: calc(100vh - 140px); background: var(--white);
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow); margin: 24px 0;
}
.message-sidebar { border-right: 1px solid var(--gray-light); overflow-y: auto; }
.message-search { padding: 12px; border-bottom: 1px solid var(--gray-light); }
.message-search input { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: var(--radius); font-size: 14px; }
.message-list { list-style: none; }
.message-list li {
    display: flex; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--gray-light); cursor: pointer;
}
.message-list li:hover, .message-list li.active { background: var(--gray-light); }
.message-list .msg-preview { flex: 1; min-width: 0; }
.message-list .msg-name { font-size: 14px; font-weight: 500; }
.message-list .msg-text { font-size: 13px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-list .msg-time { font-size: 11px; color: var(--gray); }

.message-content { display: flex; flex-direction: column; }
.message-header {
    padding: 16px 20px; border-bottom: 1px solid var(--gray-light);
    display: flex; justify-content: space-between; align-items: center;
}
.message-body { flex: 1; overflow-y: auto; padding: 20px; }
.message-bubble {
    max-width: 70%; padding: 12px 16px; border-radius: var(--radius-lg);
    margin-bottom: 12px; font-size: 14px; line-height: 1.5;
}
.message-bubble.sent { background: var(--primary); color: var(--white); margin-left: auto; border-bottom-right-radius: 4px; }
.message-bubble.received { background: var(--gray-light); border-bottom-left-radius: 4px; }
.message-input {
    padding: 16px 20px; border-top: 1px solid var(--gray-light);
    display: flex; gap: 12px;
}
.message-input input { flex: 1; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: var(--radius); font-size: 14px; }

/* ===== 评价 ===== */
.review-item {
    display: flex; gap: 16px; padding: 20px 0;
    border-bottom: 1px solid var(--gray-light);
}
.review-item:last-child { border-bottom: none; }
.review-content h4 { font-size: 15px; margin-bottom: 4px; }
.review-stars { color: var(--secondary); font-size: 14px; margin-bottom: 8px; }
.review-text { font-size: 14px; color: var(--gray); line-height: 1.6; }

/* ===== 分页 ===== */
.pagination {
    display: flex; justify-content: center; gap: 8px; margin-top: 32px;
}
.pagination a, .pagination span {
    padding: 8px 14px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
}
.pagination a { background: var(--white); color: var(--dark); box-shadow: var(--shadow); }
.pagination a:hover { background: var(--primary); color: var(--white); }
.pagination .current { background: var(--primary); color: var(--white); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .task-grid { grid-template-columns: repeat(2, 1fr); }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .task-single-layout { grid-template-columns: 1fr; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .dashboard-sidebar .card { position: static; }
    .message-layout { grid-template-columns: 1fr; height: auto; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hero-title { font-size: 28px; }
    .hero-stats { flex-direction: column; gap: 24px; }
    .hero-search { flex-direction: column; }
    .task-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .main-nav { display: none; }
    .mobile-menu-toggle { display: block; }
    .header-actions .btn { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .task-info-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* ===== 辅助类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }

/* ===== 通知/提示 ===== */
.alert {
    padding: 12px 16px; border-radius: var(--radius);
    font-size: 14px; margin-bottom: 16px;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ===== 加载动画 ===== */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 标签 ===== */
.tag {
    display: inline-block; padding: 4px 10px;
    background: var(--primary-light); color: var(--primary);
    border-radius: 20px; font-size: 12px; font-weight: 500;
    margin-right: 6px; margin-bottom: 6px;
}
.tag-outline {
    background: transparent; border: 1px solid var(--primary);
}

/* ===== 步骤条 ===== */
.steps { display: flex; justify-content: space-between; margin-bottom: 32px; }
.step { flex: 1; text-align: center; position: relative; }
.step::before {
    content: ''; position: absolute; top: 16px; left: 50%;
    width: 100%; height: 2px; background: var(--gray-light);
}
.step:last-child::before { display: none; }
.step-number {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--gray-light); color: var(--gray);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px; position: relative; z-index: 1;
}
.step.active .step-number { background: var(--primary); color: var(--white); }
.step.completed .step-number { background: var(--success); color: var(--white); }
.step-title { font-size: 13px; margin-top: 8px; color: var(--gray); }
.step.active .step-title { color: var(--primary); font-weight: 500; }

/* ===== 文件上传 ===== */
.file-upload {
    border: 2px dashed #d1d5db; border-radius: var(--radius);
    padding: 32px; text-align: center; cursor: pointer;
    transition: var(--transition);
}
.file-upload:hover { border-color: var(--primary); background: var(--primary-light); }
.file-upload i { font-size: 32px; color: var(--gray); margin-bottom: 8px; display: block; }
.file-upload p { font-size: 14px; color: var(--gray); }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--gray-light); display: flex;
    align-items: center; justify-content: center;
    font-size: 32px; margin: 0 auto 16px; color: var(--gray);
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--gray); margin-bottom: 20px; }
