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

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-color: #f5f7fa;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --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), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.3s ease;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 0;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    z-index: 100;
}

.nav-content {
    width: 100%;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-sizing: border-box;
}

.nav-brand h1 {
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    font-size: 14px;
}

.message-icon-container {
    position: relative;
    display: inline-block;
}

.message-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    text-decoration: none;
    color: white;
    position: relative;
}

.message-icon-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.message-icon {
    font-size: 20px;
}

.message-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.25);
}

.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.nav-item.dropdown:hover .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border-radius: var(--radius);
    margin: 4px;
}

.dropdown-menu a:hover {
    background: var(--bg-color);
}

/* 语言切换 */
.lang-selector {
    position: relative;
}

.lang-selector select {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.lang-selector select:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lang-selector select option {
    color: var(--text-color);
    background: white;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 20px;
}

/* ========================================
   主内容区
   ======================================== */
.main-content {
    width: 100%;
    margin: 24px 0;
    padding: 0 20px;
    flex: 1;
    box-sizing: border-box;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
    width: 100%;
    flex: 1;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

/* ========================================
   按钮
   ======================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

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

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

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

.btn-outline:hover:not(:disabled) {
    background: var(--bg-color);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ========================================
   卡片
   ======================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.card-body {
    margin-bottom: 16px;
}

.card-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.card-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

/* ========================================
   表单
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.form-group label .required {
    color: var(--danger-color);
    margin-left: 4px;
}

.form-group label .optional {
    color: var(--text-light);
    font-size: 12px;
    font-weight: 400;
    margin-left: 4px;
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
    background: white;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.textarea {
    min-height: 100px;
    resize: vertical;
}

.input:disabled,
.select:disabled,
.textarea:disabled {
    background: var(--bg-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-help {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ========================================
   任务配置表单
   ======================================== */
.task-config {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    width: 100%;
    box-sizing: border-box;
}

.config-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 地区选择器样式 */
.region-selector {
    width: 100%;
}

.region-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.region-hint {
    color: #6b7280;
    font-size: 12px;
}

.region-selector-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    margin-bottom: 12px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.region-selector-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.region-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.region-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.region-tab:hover {
    background: var(--bg-color);
}

.region-tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.region-tab-content {
    display: none;
    padding: 16px;
    overflow-y: auto;
    max-height: 350px;
    flex: 1;
}

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

.region-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.region-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}

.region-item:hover {
    background: var(--bg-color);
}

.region-item input[type="checkbox"] {
    cursor: pointer;
}

.region-item label {
    cursor: pointer;
    flex: 1;
    user-select: none;
}

.selected-regions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.region-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 16px;
    font-size: 12px;
}

.region-tag .remove {
    cursor: pointer;
    font-weight: bold;
    padding: 0 4px;
}

.region-tag .remove:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .region-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .region-controls {
        flex-wrap: wrap;
    }
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* 点击规则列表 */
.click-rules-list {
    margin-bottom: 16px;
}

.click-rule-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.click-rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.click-rule-title {
    font-weight: 500;
    color: var(--text-color);
}

.click-rule-remove {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.click-rule-remove:hover {
    background: #dc2626;
}

/* 时间分布曲线 */
.distribution-curve {
    margin-top: 16px;
}

.curve-preview {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
}

.hour-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.hour-slider label {
    min-width: 80px;
    font-size: 13px;
}

.hour-slider input[type="range"] {
    flex: 1;
}

.hour-slider input[type="number"] {
    width: 60px;
    padding: 4px 8px;
}

/* 时间分布新样式 */
.distribution-preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.distribution-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius);
    font-size: 14px;
}

.distribution-stats span {
    color: var(--text-color);
}

.distribution-stats strong {
    color: var(--primary-color);
    font-weight: 600;
}

.hour-distribution-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.hour-input-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hour-input-item label {
    min-width: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    flex-shrink: 0;
}

.hour-input-item input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

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

