/**
 * 侠梦网 - 移动端样式
 * 适配移动设备（<= 768px）
 */

@media (max-width: 768px) {

    /* GGB容器移动端响应式适配 */
    .md-ggb-container {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 4 / 3 !important;
        margin: 12px auto !important;
        border-radius: 8px;
        overflow: hidden;
    }
}
@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
    }

    .nav {
        gap: 16px;
    }

    .nav a {
        font-size: 14px;
    }

    .main {
        padding: 20px 16px;
    }

    /* 文章页面响应式优化 */
    .breadcrumb {
        font-size: 13px;
        margin-bottom: 16px;
        flex-wrap: wrap;
        gap: 4px;
    }

    .breadcrumb .sep {
        margin: 0 2px;
    }

    .article-content {
        scroll-behavior: auto;
    }

    .article-header {
        margin-bottom: 24px;
    }

    .article-header h1 {
        font-size: 22px;
        line-height: 1.35;
        margin-bottom: 10px;
        word-break: break-word;
    }

    .article-header .meta {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 13px;
    }

    .share-bar {
        justify-content: center;
        margin: 20px 0;
        gap: 10px;
    }

    .share-btn {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .preview-login-tip {
        padding: 32px 20px;
        margin-top: -80px;
    }

    .preview-login-tip p {
        font-size: 15px;
        margin-bottom: 16px;
    }

    /* VIP功能区域响应式 */
    .note-input-area {
        padding: 0 4px;
    }

    .note-input-area h3 {
        font-size: 15px !important;
        margin-bottom: 10px !important;
    }

    .note-textarea {
        min-height: 100px;
        font-size: 14px;
        padding: 12px;
    }

    .note-char-count {
        font-size: 12px;
    }
    .mt-24[style*="padding"] {
        padding: 12px !important;
        margin-top: 16px !important;
    }

    .mt-24[style*="padding"] h3 {
        font-size: 15px !important;
        margin-bottom: 6px !important;
    }

    .mt-24[style*="padding"] p {
        font-size: 12px !important;
        margin-bottom: 10px !important;
    }

    /* 笔记列表 */
    .mt-24:not([style]) {
        margin-top: 16px !important;
    }

    .mt-24:not([style]) h3 {
        font-size: 15px !important;
        margin-bottom: 10px !important;
    }

    .mt-24:not([style]) > div[style] {
        padding: 10px !important;
        margin-bottom: 6px !important;
        border-radius: 6px !important;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .user-layout {
        grid-template-columns: 1fr;
    }

    .user-sidebar {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: 100%;
        height: auto;
        z-index: auto;
        overflow-y: visible;
        border-radius: var(--radius);
        transition: none;
        box-shadow: var(--shadow);
        margin-bottom: 20px;
        padding: 20px 16px;
        background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
    }

    .user-sidebar.show {
        left: auto;
        box-shadow: var(--shadow);
    }

    .user-sidebar-overlay {
        display: none !important;
    }

    .mobile-user-menu-btn {
        display: none !important;
    }

    .user-avatar {
        width: 64px;
        height: 64px;
        font-size: 24px;
        margin: 0 auto 10px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: #fff;
        box-shadow: 0 4px 12px rgba(22, 119, 255, 0.25);
    }

    .user-name {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 6px;
        color: var(--text);
    }

    .user-vip-status {
        margin-bottom: 20px;
    }

    .user-menu {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px 12px;
        list-style: none;
    }

    .user-menu li {
        margin-bottom: 0;
    }

    .user-menu a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 14px 6px 10px;
        border-radius: 16px;
        text-decoration: none;
        color: var(--text);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
        gap: 8px;
        border: 1px solid transparent;
        min-height: 80px;
    }

    .user-menu a:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        border-color: rgba(22, 119, 255, 0.2);
    }

    .user-menu a.active {
        background: linear-gradient(135deg, var(--primary-light) 0%, #e8f0fe 100%);
        color: var(--primary);
        font-weight: 600;
        box-shadow: 0 4px 16px rgba(22, 119, 255, 0.15);
        border-color: var(--primary);
    }

    .menu-icon {
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 0;
        stroke: var(--primary);
        fill: none;
        flex-shrink: 0;
        filter: none;
        transition: all 0.3s ease;
    }

    .user-menu a:hover .menu-icon {
        transform: scale(1.1);
        stroke: var(--primary-dark);
    }

    .user-menu li:nth-child(1) .menu-icon { background: none; }
    .user-menu li:nth-child(2) .menu-icon { background: none; }
    .user-menu li:nth-child(3) .menu-icon { background: none; }
    .user-menu li:nth-child(4) .menu-icon { background: none; }
    .user-menu li:nth-child(5) .menu-icon { background: none; }
    .user-menu li:nth-child(6) .menu-icon { background: none; }
    .user-menu li:nth-child(7) .menu-icon { background: none; }
    .user-menu li:nth-child(8) .menu-icon { background: none; }

    .menu-text {
        font-size: 13px;
        text-align: center;
        line-height: 1.3;
        word-break: keep-all;
        font-weight: 500;
        letter-spacing: -0.2px;
    }

    .mobile-badge {
        position: absolute;
        top: 6px;
        right: 50%;
        transform: translateX(calc(50% + 18px));
        background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%) !important;
        color: #fff !important;
        font-size: 10px !important;
        min-width: 18px;
        height: 18px;
        line-height: 18px;
        padding: 0 5px !important;
        border-radius: 9px !important;
        text-align: center;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(255, 77, 79, 0.4);
        animation: badge-pulse 2s ease-in-out infinite;
    }

    @keyframes badge-pulse {
        0%, 100% { transform: translateX(calc(50% + 18px)) scale(1); }
        50% { transform: translateX(calc(50% + 18px)) scale(1.1); }
    }

    .hide-mobile {
        display: none !important;
    }

    .user-content {
        padding: 16px;
    }

    .user-avatar {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .user-name {
        font-size: 15px;
    }

    /* 日历组件移动端优化 */
    .checkin-calendar {
        margin: 0 -8px;
        padding: 10px;
    }

    .calendar-header {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
        margin-bottom: 8px;
    }

    .calendar-grid {
        gap: 1px;
    }

    .calendar-cell {
        font-size: 12px;
        aspect-ratio: 1;
    }

    .calendar-cell.checked::after {
        bottom: 2px;
        width: 4px;
        height: 4px;
    }

    .calendar-cell.header {
        font-size: 10px;
    }

    /* 卡片和列表优化 */
    .card {
        margin-bottom: 16px;
    }

    .grid-2 {
        gap: 12px;
    }

    /* 表单优化 */
    .form-group {
        margin-bottom: 16px;
    }

    /* 空状态优化 */
    .empty {
        padding: 32px 16px;
    }

    /* 标签和徽章 */
    .tag {
        display: inline-block;
        padding: 4px 10px;
        font-size: 12px;
    }

    /* 按钮组优化 */
    .btn-lg {
        width: 100%;
        text-align: center;
    }

    /* 弹窗/模态框优化 */
    .detail-content {
        width: 95%;
        max-height: 85vh;
        padding: 20px;
        margin: 20px auto;
    }

    /* 通知项优化 */
    .notification-item {
        padding: 14px 12px;
    }

    .notification-item .title {
        font-size: 14px;
    }

    .notification-item .content {
        font-size: 13px;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 代金券卡片优化 */
    .coupon-card {
        padding: 14px;
    }

    .coupon-money {
        width: 70px;
        height: 70px;
    }

    .coupon-money .amount {
        font-size: 22px;
    }

    /* 笔记卡片优化 */
    #note-\\w+ {
        padding: 14px !important;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .auth-box {
        padding: 24px;
    }

    .vip-hero {
        padding: 60px 16px 40px;
    }

    .vip-hero h1 {
        font-size: 24px;
    }

    .vip-hero .vip-price-display {
        font-size: 36px;
    }

    .article-nav {
        flex-direction: column;
    }

    .article-nav-item.next {
        text-align: left;
    }

    .form-row {
        flex-direction: column;
    }

    .search-box {
        max-width: 100%;
    }

    /* 移动端：原有顶部目录已移除，改为悬浮按钮+右侧面板（样式在 max-width:1024px 中定义） */

    .modal {
        max-width: 100%;
    }

    .vip-features {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        color: #fff;
    }

    /* 个人中心页面：日间模式下汉堡菜单改为黑色 */
    :not([data-theme="dark"]):has(.user-layout) .mobile-menu-btn {
        color: var(--text);
    }

    /* 文章页面：日间模式下汉堡菜单改为黑色 */
    :not([data-theme="dark"]):has(.article-layout) .mobile-menu-btn {
        color: var(--text);
    }

    /* 专栏页面：日间模式下汉堡菜单改为黑色 */
    :not([data-theme="dark"]):has(.column-container) .mobile-menu-btn {
        color: var(--text);
    }

    /* 黑暗模式：移动端用户菜单保持主题色 */
    [data-theme="dark"] .user-menu a {
        background: var(--bg-card);
        color: var(--text);
        border-color: var(--border);
    }

    [data-theme="dark"] .user-menu a.active {
        background: var(--primary-light);
        color: var(--primary);
        border-color: var(--primary);
    }

    [data-theme="dark"] .menu-icon {
        stroke: var(--primary);
    }

    .nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .nav.show {
        display: flex;
    }

    .nav a {
        padding: 10px 0;
    }
}
@media screen and (max-width: 768px) {

    /* 标题自适应 */
    .article-content {
        font-size: 18px;
        line-height: 1.8;
        padding: 0 8px;
    }

    .article-content h1 {
        font-size: 1.65em;
        letter-spacing: -0.02em;
    }

    .article-content h2 {
        font-size: 1.45em;
        padding-left: 14px;
        margin-top: 1.6em;
    }

    .article-content h3 {
        font-size: 1.25em;
        padding-left: 12px;
        margin-top: 1.5em;
    }

    .article-content h4 { font-size: 1.12em; }
    .article-content h5 { font-size: 1.05em; }
    .article-content h6 { font-size: 0.95em; }

    /* 代码块移动端优化 */
    .article-content pre {
        padding: 16px 14px 16px 48px;
        font-size: 12.5px;
        line-height: 1.7;
        border-radius: 0 0 8px 8px;
    }

    .article-content .line-num {
        left: -42px;
        width: 36px;
        font-size: 11px;
        padding-right: 10px;
    }

    .article-content .code-block {
        margin: 1.6em 0;
        border-radius: 8px;
    }

    .article-content .code-block:hover {
        transform: none;
    }

    .article-content .code-header {
        padding: 10px 14px;
    }

    .article-content .code-lang {
        font-size: 10.5px;
    }

    /* 引用块 */
    .article-content blockquote {
        padding: 16px 18px 16px 14px;
        margin: 1.3em 0;
        border-radius: 0 8px 8px 0;
    }

    /* 表格横向滚动 */
    .article-content table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    .article-content th,
    .article-content td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    /* 图片优化 */
    .article-content img {
        border-radius: 10px;
        margin: 1.5em auto 1.2em;
    }

    .article-content img:hover {
        transform: scale(1.01);
    }

    /* 列表 */
    .article-content ul,
    .article-content ol {
        padding-left: 1.4em;
        margin: 1.2em 0;
    }

    /* 隐藏非必要元素 */
    .heading-anchor {
        display: none !important;
    }

    /* 小屏幕：原有目录折叠面板已移除 */
}
@media screen and (max-width: 480px) {
    .article-content {
        font-size: 17px;
        line-height: 1.75;
        padding: 0 4px;
    }

    .article-content h1 { font-size: 1.50em; }
    .article-content h2 { font-size: 1.38em; padding-left: 12px; }
    .article-content h3 { font-size: 1.2em; padding-left: 10px; }
    .article-content h4 { font-size: 1.08em; }

    .article-content pre {
        padding: 14px 12px 14px 44px;
        font-size: 12px;
    }

    .article-content .line-num {
        left: -38px;
        width: 32px;
        font-size: 10.5px;
    }

    .article-content ul,
    .article-content ol {
        padding-left: 1.3em;
    }

    .article-content blockquote {
        padding: 14px 16px 14px 12px;
        border-radius: 0 6px 6px 0;
    }

    .article-content table th,
    .article-content table td {
        padding: 8px 10px;
        font-size: 12.5px;
    }

    .article-content code,
    .article-content :not(pre) > code {
        font-size: 0.84em;
    }

    /* 小屏幕文章页面额外优化 */
    .main {
        padding: 16px 12px;
    }

    .article-header {
        margin-bottom: 20px;
    }

    .article-header h1 {
        font-size: 20px;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    .article-header .meta {
        font-size: 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .share-bar {
        justify-content: center;
        margin: 16px 0;
        gap: 8px;
    }

    .share-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .preview-login-tip {
        padding: 28px 16px;
        margin-top: -60px;
    }

    .preview-login-tip p {
        font-size: 14px;
        margin-bottom: 14px;
    }

    /* VIP功能区域小屏优化 */
    .note-input-area h3 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    .note-textarea {
        min-height: 80px;
        font-size: 13px;
        padding: 10px;
    }

    .note-char-count {
        font-size: 11px;
    }

    .btn-lg {
        padding: 10px 24px;
        font-size: 15px;
    }

    /* VIP功能区域小屏优化 */



    .mt-24[style*="padding"] {
        padding: 10px !important;
        margin-top: 12px !important;
    }

    .mt-24[style*="padding"] h3 {
        font-size: 14px !important;
    }

    .mt-24[style*="padding"] p {
        font-size: 11px !important;
        margin-bottom: 8px !important;
    }

    .mt-24:not([style]) {
        margin-top: 12px !important;
    }

    .mt-24:not([style]) h3 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    .mt-24:not([style]) > div[style] {
        padding: 8px !important;
        margin-bottom: 4px !important;
        border-radius: 4px !important;
    }

    .mt-24:not([style]) > div[style] div[style*="font-size"] {
        font-size: 12px !important;
    }

    .mt-24:not([style]) > div[style] div:last-child {
        font-size: 11px !important;
        margin-top: 2px !important;
    }
}
@media (max-width: 768px) {
    /* 触摸友好的按钮尺寸 */
    .btn {
        min-height: 44px;
        padding: 10px 18px;
    }

    .btn-sm {
        min-height: 36px;
        padding: 6px 14px;
    }

    /* 链接和可点击元素增加触摸区域 */
    .article-nav-item {
        padding: 14px;
        min-height: 48px;
    }

    /* 表单输入框优化 */
    .form-input,
    textarea,
    select {
        font-size: 16px;
        min-height: 44px;
    }

    /* 图片响应式优化 */
    .article-content img {
        max-width: 100%;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    /* 防止内容溢出 */
    .article-content,
    .article-layout > div:first-child {
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* 标签样式优化 */
    .tag {
        font-size: 11px;
        padding: 2px 8px;
    }
}
@media (max-width: 768px) and (orientation: landscape) {
    .article-header h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .preview-login-tip {
        padding: 24px 20px;
        margin-top: -60px;
    }

    .toc {
        max-height: calc(100vh - 80px);
    }
}
@media (max-width: 768px) {
    .logo {
        display: none;
    }

    .hero-section {
        border-radius: 0;
        margin-left: -24px;
        margin-right: -24px;
        width: calc(100% + 48px);
    }

    .hero-content {
        padding: 60px 16px 40px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .hero-search {
        max-width: 100%;
        margin-bottom: 20px;
    }

    .hero-search input {
        padding: 12px 80px 12px 42px;
        font-size: 14px;
    }

    .hero-search .search-btn {
        padding: 6px 16px;
        font-size: 13px;
        right: 4px;
    }

    .hero-vip-btn,
    .hero-vip-badge {
        padding: 8px 20px;
        font-size: 13px;
    }

    .hero-stats {
        gap: 16px;
        padding: 16px 20px;
    }

    .hero-stat-num {
        font-size: 20px;
    }

    .hero-stat-divider {
        height: 28px;
    }

    .column-grid > *,
    .article-grid > * {
        animation-delay: 0s !important;
        animation-duration: 0.3s;
    }
}
@media (max-width: 768px) {
    .column-header {
        flex-direction: column;
    }

    .column-cover {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
}
/* 目录样式已统一移至 article.css */
