/**
 * SEO站群程序样式 - 粉色主题（移动端优先）
 * 玫粉色系 + 夜间模式 + 触控优化
 */

/* ========== 全局变量（粉色主题） ========== */
:root {
    --primary: #e0457b;          /* 主玫粉色 */
    --primary-hover: #c9356a;    /* 深玫粉 */
    --primary-soft: #fce4ec;     /* 极浅粉 */
    --accent: #f48fb1;           /* 柔和粉 */

    --text: #2a1a22;             /* 带粉调的深棕 */
    --text-secondary: #8b6975;   /* 柔和的粉灰 */

    --bg: #fffafc;               /* 微微泛粉的白 */
    --sidebar-bg: #fdf2f6;       /* 浅粉边栏 */
    --card-bg: #fef6f9;          /* 浅粉卡片 */
    --border-color: #f5d6e0;     /* 粉色边框 */

    --input-bg: #fdf2f6;
    --input-bg-focus: #ffffff;

    --footer-bg: #2a1620;        /* 深玫色页脚 */

    --shadow-sm: 0 1px 3px rgba(224, 69, 123, 0.06);
    --shadow-md: 0 4px 16px rgba(224, 69, 123, 0.08);
    --shadow-lg: 0 8px 32px rgba(224, 69, 123, 0.12);

    --input-radius: 28px;
    --transition-speed: 0.3s;
    --ease-curve: cubic-bezier(0.2, 0.0, 0, 1.0);
}

/* 夜间模式（深玫色） */
.dark-mode {
    --primary: #f48fb1;
    --primary-hover: #f06292;
    --primary-soft: #3a1f2a;
    --accent: #ec407a;

    --text: #f5e0e8;
    --text-secondary: #b89aa3;

    --bg: #1a0f14;
    --sidebar-bg: #221620;
    --card-bg: #2a1a23;
    --border-color: #4a2a37;

    --input-bg: #2a1a23;
    --input-bg-focus: #1a0f14;

    --footer-bg: #0f0810;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ========== 基础样式（移动端优先） ========== */
html, body, .wrapper {
    overflow-x: hidden;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

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: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

a:hover, a:active {
    color: var(--primary-hover);
    opacity: 0.9;
    text-decoration: none;
}

/* 优化移动端按钮触控 */
button, .nav-link, .icon-btn, .partner-link {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(224, 69, 123, 0.25);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(224, 69, 123, 0.45);
}

.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: 56px;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: saturate(1.2);
}

.main-header .nav-link {
    color: var(--text-secondary) !important;
    font-size: 1rem;
    padding: 0.5rem 0.85rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

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

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

.brand-link {
    height: 56px;
    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.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 100%);
}

.brand-link:hover {
    color: var(--primary) !important;
    opacity: 1;
}

.brand-text {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.brand-search-btn:hover,
.brand-search-btn:active {
    color: var(--primary) !important;
    background-color: var(--primary-soft);
}

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

.nav-sidebar .nav-item .nav-link.active {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.nav-sidebar .nav-item .nav-link.active .nav-icon {
    color: #fff !important;
}

.nav-sidebar .nav-item .nav-link:hover:not(.active),
.nav-sidebar .nav-item .nav-link:active:not(.active) {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
}

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

#sidebarThemeBtn {
    border: 1px solid var(--border-color) !important;
    color: var(--text) !important;
    background: var(--card-bg) !important;
    min-height: 40px;
}

#sidebarThemeBtn:hover {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    border-color: var(--accent) !important;
}

/* ========== 搜索框区域（首屏） ========== */
.home-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    background:
        radial-gradient(circle at 20% 20%, var(--primary-soft) 0%, transparent 50%),
        radial-gradient(circle at 80% 60%, rgba(244, 143, 177, 0.15) 0%, transparent 50%);
}

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

.home-logo {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.3;
    word-break: break-word;
}

.home-logo a {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--primary);
}

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

.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.25s;
    box-shadow: var(--shadow-sm);
}

.chat-input-box:focus-within {
    background-color: var(--input-bg-focus);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

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

.chat-input-text {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-size: 16px; /* 防 iOS 自动放大 */
    line-height: 1.5;
    color: var(--text);
    max-height: 200px;
    font-family: inherit;
}

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

.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: 6px;
    gap: 6px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    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.05rem;
}

.icon-btn:hover,
.icon-btn:active {
    background-color: var(--primary-soft);
    color: var(--primary);
}

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

.chat-input-box.has-content .send-btn {
    display: flex;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(224, 69, 123, 0.35);
}

.chat-input-box.has-content .send-btn:hover {
    background: var(--primary-hover);
    color: #fff;
}

.close-btn {
    display: none;
}

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

/* ========== 视频区域（响应式） ========== */
.video-container {
    text-align: center;
    margin: 16px 0 24px !important;
    padding: 0 4px;
}

.video-wrapper {
    max-width: 100% !important;
    width: 100%;
    display: block !important;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--card-bg);
}

.video-wrapper video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    background: #000;
    border-radius: 14px;
}

