/* 基础重置与全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background: #f8f9fa;
    color: #2d3436;
    line-height: 1.3;
    padding: 2rem;
    min-height: 100vh;
}

/* 主容器 */
.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 1600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    padding: 1.5rem;
    min-height: 80vh;
}

/* 输入/输出区域公共样式 */
.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
}

/* 头部区域 */
.header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* 输入控件 */
input[type="date"],
input[type="text"] {
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    flex: 1;
    transition: border-color 0.3s ease;
}

input[type="date"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}

/* 文本区域 */
textarea {
    flex: 1;
    padding: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
    resize: none;
    transition: all 0.3s ease;
}

textarea:focus {
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}

/* 按钮控制区 */
.controls {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* 主按钮样式 */
button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #4dabf7 0%, #228be6 100%);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.1);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1);
}

button:disabled {
    background: #ced4da;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 输出结果区 */
.result-table {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 100px 90px 1fr 120px;
    padding: 0.8rem;
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

/* 结果行样式 */
.result-items {
    max-height: 60vh;
    overflow-y: auto;
}

.result-row {
    display: grid;
    grid-template-columns: 100px 90px 1fr 120px;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f1f3f5;
    margin-bottom: 0; /* 新增 */
    transition: background 0.2s ease;
}

.result-row:hover {
    background: #f8f9fa;
}

/* 状态标签 */
.status-invalid {
    color: #ff6b6b;
    font-weight: 500;
}

.status-duplicate {
    color: #ff922b;
    font-weight: 500;
}

/* 进度弹窗 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

/* 通过单独类名控制显示 */
.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.progress-bar {
    height: 16px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #69db7c 0%, #40c057 100%);
    transition: width 0.3s ease-out;
}

/* 统计摘要 */
.summary {
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: #495057;
}

.summary strong {
    color: #2d3436;
    margin-right: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 0.8fr;
        padding: 1rem;
    }
    
    .result-row,
    .table-header {
        grid-template-columns: 90px 80px 1fr 100px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .container {
        border-radius: 8px;
        padding: 1rem;
    }
    
    button {
        flex: 1 1 45%;
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .table-header,
    .result-row {
        grid-template-columns: 80px 70px 1fr 90px;
        font-size: 0.9rem;
    }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 0.8s linear infinite;
}
button:focus-visible {
    outline: 2px solid #4dabf7;
    outline-offset: 2px;
}