/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* 按钮样式 */
.btn {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

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

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.btn-info {
    background-color: #6366f1;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background-color: #4f46e5;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

th {
    background-color: #f1f5f9;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
}

td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    vertical-align: top;
}

tr:nth-child(even) {
    background-color: #f8fafc;
}

tr:hover {
    background-color: #f1f5f9;
}

/* 日志区域样式 */
#log-text {
    resize: none;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.4;
}

/* 进度条样式 */
#progress-bar {
    transition: width 0.3s ease-in-out;
}

/* 状态文本样式 */
.status-success {
    color: #10b981 !important;
}

.status-error {
    color: #ef4444 !important;
}

.status-warning {
    color: #f59e0b !important;
}

.status-info {
    color: #3b82f6 !important;
}

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

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    .flex-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .ml-auto {
        margin-left: 0 !important;
        margin-top: 1rem;
        text-align: center;
    }

    /* 表格响应式 */
    .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 1000px;
    }

    /* 日志区域 */
    #log-text {
        height: 200px;
    }
}

/* 加载动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* 统计项样式 */
.stat-item {
    display: flex;
    align-items: center;
}

/* 按钮禁用样式 */
button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 清空日志按钮 */
#clear-log {
    cursor: pointer;
    transition: all 0.2s ease;
}

#clear-log:hover {
    background-color: #e2e8f0;
}

/* 表格单元格内容过长时的处理 */
td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* 标题图标样式 */
h2 i {
    margin-right: 8px;
}

/* 主内容区卡片样式 */
main {
    transition: all 0.3s ease;
}

/* 控制按钮组样式 */
.flex-wrap {
    gap: 10px;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }

    .flex-wrap {
        flex-direction: column;
        gap: 8px;
    }

    .ml-auto {
        margin-left: 0 !important;
        margin-top: 8px;
    }
}

/* 状态文本样式 */
#status-text {
    font-weight: bold;
    transition: color 0.3s ease;
}

/* 进度信息样式 */
#progress-info {
    font-size: 14px;
    color: #4b5563;
}

/* 统计数字样式 */
#total-orders, #success-orders, #failed-orders {
    font-size: 1.1rem;
}

/* 页脚样式 */
footer {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
}

/* 卡片阴影效果 */
section {
    transition: box-shadow 0.3s ease;
}

section:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 按钮文本溢出处理 */
.btn {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 字体大小调整 */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .btn {
        font-size: 13px;
    }

    #log-text {
        font-size: 12px;
    }
}