/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.header h1 {
    text-align: center;
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 输入和结果面板的共同样式 */
.input-panel, .result-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 450px; /* 固定相同高度 */
    display: flex;
    flex-direction: column;
}

/* 标题样式统一 */
.input-panel h2, .result-panel h2 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
}

/* 输入区域样式 */
.input-container {
    flex: 1;
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background-color: #fff;
}

#inputArea {
    flex: 1;
    padding: 10px;
    border: none;
    font-size: 14px;
    line-height: 1.5;
    font-family: monospace;
    resize: none;
    overflow-y: scroll;
    white-space: pre;
    overflow-x: auto;
}

/* 结果列表样式 */
.result-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background-color: #ffffff;
    padding: 5px;
}

/* 行号容器样式 */
.line-numbers {
    width: 40px;
    color: #6b7280;
    text-align: right;
    padding: 10px 10px 10px 0;
    font-family: monospace;
    font-size: 14px;
    user-select: none;
    overflow-y: hidden;
    background-color: #f5f5f5;
}

.line-numbers div {
    height: 21px;
    line-height: 21px;
}

/* 行号样式统一 */
.line-numbers, .line-number {
    width: 40px;
    color: #6b7280;
    text-align: right;
    padding-right: 10px;
    font-family: monospace;
    font-size: 14px;
    user-select: none;
}

/* 结果项样式 */
.result-item {
    display: flex;
    padding: 10px;
    margin: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* 有效结果的样式 */
.result-item.valid {
    background-color: #ecfdf5;
    border-left: 4px solid #059669;
}

.result-item.valid:hover {
    background-color: #d1fae5;
}

.result-item.valid .id-number {
    color: #065f46;
    font-weight: 500;
}

.result-item.valid .details {
    color: #047857;
}

/* 无效结果的样式 */
.result-item.invalid {
    background-color: #fef2f2;
    border-left: 4px solid #dc2626;
}

.result-item.invalid:hover {
    background-color: #fee2e2;
}

.result-item.invalid .id-number {
    color: #991b1b;
    font-weight: 500;
}

.result-item.invalid .error {
    color: #dc2626;
    font-weight: 500;
    margin-top: 4px;
}

/* 结果内容样式 */
.result-content {
    flex: 1;
    margin-left: 10px;
}

/* 详细信息样式 */
.details {
    margin-top: 4px;
    font-size: 13px;
}

/* 按钮样式统一 */
.actions button, .actions select {
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 4px;
}

/* 按钮间距 */
.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
}

#clearBtn {
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

#clearBtn:hover {
    background-color: #dc2626;
}

#downloadBtn {
    background-color: #2563eb;
    color: white;
    border: none;
}

#downloadBtn:hover:not(:disabled) {
    background-color: #1d4ed8;
}

select {
    border: 1px solid #d1d5db;
    background-color: white;
    min-width: 120px;
}

/* 使用说明区域 */
.instructions {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.instructions h2 {
    font-size: 1.25rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.instruction-grid h3 {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.instruction-grid ul {
    list-style: none;
    padding-left: 20px;
}

.instruction-grid li {
    margin-bottom: 8px;
    position: relative;
}

.instruction-grid li:before {
    content: "•";
    position: absolute;
    left: -15px;
    color: #4299e1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* 添加滚动条样式 */
.result-list::-webkit-scrollbar {
    width: 8px;
}

.result-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.result-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.result-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.age-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#ageFilterValue {
    width: 60px;
    padding: 4px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: center;
}

#ageFilterValue:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}