/* ========== 广告位 ========== */
.ad-section {
    padding: 20px 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,
.ad-banner-link:active .ad-banner-img {
    opacity: 0.9;
}

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

.section-title {
    text-align: center;
    margin-bottom: 32px;
    padding: 0 16px;
}

.section-title h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.3;
    word-break: break-word;
}

.section-title h2 a {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--primary);
}

.section-title p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-word;
}

/* ========== 特性卡片 ========== */
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 18px;
    text-align: center;
    transition: all 0.3s;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.feature-card:hover::before,
.feature-card:active::before {
    transform: scaleX(1);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 4px 14px rgba(224, 69, 123, 0.3);
}

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

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

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

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

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

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

.faq-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.faq-question .badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 9px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

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

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

.partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0 12px;
}

.partner-link {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 38px;
}

.partner-link:hover,
.partner-link:active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
    opacity: 1;
    transform: translateY(-1px);
}

/* ========== 右侧工作台 ========== */
.workspace-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 360px;
    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);
    box-shadow: -4px 0 24px rgba(224, 69, 123, 0.08);
}

.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: 56px;
    background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 100%);
}

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

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

.workspace-header-btn:hover,
.workspace-header-btn:active {
    background-color: var(--primary-soft);
    color: var(--primary);
}

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

.workspace-section-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.workspace-info-item i {
    width: 22px;
    text-align: center;
    color: var(--primary);
    flex-shrink: 0;
}

.workspace-info-item.clickable {
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    padding: 12px 8px;
    margin: 0 -8px;
}

.workspace-info-item.clickable:hover,
.workspace-info-item.clickable:active {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ========== 页脚 ========== */
.main-footer {
    background: var(--footer-bg) !important;
    color: rgba(255, 255, 255, 0.78);
    border: none !important;
    padding: 40px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0 16px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-section h4 {
    font-size: 1.05rem;
    margin-bottom: 14px;
    color: #fff;
    font-weight: 600;
    position: relative;
    padding-bottom: 8px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

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

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

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
}

.footer-section a:hover,
.footer-section a:active {
    color: var(--accent);
    opacity: 1;
}

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

.footer-bottom {
    text-align: center;
    padding: 18px 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

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

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

/* ========== 搜索弹窗 ========== */
.history-search-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 16px;
    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(42, 22, 32, 0.5);
    backdrop-filter: blur(6px);
}

.history-search-dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 500px;
    background-color: var(--bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    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: 600;
    color: var(--primary);
}

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

#history-search-input {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px; /* 防 iOS 缩放 */
}

#history-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ========== 平板（≥768px） ========== */
@media (min-width: 768px) {
    body {
        font-size: 16.5px;
    }

    .home-container {
        padding: 50px 24px;
    }

    .home-logo {
        font-size: 2.4rem;
        margin-bottom: 26px;
    }

    .ad-section {
        padding: 30px 0;
    }

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

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

    .section-title h2 {
        font-size: 1.9rem;
        margin-bottom: 12px;
    }

    .section-title p {
        font-size: 1.05rem;
    }

    .feature-card {
        padding: 28px 24px;
    }

    .feature-icon {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .content-card {
        padding: 32px;
    }

    .partners-section {
        padding: 56px 0;
    }

    .partners-grid {
        gap: 14px;
    }

    .partner-link {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 36px;
        padding: 0 16px 36px;
    }

    .footer-section h4 {
        font-size: 1.1rem;
        margin-bottom: 18px;
    }

    .video-container {
        margin: 20px 0 28px !important;
    }
}

/* ========== 桌面（≥992px） ========== */
@media (min-width: 992px) {
    body {
        font-size: 17px;
    }

    .home-container {
        padding: 70px 24px;
    }

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

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

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

    .partners-section {
        padding: 70px 0;
    }

    .workspace-sidebar {
        max-width: 360px;
    }
}

/* ========== 极小屏（<360px） ========== */
@media (max-width: 359px) {
    .home-logo {
        font-size: 1.55rem;
    }

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

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    .partner-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* ========== 视频回退提示在粉色主题下的适配 ========== */
.video-wrapper p {
    background: var(--card-bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-color);
}

.video-wrapper p a {
    color: var(--primary);
    font-weight: 600;
}

/* ========== 首页副标题 (h2) ========== */
.home-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: -8px 0 22px;
    line-height: 1.5;
    word-break: break-word;
}

/* ========== 首页标语 (h3) ========== */
.home-tagline {
    margin-top: 18px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    word-break: break-word;
}

/* ========== 内容卡片内的 h3 ========== */
.content-h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-soft);
    display: inline-block;
}

@media (min-width: 768px) {
    .home-subtitle {
        font-size: 1.2rem;
        margin: -4px 0 28px;
    }
    .home-tagline {
        margin-top: 24px;
        font-size: 1rem;
    }
    .content-h3 {
        font-size: 1.35rem;
    }
}

@media (min-width: 992px) {
    .home-subtitle {
        font-size: 1.3rem;
    }
}