:root {
    --primary-color: #2c5aa0;
    --secondary-color: #f8f9fa;
    --text-color: #333333;
    --text-light: #6c757d;
    --success-color: #28a745;
    --error-color: #dc3545;
    --border-color: #e9ecef;
    --white: #FFFFFF;
    --header-height: 60px;
    --container-width: 1200px;
    --header-width: 220px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: var(--text-color);
    background-color: var(--secondary-color);
    line-height: 1.5;
    font-size: 15px;
    padding-left: var(--header-width);
    padding-top: var(--header-height);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* 布局容器 */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    /* padding: 0 20px; */
}

/* 头部 */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1100;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    white-space: nowrap;
}

/* 顶部导航 */
.top-nav {
    display: flex;
    gap: 22px;
    align-items: center;
}

.top-nav-item {
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.2s;
}

.top-nav-item:hover {
    color: var(--primary-color);
    background-color: #f8f9fa;
}

.top-nav-item.active {
    color: var(--primary-color);
    background-color: #ecf5ff;
}

/* 左侧导航栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--header-width);
    height: calc(100vh - var(--header-height));
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 16px 0;
    z-index: 1000;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.sidebar-content {
    width: 100%;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    height: auto;
    align-items: stretch;
    padding: 0 10px;
}

.nav-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    height: auto;
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.nav-item:hover {
    color: var(--primary-color);
    background-color: #ecf5ff;
}

.nav-item.active {
    color: var(--primary-color);
    background-color: #ecf5ff;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    width: 100%;
}

.dropdown-content {
    display: none;
    position: static;
    background-color: transparent;
    min-width: 100%;
    box-shadow: none;
    border: none;
    padding: 4px 0 4px 20px;
    margin-left: 0;
    transition: all 0.3s;
}

/* 移除 hover 显示，改为 class 控制 */
.dropdown:hover .dropdown-content {
    display: none;
}

.dropdown.expanded .dropdown-content {
    display: block;
}

.dropdown-item {
    padding: 10px 16px;
    display: block;
    color: var(--text-light);
    font-size: 13px;
    white-space: nowrap;
    text-align: left;
    border-radius: 6px;
    margin-bottom: 2px;
}

.dropdown-item:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.dropdown-item.active {
    color: var(--primary-color);
    background-color: #f0f7ff;
}

/* 一级菜单添加箭头指示 */
.dropdown > .nav-item {
    justify-content: space-between;
}

.dropdown > .nav-item::after {
    content: '\f107'; /* FontAwesome angle-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 12px;
    transition: transform 0.3s;
    opacity: 0.5;
}

.dropdown.expanded > .nav-item::after {
    transform: rotate(180deg);
}

.dropdown.expanded > .nav-item {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    font-size: 22px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
    background-color: #f5f7fa;
}

/* 主体内容 */
.main-content {
    min-height: calc(100vh - 100px);
    padding-top: 20px;
}

.ad-slot {
    width: 100%;
    display: flex;
    justify-content: center;
     margin: 20px 0; 
}

.ad-slot-inner {
    width: 100%;
    /*max-width: calc(100% - 40px);*/
    height: 90px;
    background: #f0f2f5;
    border: 1px dashed var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.tool-guide {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.tool-guide h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.tool-guide p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.tool-guide p:last-child {
    margin-bottom: 0;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.hero-title {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--text-color);
    font-weight: 600;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 特色介绍 */
.features-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
    text-align: center;
}

.feature-item {
    padding: 20px;
}

.feature-icon {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-desc {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.4;
}

/* 首页工具卡片 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-card {
    background: var(--white);
    border-radius: 6px;
    padding: 24px 16px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.tool-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    background-color: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.tool-card:hover .tool-icon {
    background-color: var(--primary-color);
    color: var(--white);
}

.tool-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.tool-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}

/* 工具页面通用结构 */
.tool-page-container {
    background: var(--white);
    border-radius: 8px;
    padding: 32px;
    border: 1px solid var(--border-color);
}

.tool-header {
    text-align: center;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.tool-header h1 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.tool-header p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}

.tool-workspace {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* 文件上传区域 */
.upload-area {
    width: 100%;
    max-width: 600px;
    height: 240px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #FAFAFA;
    position: relative;
    margin-bottom: 30px;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: #ECF5FF;
    transform: scale(1.01);
}

.upload-icon {
    font-size: 56px;
    color: #c0c4cc;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.upload-area:hover .upload-icon {
    color: var(--primary-color);
}

.upload-text {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
}

.upload-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 文件列表 */
.file-list {
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.file-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.file-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
    font-weight: 500;
}

.file-actions {
    display: flex;
    gap: 15px;
}

.btn-remove {
    color: var(--error-color);
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.3s;
}

.btn-remove:hover {
    opacity: 0.8;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 16px;
}

.form-label {
    min-width: 90px;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--white);
}

.textarea-control {
    width: 100%;
    min-height: 180px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--white);
    resize: vertical;
}

.result-box {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #fafafa;
    padding: 12px;
}

.hint-text {
    color: var(--text-light);
    font-size: 12px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    height: 44px;
    white-space: nowrap;
    cursor: pointer;
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-align: center;
    box-sizing: border-box;
    outline: none;
    margin: 0;
    transition: .2s;
    font-weight: 500;
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 4px;
    min-width: 120px;
}

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

.btn-primary:hover {
    background-color: #1e4080;
    border-color: #1e4080;
}

.btn-primary:active {
    background-color: #1a3568;
    border-color: #1a3568;
}

.btn-sm {
    height: 32px;
    padding: 8px 15px;
    font-size: 12px;
    min-width: 60px;
}

.action-bar {
    margin-top: 24px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* SEO说明区域 */
.seo-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.seo-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 12px;
    font-weight: 600;
}

.seo-content {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

.seo-content p {
    margin-bottom: 15px;
}

/* 底部 */
.footer {
    background-color: var(--white);
    padding: 40px 0;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* 提示框 */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 6px;
    color: var(--white);
    font-size: 15px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: -20px;
}

.toast.show {
    opacity: 1;
    margin-top: 0;
}

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

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

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

/* 移动端适配 */
@media (max-width: 1200px) {
    .container {
        width: 100%;
    }
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .features-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding-left: 0;
        padding-top: 50px;
    }
    
    .header {
        height: 50px;
    }

    .logo {
        font-size: 18px;
    }

    .top-nav {
        display: none;
    }

    body.sidebar-open::before {
        content: '';
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.35);
        z-index: 900;
    }

    .sidebar {
        top: 50px;
        height: calc(100vh - 50px);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        border-right: 1px solid var(--border-color);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

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

    .tool-page-container {
        padding: 16px;
    }

    .btn {
        width: 100%;
        padding: 12px;
        min-height: 48px; /* 增加触摸区域 */
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .form-label {
        margin-bottom: 4px;
    }
    
    .form-control, .textarea-control {
        width: 100%;
        font-size: 16px; /* 防止iOS缩放 */
    }

    /* 表格响应式滚动 */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .action-bar {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .hero-title {
        font-size: 24px;
    }

    .ad-slot-inner {
        width: 320px;
        height: 50px;
    }

    .tool-card:hover, .upload-area:hover {
        transform: none;
        box-shadow: none;
    }
    
    .tool-card:active {
        background-color: #f0f0f0;
    }
    
    .main-content {
        min-height: calc(100vh - 50px - 100px);
    }
}

@media (max-width: 480px) {
    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}
