/* ========== 微信智能管家 主站样式 ========== */
body { font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif; }

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, #1a3a6c 0%, #667eea 50%, #764ba2 100%);
    min-height: 600px;
    display: flex;
    align-items: center;
}
.hero-canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}
.min-vh-75 { min-height: 75vh; }

.stat-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-3px); }

.hero-image-placeholder,
.about-image-placeholder,
.feature-image-placeholder,
.vision-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f0 100%);
    border-radius: 16px;
}
.hero-image-placeholder {
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.2);
}
.vision-image-placeholder {
    background: rgba(255,255,255,0.05);
    border: 2px dashed rgba(255,255,255,0.15);
    min-height: 350px;
}

/* --- Service Cards --- */
.service-card {
    transition: all 0.3s ease;
    border-radius: 12px;
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12) !important;
}

/* --- Feature Gradient Cards --- */
.feature-gradient-card {
    transition: all 0.3s ease;
}
.feature-gradient-card:hover {
    transform: translateX(8px);
}
.gradient-1 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); box-shadow: 0 4px 20px rgba(240,147,251,0.3); }
.gradient-2 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); box-shadow: 0 4px 20px rgba(79,172,254,0.3); }
.gradient-3 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); box-shadow: 0 4px 20px rgba(67,233,123,0.3); }

/* --- Pricing Cards --- */
.pricing-card {
    border-radius: 12px;
    transition: all 0.3s ease;
}
.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}
.pricing-card.recommended {
    border: 2px solid #2C5F8D !important;
    box-shadow: 0 5px 20px rgba(44,95,141,0.2);
}

/* --- Tutorial / News Cards --- */
.tutorial-card, .news-card {
    border-radius: 12px;
    transition: all 0.3s ease;
}
.tutorial-card:hover, .news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

