* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* ==================== Header ====================  */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ==================== Banner ====================  */
.banner {
    position: relative;
    height: 250px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    color: white;
    padding: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.nav {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-item {
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 1rem;
    right: 1rem;
    height: 3px;
    background-color: white;
    border-radius: 2px;
}

.admin-button {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-button:hover {
    background-color: white;
    color: var(--primary);
}

/* ==================== Main Container ====================  */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ==================== 公告页面 ====================  */
.announcements-section {
    animation: fadeIn 0.5s ease;
}

.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.announcement-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.announcement-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.announcement-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--gray-200);
}

.announcement-content {
    padding: 1.5rem;
}

.announcement-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.announcement-text {
    color: var(--gray-600);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.announcement-date {
    font-size: 0.875rem;
    color: var(--gray-400);
}

/* ==================== 委托发布页面 ====================  */
.commission-form-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background-color: var(--gray-300);
    color: var(--gray-900);
}

.btn-secondary:hover {
    background-color: var(--gray-400);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--success);
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--danger);
}

/* ==================== 委托列表 ====================  */
.commissions-section {
    animation: fadeIn 0.5s ease;
}

.commission-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--gray-200);
}

.tab-button {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-500);
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-button:hover {
    color: var(--gray-700);
}

.commissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.commission-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.commission-card.accepted {
    border-left-color: var(--success);
}

.commission-card.completed {
    border-left-color: var(--gray-400);
    opacity: 0.8;
}

.commission-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.commission-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.commission-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.commission-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.commission-status.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.commission-status.accepted {
    background-color: #d1fae5;
    color: #065f46;
}

.commission-status.completed {
    background-color: #d1d5db;
    color: #374151;
}

.commission-description {
    color: var(--gray-600);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.commission-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.commission-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.commission-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.commission-actions .btn {
    flex: 1;
}

/* ==================== 管理员页面 ====================  */
.admin-section {
    animation: fadeIn 0.5s ease;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-600);
    font-weight: 600;
}

.admin-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
}

.admin-form {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.admin-form h4 {
    margin-bottom: 1.5rem;
    color: var(--gray-800);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-table thead {
    background-color: var(--primary);
    color: white;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.admin-table tbody tr:hover {
    background-color: var(--gray-50);
}

.admin-table td.actions {
    white-space: nowrap;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.5rem;
    margin-top: 1rem;
    border: 1px solid var(--gray-200);
}

.modal {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s ease;
    padding: 0.5rem;
}

.modal-close:hover {
    color: var(--gray-900);
    transform: scale(1.1);
}

/* ==================== Animations ====================  */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Responsive ====================  */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .announcements-grid,
    .commissions-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .commission-tabs {
        gap: 0.5rem;
    }

    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-table {
        font-size: 0.875rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .nav-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .modal-content {
        width: 95%;
    }

    .commission-actions {
        flex-direction: column;
    }
}
