/**
 * Dev Toolkit - 公共样式
 * 包含：CSS变量、基础样式、导航栏、按钮等
 */

/* ========== CSS 变量 ========== */
:root {
    --color-background: #fffffe;
    --color-headline: #272343;
    --color-paragraph: #2d334a;
    --color-button: #ffd803;
    --color-button-text: #272343;
    --color-secondary: #e3f6f5;
    --color-tertiary: #bae8e8;
    --color-shadow: rgba(39, 35, 67, 0.08);
    --color-success: #2ec4b6;
    --color-error: #ef476f;
    --color-warning: #ffd166;
}

/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--color-background);
    color: var(--color-paragraph);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 导航栏 ========== */
.navbar {
    background: var(--color-headline);
    padding: 15px 30px;
    box-shadow: 0 2px 10px var(--color-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: 700;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.9;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--color-button);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
}

.back-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== 语言切换器 ========== */
.lang-switcher {
    /* position: fixed; */
    /* top: 20px; */
    /* right: 20px; */
    display: flex;
    gap: 8px;
    /* background: white; */
    /* padding: 8px; */
    /* border-radius: 12px; */
    /* box-shadow: 0 4px 20px var(--color-shadow); */
    /* z-index: 101; */
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid var(--color-secondary);
    background: white;
    color: var(--color-paragraph);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s;
}

.lang-btn:hover {
    border-color: var(--color-button);
}

.lang-btn.active {
    background: var(--color-button);
    color: var(--color-button-text);
    border-color: var(--color-button);
}

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

/* ========== 页面头部 ========== */
.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-tertiary) 100%);
    border-radius: 20px;
    animation: fadeIn 0.5s ease-out;
}

.page-title {
    font-size: 2.5em;
    color: var(--color-headline);
    margin-bottom: 10px;
    font-weight: 800;
}

.page-subtitle {
    font-size: 1.1em;
    color: var(--color-paragraph);
    opacity: 0.8;
}

/* ========== 按钮组 ========== */
.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-button);
    color: var(--color-button-text);
    box-shadow: 0 4px 15px rgba(255, 216, 3, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 216, 3, 0.4);
}

.btn-success {
    background: var(--color-success);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 196, 182, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 196, 182, 0.4);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-headline);
    border: 2px solid var(--color-tertiary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-tertiary);
    transform: translateY(-2px);
}

.btn-error {
    background: var(--color-error);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 71, 111, 0.3);
}

.btn-error:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(239, 71, 111, 0.4);
}

/* ========== Toast 提示 ========== */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-headline);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(39, 35, 67, 0.3);
    font-weight: 600;
    z-index: 2000;
    transition: all 0.4s;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 90%;
}

.toast.show {
    bottom: 40px;
}

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

.toast.error {
    background: var(--color-error);
}

.toast.warning {
    background: var(--color-warning);
    color: var(--color-headline);
}

/* ========== 提示框 ========== */
.info-box {
    background: linear-gradient(135deg, #e3f6f5 0%, #bae8e8 100%);
    border-left: 4px solid var(--color-success);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.info-box h4 {
    color: var(--color-headline);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.info-box ul {
    margin-left: 20px;
    line-height: 1.8;
    color: var(--color-paragraph);
}

.info-box.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-left-color: var(--color-warning);
}

.info-box.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: var(--color-error);
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-paragraph);
    margin-top: 60px;
}

.footer a {
    color: var(--color-headline);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

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

/* ========== 动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .page-title {
        font-size: 2em;
    }

    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .lang-switcher {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========== 工具卡片（首页）========== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.tool-card {
    background: white;
    border: 2px solid var(--color-secondary);
    border-radius: 20px;
    padding: 35px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--color-button) 0%, var(--color-success) 100%);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px var(--color-shadow);
    border-color: var(--color-button);
}

.tool-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
    display: block;
}

.tool-title {
    color: var(--color-headline);
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 12px;
}

.tool-desc {
    color: var(--color-paragraph);
    font-size: 1.05em;
    line-height: 1.6;
    opacity: 0.8;
}

.tool-badge {
    display: inline-block;
    background: var(--color-button);
    color: var(--color-button-text);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    margin-top: 15px;
}

.tool-badge.new {
    background: var(--color-success);
    color: white;
}

.tool-badge.hot {
    background: var(--color-error);
    color: white;
}