/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --secondary-color: #22d3ee;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --text-color: #e5e7eb;
    --text-light: #9ca3af;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

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

.logo i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

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

/* 主内容区 */
.site-main {
    flex: 1;
    padding: 2rem 0;
}

/* Hero 区域 */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius);
    color: white;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.domain-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.hero-url {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 分类标签 */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.category-tag:hover,
.category-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 工具卡片网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border-color);
}

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

.tool-card .icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
}

.tool-card .meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 章节标题 */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary-color);
}

/* 工具页面 */
.tool-page {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.tool-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.tool-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.tool-header p {
    color: var(--text-light);
}

.tool-content {
    min-height: 400px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--text-light);
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* 表单元素 */
input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--card-bg);
    color: var(--text-color);
}

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

input::placeholder, textarea::placeholder {
    color: var(--text-light);
}

/* 页脚 */
.site-footer {
    background: #020617;
    color: var(--text-color);
    padding: 3rem 0 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.footer-info p {
    color: var(--text-light);
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

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

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

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* 404 页面 */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-page h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.error-page p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        padding: 1rem;
        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: 0.75rem 0;
    }

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

    .hero h1 {
        font-size: 1.75rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

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

/* 工具相关特定样式 */
.typing-area {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    padding: 2rem;
    background: #1e293b;
    color: #94a3b8;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    min-height: 150px;
    line-height: 2;
}

.typing-area .correct {
    color: var(--success-color);
}

.typing-area .wrong {
    color: var(--danger-color);
    text-decoration: underline;
}

.typing-area .current {
    background: var(--primary-color);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
}

.stats-bar {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

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

.stat-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-item .label {
    font-size: 0.75rem;
    color: var(--text-light);
}
