/**
 * SEO站群程序样式
 * 纯黑白配色 + 夜间模式
 */

/* ========== 全局变量（纯黑白配色） ========== */
:root {
    --primary: #111111;
    --primary-hover: #333333;
    --text: #111111;
    --text-secondary: #666666;
    --bg: #ffffff;
    --sidebar-bg: #fafafa;
    --card-bg: #f5f5f5;
    --border-color: #e5e5e5;
    --input-bg: #f5f5f5;
    --input-bg-focus: #ffffff;
    --input-radius: 28px;
    --transition-speed: 0.3s;
    --ease-curve: cubic-bezier(0.2, 0.0, 0, 1.0);
}

/* 夜间模式 */
.dark-mode {
    --primary: #ffffff;
    --primary-hover: #cccccc;
    --text: #e5e5e5;
    --text-secondary: #999999;
    --bg: #111111;
    --sidebar-bg: #1a1a1a;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --input-bg: #222222;
    --input-bg-focus: #111111;
}

/* ========== 基础样式 ========== */
html, body, .wrapper {
    overflow-x: hidden;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
    background-color: var(--bg) !important;
    color: var(--text) !important;
    transition: background-color 0.3s, color 0.3s;
    font-size: 1.0625rem;
    line-height: 1.75;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
    color: var(--text);
    text-decoration: none;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.4);
}

.wrapper,
.content-wrapper {
    background-color: var(--bg) !important;
    transition: margin-left var(--transition-speed) var(--ease-curve);
}

/* ========== 顶部导航 ========== */
.main-header {
    background-color: var(--bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: none !important;
    height: 60px;
}

.main-header .nav-link {
    color: var(--text-secondary) !important;
    font-size: 1rem;
}

.main-header .nav-link:hover {
    color: var(--text) !important;
}

/* ========== 左侧边栏 ========== */
.main-sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid var(--border-color);
    box-shadow: none !important;
}

.brand-link {
    height: 60px;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.brand-link:hover {
    color: var(--text) !important;
}

.brand-search-btn {
    color: var(--text-secondary) !important;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.brand-search-btn:hover {
    color: var(--text) !important;
}

.nav-sidebar .nav-item .nav-link {
    color: var(--text);
    border-radius: 0 50px 50px 0;
    margin-right: 10px;
    padding: 12px 1rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.nav-sidebar .nav-item .nav-link.active {
    background-color: var(--card-bg) !important;
    color: var(--text) !important;
    font-weight: 600;
}

.nav-sidebar .nav-item .nav-link:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

.dark-mode .nav-sidebar .nav-item .nav-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.sidebar-custom {
    border-top: 1px solid var(--border-color) !important;
    padding: 1rem;
}

/* ========== 搜索框区域 ========== */
.home-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
}

.home-shell {
    width: 100%;
    max-width: 720px;
    text-align: center;
}

.home-logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}

.home-logo a {
    color: var(--text);
}

.home-logo a:hover {
    opacity: 0.8;
}

.chat-input-box {
    background-color: var(--input-bg);
    border-radius: var(--input-radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    padding: 6px;
    transition: all 0.2s;
}

.chat-input-box:focus-within {
    background-color: var(--input-bg-focus);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--text-secondary);
}

.dark-mode .chat-input-box:focus-within {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.chat-input-main {
    flex: 1;
    padding: 10px 0 6px 16px;
    display: flex;
    flex-direction: column;
    min-height: 60px;
}

.chat-input-text {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--text);
    max-height: 200px;
    font-family: inherit;
}

.chat-input-text::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.chat-input-footer {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input-actions {
    display: flex;
    align-items: center;
    padding-bottom: 4px;
    padding-right: 8px;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn i {
    font-size: 1.1rem;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.dark-mode .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.send-btn {
    display: none;
    opacity: 0.5;
}

.chat-input-box.has-content .send-btn {
    display: flex;
    background-color: var(--primary);
    color: var(--bg);
    opacity: 1;
}

.close-btn {
    display: none;
}

.chat-input-box.has-content .close-btn {
    display: flex;
}

/* ========== 广告位 ========== */
.ad-section {
    padding: 30px 0;
}

.ad-banner-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
}

.ad-banner-link {
    display: block;
    width: 100%;
}

.ad-banner-img {
    width: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.ad-banner-link:hover .ad-banner-img {
    opacity: 0.9;
}

/* ========== 内容区域 ========== */
.content-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.section-title h2 a {
    color: var(--text);
}

.section-title p {
    color: var(--text-secondary);
    font-size: 1.0625rem;
}

/* ========== 特性卡片 ========== */
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    transition: all 0.2s;
    height: 100%;
}

.feature-card:hover {
    border-color: var(--text-secondary);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--bg);
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
}

/* ========== 内容卡片 ========== */
.content-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.content-card p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 16px;
}

.content-card p:last-child {
    margin-bottom: 0;
}

/* ========== FAQ ========== */
.faq-item {
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 12px;
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-question .badge {
    background: var(--primary);
    color: var(--bg);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 50%;
}

.faq-answer {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    padding-left: 36px;
}

/* ========== 合作伙伴 ========== */
.partners-section {
    padding: 60px 0;
    background: var(--card-bg);
}

.partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.partner-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.partner-link:hover {
    border-color: var(--text-secondary);
    color: var(--text);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dark-mode .partner-link:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ========== 右侧工作台 ========== */
.workspace-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.3s var(--ease-curve);
}

.workspace-sidebar.open {
    right: 0;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    height: 60px;
}

.workspace-tab {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    border: none;
}

.workspace-header-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-header-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.dark-mode .workspace-header-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.workspace-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.workspace-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.workspace-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--text);
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border-color);
}

.workspace-info-item:last-child {
    border-bottom: none;
}

.workspace-info-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.workspace-info-item.clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.workspace-info-item.clickable:hover {
    opacity: 0.7;
}

/* ========== 页脚 ========== */
.main-footer {
    background: #111 !important;
    color: rgba(255, 255, 255, 0.75);
    border: none !important;
    padding: 50px 0 0;
}

.dark-mode .main-footer {
    background: #000 !important;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    font-size: 1.125rem;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 12px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
}

.footer-section a:hover {
    color: #fff;
    opacity: 1;
}

.footer-section p {
    font-size: 0.9375rem;
    line-height: 1.7;
}

.footer-bottom {
    text-align: center;
    padding: 24px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ========== 搜索弹窗 ========== */
.history-search-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-search-modal.open {
    display: flex;
    opacity: 1;
}

.history-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.history-search-dialog {
    position: relative;
    z-index: 2;
    width: 500px;
    max-width: 90%;
    background-color: var(--bg);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.history-search-modal.open .history-search-dialog {
    transform: scale(1);
}

.history-search-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: var(--text);
}

.history-search-body {
    padding: 20px;
}

#history-search-input {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text);
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
}

#history-search-input:focus {
    outline: none;
    border-color: var(--text-secondary);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    body {
        font-size: 1rem;
    }

    .home-logo {
        font-size: 1.75rem;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .content-card {
        padding: 24px 20px;
    }

    .workspace-sidebar {
        width: 100%;
        right: -100%;
    }

    .partners-grid {
        gap: 10px;
    }

    .partner-link {
        padding: 8px 14px;
        font-size: 0.875rem;
    }

    .ad-banner-img {
        height: 160px !important;
    }
}

@media (max-width: 576px) {
    .home-container {
        padding: 30px 15px;
    }

    .content-section {
        padding: 40px 0;
    }

    .feature-card {
        padding: 20px 16px;
    }

    .feature-icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }

    .ad-banner-img {
        height: 120px !important;
    }
}