* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
}

header {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

.panel {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
}

h2 {
    color: #3498db;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f3f8;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 i {
    font-size: 1.3rem;
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid #e1e5eb;
    border-radius: 10px;
    font-size: 1.1rem;
    resize: vertical;
    transition: all 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: -10px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.option-group:hover {
    background: #e9ecef;
}

input[type="checkbox"], input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

label {
    font-size: 1rem;
    color: #495057;
    cursor: pointer;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
}

button {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(52, 152, 219, 0.3);
}

.secondary-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.secondary-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.result-area {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
}

.result-box {
    flex: 1;
    min-height: 300px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.1rem;
    line-height: 1.8;
}

.output-format {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.format-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.example-section {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.example-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.example-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.example-card:hover {
    transform: translateY(-5px);
    border-color: #3498db;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.example-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.example-name {
    font-weight: bold;
    font-size: 1.2rem;
    color: #2c3e50;
}

.example-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.example-content {
    color: #5a6268;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.result-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.result-item:hover {
    background: #f1f8ff;
}

.original-name {
    font-weight: bold;
    color: #2c3e50;
}

.pinyin-result {
    color: #e74c3c;
    margin-left: 10px;
}

footer {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
    border-top: 1px solid #dee2e6;
}

.feature-highlight {
    display: inline-block;
    background: linear-gradient(90deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: bold;
    margin: 0 5px;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

.copy-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    display: none;
    z-index: 1000;
}

.error-message {
    color: #e74c3c;
    background: #fdf2f2;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #fadbd8;
    margin-top: 10px;
    display: none;
}

/* 新增：姓和名空格样式说明 */
.space-demo {
    background: #e8f4fd;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #3498db;
}

.space-demo-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.space-demo-examples {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.space-demo-item {
    padding: 8px;
    background: white;
    border-radius: 5px;
    font-size: 0.9rem;
}

.space-demo-item .chinese {
    font-weight: bold;
}

.space-demo-item .pinyin {
    color: #e74c3c;
}

/* 滚动条样式 */
.result-box::-webkit-scrollbar {
    width: 8px;
}

.result-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.result-box::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.result-box::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}