/* 移动端响应式样式 - 适配手机屏幕 */

/* ============================
   全局移动端优化
   ============================ */
@media (max-width: 768px) {
    /* 强制禁止缩放和页面放大 */
    * {
        max-width: 100vw !important;
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
    }

    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        font-size: 14px !important;
        -webkit-text-size-adjust: 100% !important;
        -webkit-font-smoothing: antialiased !important;
    }

    img, video, iframe, embed, object {
        max-width: 100% !important;
        height: auto !important;
    }

    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
    }
}

/* ============================
   手机端（宽度小于768px）
   ============================ */
@media (max-width: 768px) {

    /* ---- 导航栏：单行，汉堡菜单 ---- */
    .navbar {
        flex-direction: row !important;
        padding: 0 12px !important;
        height: 56px !important;
        min-height: 56px !important;
        align-items: center !important;
        justify-content: space-between !important;
        position: fixed !important;
    }

    /* 品牌logo */
    .nav-brand {
        flex-shrink: 0;
        gap: 6px;
        font-size: 1rem !important;
    }

    .nav-brand span {
        font-size: 1rem !important;
    }

    .platform-logo {
        height: 24px !important;
    }

    /* 导航链接在移动端隐藏，通过抽屉菜单访问 */
    .nav-links {
        display: none !important;
    }

    /* 地区选择器在移动端隐藏，通过抽屉菜单访问 */
    .nav-location {
        display: none !important;
    }

    /* 汉堡菜单按钮 */
    .hamburger-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .hamburger-btn span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--primary);
        border-radius: 2px;
        transition: all 0.3s;
    }

    /* 移动端抽屉菜单 */
    .mobile-drawer {
        display: block !important;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .mobile-drawer.open {
        opacity: 1;
        pointer-events: all;
    }

    .mobile-drawer-inner {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 0 0 16px 16px;
        padding: 12px 16px 20px;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    }

    .mobile-drawer.open .mobile-drawer-inner {
        transform: translateY(0);
    }

    /* 抽屉内导航链接 */
    .mobile-nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }

    .mobile-nav-links a {
        text-decoration: none;
        color: var(--gray);
        font-weight: 600;
        padding: 8px 14px;
        border-radius: 20px;
        font-size: 0.9rem;
        background: rgba(255,107,53,0.06);
        border: 1px solid rgba(255,107,53,0.15);
        transition: all 0.2s;
    }

    .mobile-nav-links a.active,
    .mobile-nav-links a:active {
        background: var(--primary-gradient);
        color: white;
        border-color: transparent;
    }

    /* 抽屉内登录注册按钮 */
    .mobile-auth-buttons {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(0,0,0,0.08);
    }

    .mobile-auth-buttons .nav-login,
    .mobile-auth-buttons .nav-register {
        flex: 1;
        text-align: center;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* 抽屉内地区选择器 */
    .mobile-location-row {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 10px;
        background: rgba(255,107,53,0.06);
        border-radius: 10px;
        border: 1px solid rgba(255,107,53,0.15);
    }

    .mobile-location-row .location-icon {
        color: var(--primary);
        font-size: 1rem;
        flex-shrink: 0;
    }

    .mobile-location-row select {
        flex: 1;
        background: transparent;
        border: none;
        color: var(--primary);
        font-weight: 600;
        font-size: 0.85rem;
        outline: none;
        cursor: pointer;
    }

    /* ---- 主内容区顶部距离（只有一行导航） ---- */
    #app {
        margin-top: 56px !important;
        padding: 0 12px !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* 首页 page 顶部留出间距，防止Hero标题被遮挡 */
    .page {
        padding-top: 16px !important;
    }

    /* ---- Hero区域 ---- */
    .hero {
        padding: 28px 16px !important;
        margin-top: 0 !important;
        border-radius: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero h1 {
        font-size: 1.4rem !important;
        letter-spacing: 0 !important;
        margin-bottom: 8px !important;
        position: relative !important;
        z-index: 2 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .hero p,
    .hero .subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 16px !important;
        position: relative !important;
        z-index: 2 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 0.95 !important;
    }

    .hero .search-box {
        position: relative !important;
        z-index: 2 !important;
    }

    .search-box {
        max-width: 100% !important;
    }

    .search-box input {
        padding: 14px 16px !important;
        font-size: 0.9rem !important;
    }

    .search-box button {
        width: 52px !important;
        font-size: 1.2rem !important;
    }

    /* ---- 卡片网格 ---- */
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .category-card {
        padding: 16px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .category-card h3 {
        font-size: 0.95rem !important;
    }

    .category-card p {
        font-size: 0.78rem !important;
    }

    .card-icon {
        font-size: 1.8rem !important;
        margin-bottom: 8px !important;
    }

    /* 分类卡片图标 */
    .category-card .icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.5rem !important;
        margin-bottom: 12px !important;
    }

    .category-card span {
        font-size: 0.95rem !important;
    }

    .category-card small {
        font-size: 0.75rem !important;
    }

    /* ---- 分类标题 ---- */
    .categories h2 {
        font-size: 1.1rem !important;
        padding: 12px 0 8px !important;
    }

    .categories {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ---- 威海文旅横幅 ---- */
    #tourism-page > div:first-child {
        padding: 25px 15px !important;
    }

    #tourism-page > div:first-child h1 {
        font-size: 1.5rem !important;
        margin-bottom: 10px !important;
    }

    #tourism-page > div:first-child p {
        font-size: 0.9rem !important;
        margin-bottom: 15px !important;
    }

    #tourism-page > div:first-child > div > span {
        padding: 5px 12px !important;
        font-size: 0.8rem !important;
        border-radius: 12px !important;
    }

    /* ---- 威海简介卡片 ---- */
    #tourism-page > div[style*="margin:20px"] {
        margin: 15px 0 30px !important;
        padding: 20px !important;
    }

    #tourism-page > div[style*="margin:20px"] h2 {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
    }

    #tourism-page > div[style*="margin:20px"] p {
        font-size: 0.9rem !important;
    }

    /* ---- 标签网格 ---- */
    .tag-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* ---- 平台使命 ---- */
    .mission-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .mission-card {
        padding: 14px 12px !important;
    }

    .mission-card h4 {
        font-size: 0.95rem !important;
    }

    .mission-card p {
        font-size: 0.8rem !important;
    }

    /* ---- 活动横幅 ---- */
    .activity-banner {
        padding: 12px 14px !important;
    }

    .activity-banner p {
        font-size: 0.8rem !important;
    }

    /* ---- 页脚 ---- */
    footer {
        padding: 24px 16px !important;
    }

    footer h4 {
        font-size: 1rem !important;
    }

    footer p {
        font-size: 0.82rem !important;
    }

    /* ---- 登录注册页面 ---- */
    .auth-container {
        flex-direction: column !important;
        padding: 16px !important;
    }

    .auth-left {
        display: none !important;
    }

    .auth-right {
        width: 100% !important;
        padding: 0 !important;
    }

    .auth-form {
        padding: 20px 16px !important;
    }

    /* ---- 平台理念 & 平台核心价值观：统一横排样式 ---- */
    .platform-concept,
    .core-values-section {
        margin: 30px 12px !important;
        padding: 24px 16px !important;
    }

    .platform-concept h2,
    .core-values-section h2 {
        font-size: 1.3rem !important;
        margin-bottom: 20px !important;
    }

    .platform-concept > div,
    .core-values-section > div:not(:first-child):not(.core-values-grid) {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    .platform-concept > div > div,
    .core-values-section > div > div {
        padding: 16px 10px !important;
        border-radius: 12px !important;
        text-align: center !important;
    }

    .platform-concept > div > div > div:first-child,
    .core-values-section > div > div > div:first-child {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.3rem !important;
        border-radius: 10px !important;
        margin: 0 auto 10px auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .platform-concept > div > div h3,
    .core-values-section > div > div h3 {
        font-size: 0.9rem !important;
        margin-bottom: 8px !important;
    }

    .platform-concept > div > div > div > p,
    .core-values-section > div > div > div > p {
        font-size: 0.72rem !important;
    }

    .platform-concept > div > div p:last-child,
    .core-values-section > div > div p:last-child {
        font-size: 0.78rem !important;
        line-height: 1.5 !important;
    }
}

/* ============================
   平板端（宽度769px-1024px）
   ============================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .hero h1 {
        font-size: 3rem !important;
    }

    .hero p {
        font-size: 1.3rem !important;
    }

    /* 隐藏汉堡菜单 */
    .hamburger-btn {
        display: none !important;
    }

    .mobile-drawer {
        display: none !important;
    }
}
