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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* API配置区域 */
.api-config-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.api-config-section h2 {
    margin: 0 0 20px 0;
    font-size: 1.4em;
    font-weight: 600;
}

.config-toggle {
    margin-bottom: 20px;
}

.config-toggle label {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.config-toggle input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.api-config {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.config-item {
    margin-bottom: 15px;
}

.config-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.config-item input,
.config-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 14px;
    transition: all 0.3s ease;
}

.config-item input:focus,
.config-item select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    background: white;
}

.config-help {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.config-help p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.config-help ul {
    margin: 10px 0;
    padding-left: 20px;
}

.config-help li {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.config-help a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.config-help a:hover {
    text-decoration: underline;
}

.config-actions {
    margin-top: 15px;
    text-align: center;
}

.clear-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.2);
}

.clear-btn:hover {
    background: linear-gradient(135deg, #ff5252, #e53935);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.clear-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.2);
}

.config-help {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.input-section {
    margin-bottom: 30px;
    text-align: center;
}

.input-section label {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #555;
}

#chineseInput {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

#chineseInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#generateBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#generateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#generateBtn:active {
    transform: translateY(0);
}

.output-section {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.result-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.result-group h3 {
    color: #555;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.result-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item label {
    min-width: 200px;
    font-weight: 600;
    color: #555;
}

.result-value {
    flex: 1;
    padding: 10px 15px;
    background: #f1f3f4;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #2d3748;
    margin-right: 15px;
    word-break: break-all;
}

.copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.copy-btn:active {
    transform: scale(0.95);
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.8;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .result-item label {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .result-value {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .copy-btn {
        align-self: flex-end;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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