/* 数据下载页面样式 */
.download-container {
    display: flex;
    gap: 1rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.sidebar {
    width: 300px;
    background: #f8f9fa;
    padding: 1.5rem 1rem;
    border-right: 1px solid #e9ecef;
}

.sidebar h3 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
    font-size: 1.1rem;
}

.data-menu {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-size: 0.9rem;
}

.menu-item:hover,
.menu-item.active {
    background: #667eea;
    color: white;
    transform: translateX(5px);
}

.menu-item i {
    margin-right: 0.5rem;
    width: 20px;
    font-size: 1rem;
}

.content-area {
    flex: 1;
    padding: 1.5rem;
}

.content-section {
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.content-section h3 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
    font-size: 1.1rem;
}

.download-tutorial-link {
    margin-left: 0.75rem;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 999px;
    border: 1px solid #667eea;
    background: #f5f7ff;
    color: #667eea;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.download-tutorial-link i {
    font-size: 0.9rem;
}

.download-tutorial-link:hover {
    background: #667eea;
    color: #fff;
}

.submenu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.submenu-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.submenu-item:hover,
.submenu-item.active {
    border-color: #667eea;
    background: #f0f4ff;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.submenu-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.submenu-desc {
    font-size: 0.8rem;
    opacity: 0.8;
    line-height: 1.3;
}

.download-container-module {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.download-form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-field select,
.form-field input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-field select:focus,
.form-field input:focus {
    outline: none;
    border-color: #667eea;
}

#code-input-field {
    transition: all 0.3s ease;
}

#code-input-field.hidden {
    display: none;
}

.date-range-container {
    display: block;
}

.date-range-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.date-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-field label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.date-field input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.date-field input:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    min-width: 200px;
    border: none;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.download-btn.download-mode {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.points-display {
    padding: 0.8rem 1.2rem;
    background: #fff3e0;
    color: #ff9800;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid #ffb74d;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.points-display.show {
    opacity: 1;
    transform: translateX(0);
}

.download-notice-section {
    background: #fff8e1;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

.download-notice-section h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.notice-content {
    color: #666;
    line-height: 1.6;
}

.notice-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.notice-content li {
    margin-bottom: 0.5rem;
}

.notice-highlight {
    background: #ffebee;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #f44336;
    margin: 1rem 0;
    font-weight: 500;
    color: #d32f2f;
}

.code-content {
    background: white;
    color: #333;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid #e9ecef;
}

.code-content pre {
    margin: 0;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-content code {
    color: #333;
}

.csv-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.csv-table th,
.csv-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.csv-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.csv-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.csv-table tbody tr:hover {
    background-color: #e9ecef;
}

/* 下载确认模态框样式 */
#downloadConfirmModal {
    display: none;
}

.download-confirm-content {
    max-width: 600px;
    margin: 1rem auto;
}

.download-tutorial-content {
    max-width: 680px;
    margin: 1rem auto;
}

.download-tutorial-content .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-tutorial-content .modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.download-tutorial-content .modal-body {
    padding: 1.2rem 1.5rem 1.5rem;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.tutorial-step {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.tutorial-step + .tutorial-step {
    border-top: 1px dashed #e0e0e0;
    padding-top: 0.8rem;
}

.step-index {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.step-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

.download-confirm-content .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-confirm-content .modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.download-confirm-content .modal-header .close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.download-confirm-content .modal-header .close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.confirm-info {
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item i {
    color: #667eea;
    margin-right: 0.8rem;
    width: 20px;
    font-size: 1rem;
}

.info-label {
    font-weight: 600;
    color: #555;
    margin-right: 0.5rem;
    min-width: 80px;
}

.info-value {
    color: #333;
    font-weight: 500;
}

/* 时间范围“去修改”按钮和提示 */
.time-edit-btn {
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
    border: 1px solid #667eea;
    background: #fff;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-edit-btn:hover {
    background: #667eea;
    color: #fff;
}

.time-range-tip {
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    margin-left: 2.2rem; /* 对齐日历图标后面的文字区域 */
    font-size: 0.85rem;
    color: #777;
}

.points-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.cost-points {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.points-summary i {
    color: #ff9800;
    margin-right: 0.8rem;
    width: 20px;
    font-size: 1.1rem;
}

.points-summary span:not(.cost-details) {
    font-weight: 600;
    color: #555;
    margin-right: 0.5rem;
}

.points-value {
    color: #4caf50 !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
}

.cost-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cost-value {
    color: #f44336 !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    padding: 0.3rem 0.8rem;
    background: #ffebee;
    border-radius: 6px;
    border: 2px solid #f44336;
}

.cost-action {
    font-size: 0.9rem;
    color: #666;
}

.discount-info {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    padding: 0.8rem;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-radius: 8px;
    border: 2px solid #4caf50;
}

.discount-info i {
    color: #4caf50;
    margin-right: 0.8rem;
    width: 20px;
    font-size: 1.1rem;
}

.discount-info span:not(.discount-value) {
    font-weight: 600;
    color: #555;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}

.discount-value {
    color: #4caf50 !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    padding: 0.2rem 0.6rem;
    background: #4caf50;
    color: white !important;
    border-radius: 4px;
}


.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-cancel:hover {
    background: #eeeeee;
    border-color: #ccc;
}

.btn-confirm {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: 2px solid #4caf50;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .download-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 1rem;
    }

    .content-area {
        padding: 1rem;
    }

    .download-container-module {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .download-notice-section {
        padding: 1rem;
    }
    
    .button-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .download-btn {
        width: 100%;
        min-width: auto;
    }
    
    .points-display {
        align-self: flex-start;
    }
    
    .menu-item {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    .submenu-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .submenu-item {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
    
    .submenu-name {
        font-size: 0.9rem;
    }
    
    .submenu-desc {
        font-size: 0.75rem;
    }
    
    .download-confirm-content {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .info-label {
        min-width: auto;
        margin-bottom: 0.3rem;
    }
    
    .date-range-row {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .date-field {
        flex: none;
    }
    
    /* 移动端tooltip样式调整 */
    .help-tooltip {
        min-width: 250px;
        max-width: 90vw;
    }
    
    .tooltip-content {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

#intro-text {
    white-space: pre-line;
}

/* 帮助图标样式 */
.help-icon {
    display: inline-block;
    margin-left: 4px;
    cursor: help;
    color: #667eea;
    font-size: 0.9rem;
    vertical-align: middle;
    transition: color 0.3s ease;
    position: relative;
}

.help-icon:hover {
    color: #764ba2;
}

.help-icon i {
    display: inline-block;
}

/* Tooltip样式 */
.help-tooltip {
    display: none;
    position: fixed;
    z-index: 10000;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
}

.tooltip-content {
    padding: 12px 16px;
    color: #333;
    line-height: 1.6;
    font-size: 0.9rem;
}

.tooltip-content strong {
    color: #667eea;
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #667eea;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-arrow::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid white;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
}

/* 当tooltip在上方时，箭头在下方 */
.help-tooltip.tooltip-top .tooltip-arrow {
    border-top: 8px solid #667eea;
    border-bottom: none;
    top: auto;
    bottom: -10px;
}

.help-tooltip.tooltip-top .tooltip-arrow::after {
    border-top: 6px solid white;
    border-bottom: none;
    top: -2px;
}