:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

html {
    overflow-y: scroll;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

/* 只隐藏 html 的滚动条 */
html::-webkit-scrollbar {
    display: none;
}

/* 页面布局 */
body {
    background-color: var(--gray-50);
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0.2rem 0.75rem 0.2rem 0.75rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 80vh;
}

/* 头部导航 */
.header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 56px;
    font-family: serif;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
}

.logo-icon {
    animation: wiggle 2s ease-in-out infinite;
    border-radius: 8px;
    width: 36px;
    height: 36px;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.logo:hover .logo-icon {
    animation: wiggle 0.5s ease-in-out infinite;
}

/* 汉堡菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    position: relative;
    z-index: 1002;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mobile-menu-btn span {
    display: block;
    height: 2px;
    width: 20px;
    background-color: var(--gray-700);
    border-radius: 1px;
    transition: all 0.3s ease;
    margin: 2px 0;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 导航链接 - PC端样式 */
.nav-links {
    display: flex;
    gap: 1.5rem;
    margin-left: 2.5rem;
    margin-right: auto;
    align-items: center;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.975rem;
    padding: 0.5rem 0.75rem;
    transition: color 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1.5rem);
    height: 2px;
    background-color: var(--primary);
    border-radius: 2px;
}

/* 语言切换器样式 */
.language-switcher {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.language-select {
    background-color: transparent;
    border: none;
    color: var(--gray-700);
    padding: 8px 24px 8px 32px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: auto;
    width: auto;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
    background-position: left 10px center, right 8px center;
    background-repeat: no-repeat, no-repeat;
    background-size: 16px 16px, 10px 10px;
    border-radius: 6px;
}

.language-select:hover {
    background-color: var(--gray-50);
    color: var(--primary);
}

.language-select:focus {
    background-color: var(--gray-100);
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.language-select option {
    background: white;
    color: var(--gray-700);
    padding: 8px;
}

/* 标签样式 */
.tools-tabs {
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tab-header {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--gray-200);
    font-family: "微软雅黑";
}

.tab-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    background: none;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.875rem;
    position: relative;
    white-space: nowrap;
    display: inline-block;
}

.tab-btn:hover {
    color: var(--gray-900);
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 1.25rem;
    right: 1.25rem;
    height: 2px;
    background-color: var(--primary);
}

.tool-content {
    flex: 1;
    overflow: hidden;
}

.tool-nav {
    /* 工具导航样式可以在这里添加 */
}

/* 页脚样式 */
.footer {
    padding: 1rem 0;
    font-size: 0.7rem;
    color: var(--gray-700);
    margin-top: 1rem;
    border-top: 1px dashed #eee;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    padding: 1rem 2rem;
    min-height: 80px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    padding: 2px;
    background: #fff;
    border: 1px solid #eee;
}

.footer-brand span {
    color: #999;
    font-size: 0.75rem;
}

.footer-qrcode-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-qrcode {
    width: 40px;
    height: 40px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 2px;
    background: #fff;
}

.footer-qrcode-wrapper span {
    color: #999;
    font-size: 0.75rem;
}

.footer-logo-wrapper,
.footer-qrcode-wrapper {
    position: relative;
    cursor: pointer;
}

.footer-logo-wrapper:hover::after,
.footer-qrcode-wrapper:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 8px;
    z-index: 1000;
    border: 1px solid #eee;
    padding: 8px;
}

.footer-logo-wrapper:hover::after {
    background-image: url('../../images/logo.jpg');
}

.footer-qrcode-wrapper:hover::after {
    background-image: url('../../images/gzh.jpg');
}

.footer-desc {
    flex: 1;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #999;
    display: flex;
    align-items: center;
}

/* Toast 提示框样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    background: #059669;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 移动端样式 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        padding: 0 0.75rem;
    }

    .nav {
        height: 48px;
        justify-content: space-between;
        position: relative;
    }

    /* 移动端导航栏重新布局：logo - 语言切换器 - 汉堡菜单 */
    .logo {
        order: 1;
        flex-shrink: 0;
    }

    .language-switcher {
        order: 2;
        position: absolute;
        right: 40px;
        flex-shrink: 0;
    }

    .mobile-menu-btn {
        order: 3;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        background-color: transparent !important;
        border: 1px solid transparent !important;
        flex-shrink: 0;
    }

    .mobile-menu-btn span {
        display: block !important;
        background-color: var(--gray-700) !important;
    }

    /* 移动端语言切换器样式 - 地球图标+文字风格 */
    .language-select {
        min-width: auto;
        width: auto;
        font-size: 13px;
        padding: 6px 20px 6px 28px;
        border: none;
        background-color: transparent;
        background-image: 
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='1.5'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
        background-position: left 8px center, right 6px center;
        background-repeat: no-repeat, no-repeat;
        background-size: 14px 14px, 8px 8px;
        color: var(--gray-700);
        font-weight: 500;
        outline: none;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
    }

    .language-select:focus {
        outline: none;
        background-color: var(--gray-50);
        border-radius: 4px;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        gap: 0;
        margin-left: 0;
        margin-right: 0;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        order: 4;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        font-size: 0.875rem;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--gray-100);
        width: 100%;
        text-align: left;
        justify-content: flex-start;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        padding: 0.75rem 1rem;
    }

    .tab-header {
        padding: 0.25rem;
    }
    
    .tab-btn {
        flex: 0 0 calc(50% - 0.25rem);
        font-size: 0.77rem;
        text-align: center;
    }

    .footer-qrcode {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .footer-qrcode {
        width: 40px;
        height: 40px;
        padding: 2px;
        border-radius: 4px;
    }

    .footer-desc {
        font-size: 0.7rem;
    }
}

/* 工具卡片 */
.tools {
    flex-grow: 1;
}

.tools-grid {
    display: grid;
    gap: 1.5rem;
}

.tool-card {
    text-decoration: none;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-icon svg {
    stroke: var(--primary);
    fill: none;
    stroke-width: 2;
}

.tool-card h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
}

.tool-card p {
    color: var(--gray-700);
    font-size: 0.7rem;
} 