/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 头部样式 */
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.2rem;
    opacity: 0.9;
}

/* 卡片容器 */
.api-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* API卡片样式 */
.api-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.api-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.api-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.api-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
}

.feature {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a4190);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* API信息区域 */
.api-info {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    margin-top: 50px;
}

.api-info h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.server-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.server-info p {
    margin-bottom: 10px;
}

.server-info code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #d63384;
}

/* 测试页面样式 */
.test-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.test-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    background: #f8f9ff;
    border-color: #5a6fd8;
}

/* 结果显示区域 */
.result-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 30px;
    margin-bottom: 40px;
}

.result-container h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.result-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    max-height: 400px;
    overflow-y: auto;
}

.error {
    border-left-color: #dc3545;
    background: #fff5f5;
    color: #721c24;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    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); }
}

/* 导航样式 */
.nav-back {
    margin-bottom: 30px;
}

.nav-back a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.nav-back a:hover {
    opacity: 0.8;
}

/* 页脚样式 */
footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 40px;
}

/* JSON快速填充区域样式 */
.json-quick-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.json-quick-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.quick-fill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.quick-fill-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.quick-fill-header h4 {
    color: white;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    flex: 1;
}

.quick-fill-badge {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(238, 90, 36, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 2px 8px rgba(238, 90, 36, 0.3); }
    to { box-shadow: 0 4px 16px rgba(238, 90, 36, 0.5); }
}

.json-quick-fill .form-group {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.json-quick-fill .form-group label {
    color: white;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.json-textarea {
    width: 100%;
    min-height: 140px;
    padding: 15px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    resize: vertical;
}

.json-textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,1);
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.json-textarea::placeholder {
    color: #999;
    font-size: 0.9rem;
}

.form-hint {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin-top: 8px;
    display: block;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.quick-fill-actions {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.btn-parse {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-parse:hover {
    background: linear-gradient(45deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-parse::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-parse:hover::before {
    left: 100%;
}

.btn-icon {
    margin-right: 6px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-parse:hover .btn-icon {
    transform: rotate(180deg);
}

.json-quick-fill .btn-secondary {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    backdrop-filter: blur(10px);
}

.json-quick-fill .btn-secondary:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .api-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .api-card {
        padding: 20px;
    }
    
    .test-container {
        padding: 25px;
    }
    
    .json-quick-fill {
        padding: 20px;
    }
    
    .quick-fill-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .quick-fill-header h4 {
        font-size: 1.1rem;
    }
    
    .quick-fill-actions {
        flex-direction: column;
    }
    
    .quick-fill-actions .btn {
        width: 100%;
        justify-content: center;
    }
}