/* --- Tutorial Content --- */
.tutorial-content h3, .article-content h3 { margin-top: 1.5em; margin-bottom: 0.5em; color: #1E4266; }
.tutorial-content p, .article-content p { color: #5A6C7D; line-height: 1.8; }
.tutorial-content ul, .article-content ul { color: #5A6C7D; }

/* --- Timeline (Changelog) --- */
.timeline { position: relative; padding-left: 60px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 25px; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 2px;
}
.timeline-item { position: relative; margin-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -43px; top: 25px;
    width: 14px; height: 14px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px #667eea40;
}

/* --- Changelog Content --- */
.changelog-content ul { padding-left: 1.2em; }
.changelog-content li { margin-bottom: 0.3em; }

/* --- FAQ Accordion --- */
.accordion-button:not(.collapsed) { background-color: #f0f4ff; color: #1E4266; }
.accordion-button:focus { box-shadow: none; border-color: #dee2e6; }

/* --- Navbar Dropdown --- */
.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 10px;
    padding: 8px;
}
.navbar .dropdown-item { border-radius: 6px; padding: 8px 12px; }
.navbar .dropdown-item:hover { background-color: #f0f4ff; }

/* --- Footer --- */
footer a:hover { color: #667eea !important; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-section { min-height: 500px; }
    .stat-card .fs-3 { font-size: 1.2rem !important; }
    .timeline { padding-left: 40px; }
    .timeline::before { left: 15px; }
    .timeline-dot { left: -33px; }
}


/* ========== Interactive Demo Window ========== */
.app-demo-window {
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    font-size: 12px;
    color: #2C3E50;
    position: relative;
    max-width: 100%;
}

.demo-titlebar {
    background: linear-gradient(180deg, #2d2d3f, #252538);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    user-select: none;
}
.demo-dots {
    display: flex;
    gap: 6px;
    margin-right: 12px;
}
.demo-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.demo-title-text {
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    flex: 1;
    text-align: center;
}

.demo-body {
    display: flex;
    height: 420px;
    background: #F5F7FA;
}

/* Sidebar */
.demo-sidebar {
    width: 150px;
    min-width: 150px;
    background: #16324A;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.demo-logo {
    padding: 12px 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.demo-logo-title {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}
.demo-logo-ver {
    color: #8FA4B8;
    font-size: 9px;
    margin-top: 2px;
}

.demo-nav-group {
    color: #A8C0D8;
    font-size: 9px;
    font-weight: bold;
    padding: 10px 12px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-nav-item {
    color: #cfd8e0;
    padding: 7px 12px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.demo-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.demo-nav-item.active {
    background: #2C5F8D;
    color: #fff;
    border-left-color: #5D9CEC;
    font-weight: bold;
}
.demo-nav-icon {
    font-size: 10px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.demo-sidebar-spacer { flex: 1; }

.demo-status {
    padding: 10px 12px;
    color: #48A999;
    font-size: 9px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.demo-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #48A999;
    border-radius: 50%;
    margin-right: 4px;
    animation: demoPulse 2s infinite;
}
@keyframes demoPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Content area */
.demo-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
    background: #F5F7FA;
    position: relative;
}
.demo-content::-webkit-scrollbar { width: 4px; }
.demo-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.demo-page { display: none; }
.demo-page.active { display: block; animation: demoFadeIn 0.3s; }
@keyframes demoFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.demo-page-title {
    font-size: 16px;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 2px;
}
.demo-page-subtitle {
    font-size: 10px;
    color: #5A6C7D;
    margin-bottom: 12px;
}

/* Dashboard metric cards */
.demo-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.demo-metric-card {
    background: #fff;
    border: 1px solid #D5DCE3;
    border-radius: 6px;
    padding: 10px;
}
.demo-metric-label {
    color: #5A6C7D;
    font-size: 9px;
    margin-bottom: 4px;
}
.demo-metric-value {
    color: #2C3E50;
    font-size: 20px;
    font-weight: bold;
    line-height: 1.2;
}
.demo-metric-status {
    color: #48A999 !important;
    font-size: 16px !important;
}
.demo-metric-trend {
    font-size: 9px;
    margin-top: 2px;
}
.trend-up { color: #48A999; }
.trend-ok { color: #5A6C7D; }

/* Tables */
.demo-tables-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.demo-table-card {
    background: #fff;
    border: 1px solid #D5DCE3;
    border-radius: 6px;
    padding: 10px;
    overflow: hidden;
}
.demo-table-title {
    font-size: 11px;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 6px;
}
.demo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
}
.demo-table th {
    background: #F8FAFB;
    color: #5A6C7D;
    font-weight: 600;
    padding: 4px 6px;
    border-bottom: 1px solid #D5DCE3;
    text-align: left;
    white-space: nowrap;
}
.demo-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #E8EDF2;
    color: #2C3E50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
.demo-table tbody tr:hover { background: #F5F8FA; }
.demo-table-full { margin-top: 8px; }
.demo-table-full td { max-width: 120px; }

/* Tags */
.demo-tag-danger { color: #E74C3C; font-weight: 600; font-size: 9px; }
.demo-tag-warning { color: #F39C12; font-weight: 600; font-size: 9px; }
.demo-tag-info { color: #5D9CEC; font-weight: 600; font-size: 9px; }
.demo-tag-ok {
    display: inline-block;
    background: #e8f8f2;
    color: #48A999;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
}
.demo-tag-warn {
    display: inline-block;
    background: #fef5e7;
    color: #F39C12;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
}

/* Keywords page */
.demo-keyword-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.demo-keyword-count {
    color: #5A6C7D;
    font-size: 10px;
}
.demo-keyword-list {
    background: #fff;
    border: 1px solid #D5DCE3;
    border-radius: 6px;
    overflow: hidden;
}
.demo-keyword-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #E8EDF2;
}
.demo-keyword-item:last-child { border-bottom: none; }
.demo-keyword-info { display: flex; align-items: center; gap: 8px; }
.demo-keyword-text { font-weight: 600; color: #2C3E50; font-size: 11px; }
.demo-keyword-cat { color: #5A6C7D; font-size: 9px; }
.demo-keyword-actions { display: flex; align-items: center; gap: 8px; }

/* Toggle switch */
.demo-switch {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 16px;
}
.demo-switch input { opacity: 0; width: 0; height: 0; }
.demo-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 16px;
    transition: 0.3s;
}
.demo-slider::before {
    content: '';
    position: absolute;
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.demo-switch input:checked + .demo-slider { background: #48A999; }
.demo-switch input:checked + .demo-slider::before { transform: translateX(12px); }

/* Buttons */
.demo-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.demo-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.demo-btn-primary { background: #2C5F8D; color: #fff; }
.demo-btn-primary:hover { background: #1E4266; }
.demo-btn-success { background: #48A999; color: #fff; }
.demo-btn-success:hover { background: #3D8F81; }
.demo-btn-secondary { background: #D5DCE3; color: #5A6C7D; }

/* Mass send page */
.demo-mass-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 10px;
}
.demo-form-group { margin-bottom: 8px; }
.demo-form-label {
    font-size: 10px;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 4px;
}
.demo-group-list {
    background: #fff;
    border: 1px solid #D5DCE3;
    border-radius: 4px;
    overflow: hidden;
}
.demo-group-item {
    padding: 6px 10px;
    font-size: 10px;
    color: #2C3E50;
    border-bottom: 1px solid #E8EDF2;
    cursor: pointer;
}
.demo-group-item:last-child { border-bottom: none; }
.demo-group-item:hover { background: #F5F8FA; }
.demo-group-item.active { background: #E8F0F7; color: #2C5F8D; font-weight: 600; }

.demo-textarea {
    background: #fff;
    border: 1px solid #D5DCE3;
    border-radius: 4px;
    padding: 8px;
    font-size: 10px;
    color: #2C3E50;
    line-height: 1.5;
    min-height: 60px;
}

.demo-progress-bar {
    background: #E8EDF2;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}
.demo-progress-fill {
    background: linear-gradient(90deg, #2C5F8D, #5D9CEC);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.demo-progress-text {
    font-size: 9px;
    color: #5A6C7D;
    margin-bottom: 6px;
}
.demo-mass-btns {
    display: flex;
    gap: 6px;
}

/* Search bar */
.demo-search-bar { margin-bottom: 8px; }
.demo-search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #D5DCE3;
    border-radius: 4px;
    font-size: 10px;
    background: #fff;
    color: #2C3E50;
    outline: none;
    box-sizing: border-box;
}
.demo-search-input:focus { border-color: #2C5F8D; }

/* Toast notification */
.demo-toast {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #2C3E50;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
    max-width: 200px;
}
.demo-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Demo responsive */
@media (max-width: 1199px) {
    .demo-body { height: 380px; }
    .demo-sidebar { width: 130px; min-width: 130px; }
}
@media (max-width: 991px) {
    .app-demo-window { display: none; }
    .demo-mobile-hint { display: block !important; }
}
@media (min-width: 992px) {
    .demo-mobile-hint { display: none !important; }
}

/* ========== 手机端响应式适配 ========== */

/* 超小屏幕 (小于576px) */
@media (max-width: 575.98px) {
    /* Hero区域 */
    .hero-section {
        min-height: auto;
        padding: 60px 0 40px;
    }
    .hero-section h1.display-3 {
        font-size: 1.8rem !important;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
    .hero-section p {
        font-size: 0.9rem;
    }
    .hero-section .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
    .hero-section .btn-lg + .btn-lg {
        margin-left: 0 !important;
    }
    .stat-card {
        padding: 8px !important;
    }
    .stat-card .fs-3 {
        font-size: 1rem !important;
    }
    .stat-card small {
        font-size: 0.7rem;
    }
    
    /* 通用标题 */
    h2.fw-bold {
        font-size: 1.5rem;
    }
    h3.fw-bold {
        font-size: 1.25rem;
    }
    
    /* 服务卡片 */
    .service-card .card-body {
        padding: 1rem;
    }
    .service-card h5 {
        font-size: 1rem;
    }
    
    /* 价格卡片 */
    .pricing-card {
        margin-bottom: 1rem;
    }
    .pricing-card .display-5 {
        font-size: 2rem !important;
    }
    
    /* 代理招募区域 */
    #agent-recruit .display-6 {
        font-size: 1.3rem !important;
    }
    #agent-recruit .fs-4 {
        font-size: 1rem !important;
    }
    
    /* 页脚 */
    footer .col-lg-4,
    footer .col-lg-2 {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    /* 导航栏 */
    .navbar-brand {
        font-size: 1rem !important;
    }
    .navbar .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        box-shadow: none;
        background: rgba(255,255,255,0.1);
    }
    
    /* 表单 */
    .form-control, .form-select {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    /* 按钮组 */
    .btn-group-vertical {
        width: 100%;
    }
    .btn-group > .btn {
        flex: 1;
    }
    
    /* 关于我们数据卡片 */
    #about .card .fs-3 {
        font-size: 1.5rem !important;
    }
    
    /* 特性卡片 */
    .feature-gradient-card {
        padding: 1rem !important;
    }
    
    /* 容器内边距 */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* 区块间距 */
    section.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* 小屏幕 (576px - 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-section h1.display-3 {
        font-size: 2.2rem !important;
    }
    .stat-card .fs-3 {
        font-size: 1.1rem !important;
    }
    #agent-recruit .display-6 {
        font-size: 1.5rem !important;
    }
}

/* 中等屏幕 (768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-section h1.display-3 {
        font-size: 2.5rem !important;
    }
    .pricing-card .display-5 {
        font-size: 2.5rem !important;
    }
}

/* 平板横屏和小桌面 */
@media (max-width: 991.98px) {
    /* 隐藏桌面端演示窗口 */
    .app-demo-window {
        display: none !important;
    }
    
    /* Hero按钮布局调整 */
    .hero-section .col-lg-6:first-child {
        text-align: center;
    }
    
    /* 价格区域三列变两列 */
    #pricing .row > div {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* 关于我们图片区域 */
    .about-image-placeholder {
        min-height: 200px;
        margin-bottom: 1.5rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大点击区域 */
    .btn {
        min-height: 44px;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* 禁用hover效果 */
    .service-card:hover,
    .pricing-card:hover,
    .tutorial-card:hover,
    .news-card:hover {
        transform: none;
    }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 30px 0;
    }
    .min-vh-75 {
        min-height: 50vh !important;
    }
}

/* iOS Safari底部安全区适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    footer {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* ========== 注册/登录页面手机适配 ========== */
@media (max-width: 575.98px) {
    /* 注册页面表单 */
    #registerForm .input-group {
        flex-wrap: wrap;
    }
    #registerForm .input-group .form-control {
        flex: 1 1 100%;
        border-radius: 0.375rem !important;
        margin-bottom: 8px;
    }
    #registerForm .input-group .btn {
        flex: 1 1 100%;
        border-radius: 0.375rem !important;
    }
    
    /* 购买页面 */
    .purchase-card {
        margin-bottom: 1rem;
    }
    
    /* 用户中心卡片 */
    .card .card-body {
        padding: 1rem;
    }
    .card .card-title {
        font-size: 1.1rem;
    }
    
    /* 表格响应式 */
    .table-responsive {
        font-size: 0.85rem;
    }
    .table th, .table td {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    /* 模态框 */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-body {
        padding: 1rem;
    }
}

/* ========== 用户中心手机适配 ========== */
@media (max-width: 767.98px) {
    /* 仪表盘统计卡片 */
    .dashboard-stat .display-4 {
        font-size: 1.8rem !important;
    }
    
    /* 侧边导航变底部导航 */
    .user-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff;
        border-top: 1px solid #dee2e6;
        padding: 8px 0;
        display: flex;
        justify-content: space-around;
    }
    .user-sidebar .nav-link {
        flex-direction: column;
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    .user-sidebar .nav-link i {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    
    /* 内容区域留出底部空间 */
    .user-content {
        padding-bottom: 70px;
    }
}

/* ========== 购买页面手机适配 ========== */
@media (max-width: 575.98px) {
    #pricing .card {
        margin-bottom: 1rem;
    }
    #pricing .card .display-5 {
        font-size: 1.8rem !important;
    }
    #pricing .card ul {
        font-size: 0.9rem;
    }
}
