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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

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

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.nav-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

/* 标签页内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 区块样式 */
.section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

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

/* 表单样式 */
.form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.form-group small {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-draw {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.btn-draw:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-success:hover {
    background: #059669;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* 任务列表 */
.task-list,
.prize-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.task-card,
.prize-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    position: relative;
}

.task-card:hover,
.prize-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.task-card h3,
.prize-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.task-card p,
.prize-card p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.875rem;
}

.weight-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-pending {
    background: #dbeafe;
    color: #1e40af;
}

.status-in-progress {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-archived {
    background: #e5e7eb;
    color: #374151;
}

.task-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.timer-warning {
    color: var(--warning-color);
}

.timer-danger {
    color: var(--danger-color);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-color);
}

/* 抽取动画 */
.draw-animation {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.draw-item {
    padding: 15px 25px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.1s;
    cursor: pointer;
}

.draw-item.highlight {
    background: var(--warning-color);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.draw-result {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.draw-result h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* 抽奖动画 */
.lottery-animation {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.lottery-item {
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.1s;
    cursor: pointer;
    min-width: 150px;
    text-align: center;
}

.lottery-item.highlight {
    background: linear-gradient(135deg, var(--warning-color), var(--danger-color));
    transform: scale(1.15);
    box-shadow: var(--shadow-lg);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1.2);
    }
}

.lottery-result {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.lottery-result h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.lottery-result .prize-name {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.lottery-result .no-prize {
    font-size: 1.5rem;
    color: var(--text-light);
    font-style: italic;
}

/* 历史记录 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-info {
    flex: 1;
}

.history-item-info h4 {
    margin-bottom: 5px;
}

.history-item-info p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.history-item-prize {
    font-weight: bold;
    color: var(--success-color);
}

.history-item-no-prize {
    color: var(--text-light);
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .task-list,
    .prize-list {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .modal-content {
        padding: 20px;
    }
}

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

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* 钱包样式 */
.wallet-balance {
    margin: 20px 0;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    color: white;
}

.balance-label {
    font-size: 1.2rem;
    font-weight: 500;
}

.balance-amount {
    font-size: 2rem;
    font-weight: bold;
}

