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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

/* 头部导航 */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.page-description {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.tool-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
    color: white;
}

.tool-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 工具页面 */
.tool-container {
    max-width: 800px;
    margin: 0 auto;
}

.tool-box {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: var(--card-bg);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-block {
    width: 100%;
}

/* 结果显示 */
.result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px;
    border-radius: 12px;
    margin-top: 24px;
    display: none;
}

.result-box.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.9;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-detail {
    font-size: 14px;
    opacity: 0.8;
}

/* 内容区域 */
.content-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.section-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.section-content ul,
.section-content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.section-content li {
    margin-bottom: 8px;
}

/* FAQ */
.faq-item {
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 16px;
    background: var(--bg-color);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    background: var(--border-color);
}

.faq-answer {
    padding: 16px;
    display: none;
    border-top: 1px solid var(--border-color);
}

.faq-answer.show {
    display: block;
}

/* 相关工具 */
.related-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.related-tool-link {
    padding: 16px;
    background: var(--bg-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.related-tool-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 页脚 */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-info {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        gap: 0;
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu a {
        display: block;
        padding: 16px 20px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .page-title {
        font-size: 28px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .tool-box {
        padding: 20px;
    }

    .content-section {
        padding: 20px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 提示信息 */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