/* 平板设备 */
@media (max-width: 768px) {
    .hour-distribution-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        padding: 12px;
    }
    
    .hour-input-item {
        gap: 6px;
    }
    
    .hour-input-item label {
        min-width: 45px;
        font-size: 12px;
    }
    
    .hour-input-item input {
        padding: 5px 6px;
        font-size: 12px;
    }
    
    .distribution-preset-buttons {
        gap: 6px;
    }
    
    .distribution-preset-buttons .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .distribution-stats {
        flex-direction: column;
        gap: 8px;
        font-size: 13px;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    .hour-distribution-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 10px;
    }
    
    .hour-input-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .hour-input-item label {
        min-width: auto;
        width: 100%;
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .hour-input-item input {
        width: 100%;
        padding: 8px;
        font-size: 14px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .distribution-preset-buttons {
        gap: 4px;
    }
    
    .distribution-preset-buttons .btn {
        font-size: 11px;
        padding: 5px 8px;
        flex: 1 1 calc(50% - 2px);
        min-width: calc(50% - 2px);
    }
    
    .distribution-stats {
        flex-direction: column;
        gap: 6px;
        padding: 10px;
        font-size: 12px;
    }
    
    .distribution-stats span {
        display: block;
        width: 100%;
    }
}

/* 超小屏幕 */
@media (max-width: 360px) {
    .hour-distribution-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 8px;
    }
    
    .hour-input-item input {
        padding: 10px;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    .distribution-preset-buttons .btn {
        font-size: 10px;
        padding: 4px 6px;
    }
}

/* ========================================
   任务列表
   ======================================== */
.task-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.task-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    width: 100% !important;
}

.task-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    cursor: pointer;
}

.task-item:hover {
    background: var(--bg-color);
}

.task-item:last-child {
    border-bottom: none;
}

.task-info h4 {
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 16px;
}

.task-info p {
    color: var(--text-light);
    font-size: 13px;
    margin: 4px 0;
}

.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-running { background: #dbeafe; color: #1e40af; }
.status-paused { background: #e5e7eb; color: #374151; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* 任务状态徽章美化 */
.task-status-badge.status-pending { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); 
    color: #92400e; 
    box-shadow: 0 2px 4px rgba(146, 64, 14, 0.1);
}
.task-status-badge.status-running { 
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); 
    color: #1e40af; 
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.1);
}
.task-status-badge.status-paused { 
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%); 
    color: #374151; 
    box-shadow: 0 2px 4px rgba(55, 65, 81, 0.1);
}
.task-status-badge.status-completed { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); 
    color: #065f46; 
    box-shadow: 0 2px 4px rgba(6, 95, 70, 0.1);
}
.task-status-badge.status-cancelled { 
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); 
    color: #991b1b; 
    box-shadow: 0 2px 4px rgba(153, 27, 27, 0.1);
}

/* 任务卡片样式 */
.task-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.task-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    border-color: #d1d5db;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.task-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.task-id {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

.task-status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.task-body {
    margin-bottom: 8px;
    flex: 1;
}

.task-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f9fafb;
}

.task-info-row:last-of-type {
    border-bottom: none;
}

.task-info-row .info-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.task-info-row .info-value {
    color: #111827;
    font-weight: 600;
    font-size: 14px;
}

/* 任务元信息行（模板、设备、流量） */
.task-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-meta-item.template-name {
    flex: 1;
    min-width: 0;
}

.task-meta-item .meta-icon {
    font-size: 16px;
    line-height: 1;
}

