:root {
    --primary: #667eea;
    --primary-end: #764ba2;
    --success: #28a745;
    --danger: #dc3545;
    --bg-light: #f8f9fa;
    --border: #e1e8ed;
    --text: #333;
    --text-secondary: #666;
    --radius: 10px;
    --shadow: 0 20px 40px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-end) 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-end) 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}
.header h1 { font-size: 2.5em; margin-bottom: 10px; }
.header p { font-size: 1.1em; opacity: 0.9; }

.content {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.step {
    margin-bottom: 0;
    padding: 25px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
}
.step > textarea {
    flex: 1;
}
.step h3 {
    color: var(--text);
    margin-bottom: 15px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
}
.step-number {
    background: var(--primary);
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-right: 10px;
    font-weight: bold;
}

.example {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-line;
}

.score-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
}
.score-group {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ddd;
    display: flex;
    flex-direction: column;
}
.score-group textarea {
    flex: 1;
}
.score-group h4 {
    margin-bottom: 10px;
    text-align: center;
    background: var(--primary);
    color: #fff;
    padding: 8px;
    border-radius: 5px;
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s;
}
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.result-textarea {
    background: var(--bg-light);
    cursor: default;
}

.button-container { text-align: center; margin: 30px 0; grid-column: 1 / -1; }
.process-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-end) 100%);
    color: #fff;
    padding: 15px 40px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}
.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102,126,234,0.3);
}

.copy-btn {
    background: var(--success);
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    margin-left: 10px;
    white-space: nowrap;
}
.copy-btn:hover { background: #218838; }

/* 结果区域 */
.result { background: #d4edda; border: 2px solid #c3e6cb; border-radius: var(--radius); padding: 20px; margin-top: 20px; }
.result h3 { color: #155724; margin-bottom: 15px; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.stat-item {
    text-align: center;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid #ddd;
}
.stat-number { font-size: 1.5em; font-weight: bold; color: var(--primary); }
.stat-label { font-size: 0.9em; color: var(--text-secondary); margin-top: 5px; }

.result-group {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ddd;
}
.result-group h4 {
    margin-bottom: 10px;
    text-align: center;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 1.1em;
}
.result-group.check-version h4 { background: #17a2b8; color: #fff; }
.result-group.copy-version h4 {
    background: var(--danger);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.result-subtitle {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 10px;
    font-style: italic;
}

.unmatched-warning {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: bold;
}
.error {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}
.red-text { color: var(--danger); font-weight: bold; }
.result-content {
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    white-space: pre-line;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
}
.usage-tip {
    margin-top: 20px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 5px;
    border-left: 4px solid #2196f3;
}

#result { grid-column: 1 / -1; }
#result:empty { display: none; }

@media (max-width: 768px) {
    .content { grid-template-columns: 1fr; }
    .header h1 { font-size: 2em; }
    .score-inputs { grid-template-columns: 1fr; }
    .result-group.copy-version h4 {
        flex-direction: column;
        gap: 10px;
    }
    .copy-btn { margin-left: 0; }
}
