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

:root {
    --primary: #1a365d;
    --primary-dark: #0f1d33;
    --primary-light: #2c5282;
    --accent: #c9953a;
    --accent-light: #e8c46a;
    --accent-dark: #a67c2e;
    --bg-body: #f5f6fa;
    --bg-card: #ffffff;
    --bg-dark: #0f1419;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;
    --border-color: #e2e8f0;
    --border-light: #edf2f7;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.1);
    --shadow-hover: 0 12px 40px rgba(26,54,93,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== TOP BAR ====== */
.top-bar {
    background: var(--bg-dark);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

.top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.top-bar .logo {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar .logo span {
    color: var(--accent-light);
}

.top-bar nav {
    display: flex;
    gap: 4px;
}

.top-bar nav a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.top-bar nav a:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

.top-bar nav a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* ====== LANGUAGE TOGGLE ====== */
.lang-toggle {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    margin-left: 12px;
    min-width: 36px;
    text-align: center;
    line-height: 1.4;
}

.lang-toggle:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

/* ====== CONTAINER ====== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ====== HERO ====== */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(201,149,58,0.12) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    border-radius: 50%;
}

.hero h1 {
    font-size: 34px;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.hero p {
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    font-weight: 400;
    position: relative;
    z-index: 1;
    max-width: 600px;
    line-height: 1.6;
}

.hero .hero-accent {
    display: inline-block;
    margin-top: 16px;
    padding: 6px 16px;
    background: rgba(201,149,58,0.2);
    border: 1px solid rgba(201,149,58,0.3);
    border-radius: 20px;
    color: var(--accent-light);
    font-size: 13px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ====== SECTION HEADER ====== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-header .section-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
    margin-left: 20px;
}

.section-header .section-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-left: 16px;
    transition: color 0.2s;
}

.section-header .section-link:hover {
    color: var(--accent);
}

/* ====== CARD ====== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.card h2::before {
    content: '';
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 2px;
}

/* ====== TOOL GRID ====== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.tool-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(201,149,58,0.25);
}

.tool-card .tool-icon {
    font-size: 24px;
    margin-bottom: 12px;
    display: inline-block;
}

.tool-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.6;
}

.tool-card .tag {
    display: inline-block;
    background: rgba(26,54,93,0.06);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tool-card:hover .tag {
    background: rgba(201,149,58,0.12);
    color: var(--accent-dark);
}

/* ====== CATEGORY GRID ====== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(26,54,93,0.1);
    border-color: rgba(201,149,58,0.3);
}

.category-card .category-icon {
    font-size: 30px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-card span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ====== TAG LIST ====== */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    background: var(--bg-body);
    color: var(--text-secondary);
    padding: 7px 16px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
}

.tag-item:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,54,93,0.25);
    border-color: transparent;
}

/* ====== TOOL PAGE HEADER ====== */
.tool-header {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.tool-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ====== CATEGORY PAGE HEADER ====== */
.category-header {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.category-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.category-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ====== FORMS ====== */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.25s ease;
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,54,93,0.08);
}

.form-group textarea {
    min-height: 180px;
    resize: vertical;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

/* ====== BUTTONS ====== */
.btn {
    padding: 12px 26px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 10px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(26,54,93,0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,54,93,0.3);
}

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

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

.btn-accent {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(201,149,58,0.25);
}

.btn-accent:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201,149,58,0.35);
}

/* ====== RESULT ====== */
.result {
    background: var(--bg-body);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
    word-break: break-all;
    border: 1px solid var(--border-color);
}

.result pre {
    white-space: pre-wrap;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
}

.result.success {
    border-left: 4px solid #059669;
    background: linear-gradient(90deg, rgba(5,150,105,0.04) 0%, var(--bg-body) 30%);
}

.result.error {
    border-left: 4px solid #dc2626;
    background: linear-gradient(90deg, rgba(220,38,38,0.04) 0%, var(--bg-body) 30%);
    color: #dc2626;
}

/* ====== TABLE ====== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    background: var(--bg-body);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: rgba(26,54,93,0.02);
}

/* ====== FOOTER ====== */
.footer {
    background: var(--bg-dark);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-top: 32px;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

.footer p {
    line-height: 1.8;
}

/* ====== 404 PAGE ====== */
.error-page {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.error-page h1 {
    font-size: 80px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1;
}

.error-page p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .top-bar-inner {
        padding: 0 16px;
    }
    
    .top-bar nav {
        overflow-x: auto;
        gap: 0;
    }
    
    .top-bar nav a {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .container {
        padding: 20px 16px;
    }
    
    .hero {
        padding: 32px 24px;
    }
    
    .hero h1 {
        font-size: 26px;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        padding: 20px;
    }
    
    .section-header {
        flex-wrap: wrap;
    }
    
    .section-header .section-line {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 22px;
    }
    
    .tool-card {
        padding: 18px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .category-card {
        padding: 18px 12px;
    }
}