/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #8b5cf6;
    --bg-color: #f5f3ff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #ede9fe 0%, #dbeafe 50%, #ede9fe 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.top-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    width: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo img {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-item {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 8px 16px;
    width: 200px;
}

.search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-box input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.login-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-btn:hover {
    background: var(--primary-hover);
}

/* 主体内容区域 */
.main-content {
    flex: 1;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
    gap: 24px;
}

/* 左侧菜单 */
.sidebar {
    width: 260px;
    flex-shrink: 0;
}

.sidebar-menu {
    background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    padding: 16px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 88px;
}

.menu-group {
    margin-bottom: 8px;
}

.menu-group:last-child {
    margin-bottom: 0;
}

.menu-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.menu-title:hover {
    color: var(--primary-color);
}

.menu-title:hover .menu-icon svg {
    color: var(--primary-color);
}

.menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.submenu {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    margin-left: 8px;
    margin-top: 4px;
}

.submenu-item {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.submenu-item:hover {
    background: #dbeafe;
    color: var(--text-primary);
}

.submenu-item.active {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

/* 右侧内容区域 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 工具标题区域 */
.tool-header {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    padding: 24px 32px;
    text-align: center;
}

.tool-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.tool-title-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 8px;
}

.tool-title-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.tool-title {
    font-size: 32px;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-desc {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 功能操作区域 */
.tool-content {
    display: flex;
    gap: 20px;
    flex: 1;
}

.input-section,
.result-section {
    flex: 1;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 输入区域 */
.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.required {
    color: #ef4444;
}

.input-textarea {
    flex: 1;
    min-height: 200px;
    padding: 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.input-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-textarea::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* 生成按钮 */
.generate-btn {
    margin-top: 20px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.generate-btn:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: translateY(-1px);
}

.btn-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* 结果区域 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.placeholder-icon {
    width: 128px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 16px;
    margin-bottom: 16px;
}

.placeholder-icon svg {
    width: 72px;
    height: 72px;
    color: var(--text-muted);
}

.placeholder-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.placeholder-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* 底部Footer */
.main-footer {
    background: #1e293b;
    color: white;
    padding: 48px 24px 24px;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 60px;
}

.footer-brand {
    min-width: 300px;
    flex-shrink: 0;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo img {
    width: 40px;
    height: 40px;
}

.footer-logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 16px;
    font-weight: 600;
}

.brand-en {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 1px;
}

.brand-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 16px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color);
}

.social-link svg {
    width: 16px;
    height: 16px;
    color: white;
}

.footer-links {
    display: flex;
    gap: 80px;
    flex: 1;
    justify-content: flex-end;
}

.footer-column h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: white;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column ul li a:hover {
    color: white;
}

.contact-list li {
    font-size: 13px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-list li svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: #64748b;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
}

@media (max-width: 992px) {
    .tool-content {
        flex-direction: column;
    }
    
    .main-nav {
        display: none;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .footer-links {
        justify-content: flex-start;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 8px 12px 0;
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        row-gap: 8px;
        align-items: center;
    }

    /*
     * 移动端将 main-nav 视觉上提升为 header-container 直接子项：
     * logo/登录在第一行，main-nav 在第二行并横向滚动。
     */
    .header-left {
        display: contents;
    }

    .logo {
        order: 1;
    }

    .header-right {
        order: 2;
        margin-left: auto;
    }

    .main-nav {
        order: 3;
        display: flex;
        width: 100%;
        flex-basis: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        gap: 16px;
        padding: 8px 4px 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav .nav-item {
        flex: 0 0 auto;
        font-size: 15px;
    }
    
    .search-box {
        display: none;
    }
    
    .tool-title {
        font-size: 20px;
    }
    
    .input-section,
    .result-section {
        padding: 16px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 24px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #bfdbfe;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #93c5fd;
}

/* 侧边栏滚动条 */
.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #bfdbfe;
}