.task-meta-item .meta-value {
    color: #111827;
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-meta-item .meta-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.task-meta-item .meta-badge.traffic-normal {
    background: #e0f2fe;
    color: #0369a1;
}

.task-meta-item .meta-badge.traffic-premium {
    background: #fef3c7;
    color: #92400e;
}

.task-meta-item .meta-badge.traffic-overseas {
    background: #dbeafe;
    color: #1e40af;
}


/* 任务时间信息（在footer中） */
.task-time-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.task-time-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-time-item .time-label {
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.task-time-item .time-value {
    color: #111827;
    font-weight: 600;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.task-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

.progress-bar {
    flex: 1;
    height: 24px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    color: #111827;
    pointer-events: none;
    z-index: 0;
}

.progress-text-overlay .progress-count {
    color: #111827;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.progress-text-overlay .progress-percent {
    color: #111827;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.progress-text {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    min-width: 30px;
    text-align: right;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}

.task-footer .task-time-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.task-footer .task-time-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.task-footer .task-time-item .time-label {
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
}

.task-footer .task-time-item .time-value {
    color: #111827;
    font-weight: 600;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.task-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #6b7280;
    flex-wrap: wrap;
}

.task-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.status-warning { background: #fef3c7; color: #92400e; }
.status-info { background: #dbeafe; color: #1e40af; }
.status-secondary { background: #e5e7eb; color: #374151; }
.status-success { background: #d1fae5; color: #065f46; }
.status-danger { background: #fee2e2; color: #991b1b; }
.status-failed { background: #fee2e2; color: #991b1b; }

/* ========================================
   账户信息
   ======================================== */
.account-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.info-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.info-card h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 500;
}

.info-card .balance {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
}

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

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

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-large .modal-content {
    max-width: 900px;
}

.modal-xlarge .modal-content {
    max-width: 1200px;
}

.close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

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

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

/* ========================================
   加载和空状态
   ======================================== */
.loading,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

.empty-state {
    font-size: 16px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .nav-content {
        flex-wrap: wrap;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        text-align: center;
    }

    .main-content {
        padding: 0 16px;
        margin: 16px auto;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .feature-cards {
        grid-template-columns: 1fr;
    }

    .task-filters {
        flex-direction: column;
    }

    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .task-actions-mobile {
        position: relative;
        z-index: 10;
    }
    
    .task-actions-dropdown {
        z-index: 1000 !important;
    }
    
    .task-actions-dropdown-item:hover {
        background: #f3f4f6 !important;
    }
    
    /* 确保进度条不会覆盖下拉菜单 */
    .task-progress {
        position: relative;
        z-index: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .account-info {
        grid-template-columns: 1fr;
    }

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

    .click-rule-item {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .nav-brand h1 {
        font-size: 16px;
    }

    .nav-item {
        padding: 6px 12px;
        font-size: 13px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .card {
        padding: 16px;
    }

    .task-config {
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .config-section {
        margin-bottom: 24px;
        padding-bottom: 16px;
    }
}

/* ========================================
   工具类
   ======================================== */
.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; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ========================================
   首页宣传页样式
   ======================================== */
.homepage {
    max-width: 100%;
    padding: 0;
    width: 100%;
    flex: 1;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 20px;
    opacity: 0.95;
}

.hero-desc {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 32px;
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.features-section,
.how-it-works-section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title-center {
    text-align: center;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 48px;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 15px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.step-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.step-card p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 15px;
}

/* ========================================
   会员中心左右布局
   ======================================== */
.member-center-main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    background: var(--bg-color);
    overflow: hidden;
}

.member-center-layout {
    display: flex;
    flex: 1;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* 左侧边栏 */
.sidebar {
    width: 260px;
    background: var(--card-bg);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.sidebar-nav {
    padding: 16px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.sidebar-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* 右侧内容区 */
.member-content {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--bg-color);
}

.member-content iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: var(--bg-color);
}

.member-page {
    display: none;
}

.member-page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 仪表盘统计卡片 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

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

.stat-icon {
    font-size: 48px;
    width: 60px;
    text-align: center;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .hero-desc {
        font-size: 16px;
    }

    .section-title-center {
        font-size: 28px;
    }

    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .member-center-layout {
        flex-direction: column;
    }

    .member-center-main {
        height: calc(100vh - 60px);
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        max-height: 200px;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 12px 0;
    }

    .sidebar-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 12px 16px;
    }

    .sidebar-item.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }

    .member-content {
        height: calc(100vh - 60px - 200px);
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   底部样式
   ======================================== */
.site-footer {
    background: #1f2937;
    color: #e5e7eb;
    flex-shrink: 0;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.footer-section h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-section p {
    color: #9ca3af;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 8px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding: 20px;
    text-align: center;
}

.footer-bottom p {
    color: #9ca3af;
    font-size: 14px;
    margin: 0;
}

/* 移动端底部样式 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 20px 20px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-bottom {
        padding: 16px;
    }
}