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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-top: 70px; /* 为固定导航栏留出空间 */
}

/* 固定导航栏样式 */
.fixed-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.navbar-right {
    display: flex;
    align-items: center;
}

.navbar-link {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.navbar-link:hover {
    background: linear-gradient(135deg, #ff5252, #ff7043);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.5);
    border-bottom-color: rgba(255, 255, 255, 0.6);
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

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

/* 主要内容区域 */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 通用卡片样式 */
section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* 区域标题样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    margin-bottom: 0;
    flex: 1;
}

.tutorial-link {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    position: relative;
    overflow: hidden;
}

.tutorial-link::before {
    content: '📖';
    margin-right: 6px;
    font-size: 12px;
}

.tutorial-link:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.tutorial-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* 配置区域样式 */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

.config-item {
    display: flex;
    flex-direction: column;
}

/* 表单样式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-item.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

input, select, textarea {
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

textarea {
    resize: vertical;
    min-height: 80px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.btn-outline:hover {
    background: #e74c3c;
    color: white;
}

.btn.full-width {
    width: 100%;
    margin-top: 10px;
}

/* 结果展示区域 */
.result-container {
    min-height: 200px;
}

.result-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
    max-height: 500px;
    overflow-y: auto;
}

.result-content:empty {
    display: none;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

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

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

/* 历史记录样式 */
.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.history-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.history-item:hover {
    background: #e9ecef;
}

.history-item-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.history-item-preview {
    color: #6c757d;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-top: 5px;
}

/* 工具类 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .config-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 15px;
    }
}

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

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

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

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

/* 成功/错误提示样式 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Footer样式 */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    margin-top: 40px;
    padding: 40px 0 20px;
    border-radius: 12px 12px 0 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #ecf0f1;
    font-weight: 600;
}

.footer-section p {
    margin-bottom: 8px;
    color: #bdc3c7;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-section a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #5dade2;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: #95a5a6;
    font-size: 0.85rem;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .footer {
        padding: 30px 0 15px;
    }
}