/* ========================================
   知辰在线工具网 - 移动端响应式样式
   在不改变PC端样式的基础上添加移动端自适应
   ======================================== */

/* ========================================
   移动端菜单按钮（仅在移动端显示）
   ======================================== */
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: rgba(0, 198, 255, 0.1);
    border: 1px solid rgba(0, 198, 255, 0.3);
    border-radius: 8px;
    color: var(--accent);
    font-size: 24px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1001;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* 移动端侧边栏菜单 */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(15, 28, 63, 0.98);
    backdrop-filter: blur(30px);
    border-right: 1px solid rgba(0, 198, 255, 0.3);
    z-index: 1100;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding: 80px 20px 20px;
}

.mobile-sidebar.open {
    left: 0;
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.mobile-nav-link:active {
    background: rgba(0, 198, 255, 0.2);
    color: var(--accent);
}

/* ========================================
   平板设备 (1024px及以下)
   ======================================== */
@media (max-width: 1024px) {
    /* 导航栏调整 */
    .nav-container {
        padding: 0 24px;
    }
    
    /* 隐藏PC端导航菜单，显示移动端按钮 */
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Logo适配 */
    .logo-icon {
        font-size: 36px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .logo-subtitle {
        font-size: 9px;
    }
    
    /* 状态栏适配 */
    .status-container {
        gap: 16px;
        font-size: 12px;
        padding: 0 24px;
    }
    
    .status-label {
        display: none;
    }
    
    .status-value {
        min-width: 45px;
        font-size: 13px;
    }
    
    /* Hero区域适配 */
    .hero {
        padding: calc(var(--header-height) + 45px + 40px) 24px 40px;
    }
    
    .hero-title {
        font-size: 52px;
    }
    
    .hero-slogan {
        font-size: 20px;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .stat-number {
        font-size: 40px;
    }
    
    /* 搜索框适配 */
    .search-box {
        max-width: 600px;
    }
    
    .search-suggestions {
        width: 600px;
    }
    
    /* 仪表盘布局 - 移除侧边栏 */
    .dashboard {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    
    .nav-tree,
    .hot-rank {
        display: none;
    }
    
    /* 工具网格适配 */
    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
    
    /* 地球仪隐藏 */
    .globe-container {
        display: none;
    }
    
    /* 资源图谱适配 */
    .resource-map-section {
        padding: 80px 24px 60px;
    }
    
    .section-title {
        font-size: 36px;
    }
    
    .workflow-grid {
        grid-template-columns: 1fr;
    }
    
    /* 特色功能区适配 */
    .features-section {
        padding: 50px 24px;
        margin: 60px auto;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* 底部适配 */
    .footer {
        padding: 50px 24px 30px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* ========================================
   手机设备 (768px及以下)
   ======================================== */
@media (max-width: 768px) {
    /* 导航栏更紧凑 */
    .nav-container {
        padding: 0 16px;
        gap: 12px;
    }
    
    /* Logo进一步缩小 */
    .logo-main {
        gap: 8px;
    }
    
    .logo-icon {
        font-size: 32px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-subtitle {
        font-size: 8px;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 隐藏徽章 */
    .logo-badge {
        display: none;
    }
    
    /* 右侧操作按钮适配 */
    .nav-actions {
        gap: 8px;
    }
    
    .live-stats {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .stat-dot {
        width: 6px;
        height: 6px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .nav-btn span:last-child {
        display: none; /* 只显示图标 */
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    /* 状态栏更紧凑 */
    .status-bar {
        height: 40px;
    }
    
    .status-container {
        gap: 10px;
        padding: 0 16px;
        justify-content: space-around;
    }
    
    .status-icon {
        font-size: 14px;
    }
    
    .status-value {
        font-size: 11px;
        min-width: 35px;
    }
    
    .status-online-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    /* Hero区域手机适配 */
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + 40px + 30px) 16px 40px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-slogan {
        font-size: 16px;
        letter-spacing: 1px;
    }
    
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .stat-divider {
        display: none;
    }
    
    /* 搜索框手机适配 */
    .search-box {
        max-width: 100%;
        border-radius: 30px;
    }
    
    #search-input {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .search-btn {
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .search-icon {
        font-size: 18px;
    }
    
    .search-suggestions {
        width: 100%;
        max-height: 300px;
    }
    
    /* 快速分类标签 */
    .quick-categories {
        gap: 8px;
    }
    
    .quick-label {
        font-size: 13px;
        width: 100%;
        margin-bottom: 4px;
    }
    
    .quick-tag {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    /* 仪表盘手机布局 */
    .dashboard {
        padding: 16px;
        gap: 20px;
    }
    
    /* 工具矩阵适配 */
    .tool-matrix {
        padding: 20px 16px;
    }
    
    .matrix-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .matrix-filters {
        width: 100%;
        overflow-x: auto;
        display: flex;
        gap: 8px;
        padding-bottom: 8px;
    }
    
    .filter-btn {
        padding: 6px 16px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 工具卡片手机适配 */
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tool-card {
        padding: 18px;
    }
    
    .tool-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    
    .tool-name {
        font-size: 15px;
    }
    
    .tool-desc {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
    
    .tool-tags {
        gap: 6px;
    }
    
    .tool-tag {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    /* 加载更多按钮 */
    .load-more-btn {
        width: 100%;
        padding: 12px 40px;
        font-size: 15px;
    }
    
    /* 资源图谱手机适配 */
    .resource-map-section {
        padding: 60px 16px 40px;
        margin-top: 110px;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
    
    .map-tabs {
        gap: 6px;
        padding: 0 4px;
    }
    
    .map-tab {
        padding: 8px 16px;
        font-size: 13px;
        flex: 1;
        text-align: center;
        min-width: 70px;
    }
    
    /* 工作流卡片手机适配 */
    .workflow-card {
        padding: 20px;
    }
    
    .workflow-icon {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
    
    .workflow-card h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .workflow-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .workflow-step {
        flex-direction: row;
        min-width: auto;
        width: 100%;
        padding: 10px;
    }
    
    .workflow-arrow {
        transform: rotate(90deg);
        font-size: 16px;
        align-self: center;
    }
    
    .step-tool {
        font-size: 13px;
        text-align: left;
        flex: 1;
    }
    
    .use-workflow-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    /* 技术栈手机适配 */
    .tech-stack-grid {
        gap: 20px;
    }
    
    .tech-stack-card {
        padding: 20px;
    }
    
    .tech-stack-card h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .tech-items {
        gap: 8px;
    }
    
    .tech-item {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    /* 特色功能区手机适配 */
    .features-section {
        padding: 40px 16px;
        margin: 40px auto;
    }
    
    .features-section .section-title {
        font-size: 28px;
        margin-bottom: 40px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .feature-icon {
        font-size: 40px;
        margin-bottom: 16px;
    }
    
    .feature-card h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .feature-card p {
        font-size: 13px;
    }
    
    /* 底部手机适配 */
    .footer {
        padding: 40px 16px 24px;
        margin-top: 60px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 30px;
    }
    
    .footer-section h4 {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 13px;
        line-height: 1.8;
    }
    
    .footer-bottom {
        padding-top: 30px;
    }
    
    .copyright-info p {
        font-size: 12px;
        line-height: 1.6;
    }
    
    .copyright-info strong {
        font-size: 13px;
    }
    
    /* 返回顶部按钮手机适配 */
    .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
        font-size: 20px;
    }
}

/* ========================================
   小屏手机设备 (480px及以下)
   ======================================== */
@media (max-width: 480px) {
    /* 导航栏极简模式 */
    .nav-container {
        padding: 0 12px;
    }
    
    .logo-subtitle {
        display: none;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .logo-icon {
        font-size: 28px;
    }
    
    .live-stats {
        display: none;
    }
    
    .nav-btn#favorites-btn {
        display: none;
    }
    
    /* 状态栏简化 */
    .status-item:nth-child(n+4) {
        display: none; /* 只显示前3项 */
    }
    
    .status-divider:nth-child(n+6) {
        display: none;
    }
    
    /* Hero区域极简 */
    .hero {
        padding: calc(var(--header-height) + 40px + 20px) 12px 30px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-slogan {
        font-size: 14px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    /* 搜索框极简 */
    #search-input {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .search-btn span:last-child {
        display: none; /* 只显示图标 */
    }
    
    /* 快速标签换行 */
    .quick-tag {
        font-size: 12px;
        padding: 5px 12px;
    }
    
    /* 仪表盘极简 */
    .dashboard {
        padding: 12px;
    }
    
    .tool-matrix {
        padding: 16px 12px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    /* 工具卡片极简 */
    .tool-card {
        padding: 16px;
    }
    
    .tool-card-header {
        gap: 12px;
    }
    
    .tool-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .tool-name {
        font-size: 14px;
    }
    
    .tool-category {
        font-size: 11px;
    }
    
    .tool-desc {
        font-size: 12px;
    }
    
    /* 资源图谱极简 */
    .resource-map-section {
        padding: 50px 12px 30px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-subtitle {
        font-size: 13px;
    }
    
    .map-tab {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .workflow-card,
    .tech-stack-card {
        padding: 16px;
    }
    
    .workflow-card h3,
    .tech-stack-card h3 {
        font-size: 16px;
    }
    
    /* 特色功能极简 */
    .features-section {
        padding: 30px 12px;
    }
    
    .features-section .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .feature-card {
        padding: 24px 16px;
    }
    
    .feature-icon {
        font-size: 36px;
    }
    
    .feature-card h3 {
        font-size: 16px;
    }
    
    .feature-card p {
        font-size: 12px;
    }
    
    /* 底部极简 */
    .footer {
        padding: 30px 12px 20px;
    }
    
    .footer-content {
        gap: 24px;
    }
    
    .footer-section h4 {
        font-size: 15px;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 12px;
    }
    
    .copyright-info p {
        font-size: 11px;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
        font-size: 18px;
    }
}

/* ========================================
   横屏模式适配
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + 40px + 20px) 16px 30px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
}

/* ========================================
   触摸设备优化
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* 增大可点击区域 */
    .nav-link,
    .mobile-nav-link,
    .filter-btn,
    .tool-card,
    .quick-tag {
        min-height: 44px;
    }
    
    /* 移除悬停效果，使用点击反馈 */
    .tool-card:hover {
        transform: none;
    }
    
    .tool-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .nav-link:hover,
    .filter-btn:hover,
    .quick-tag:hover {
        background: initial;
    }
    
    .nav-link:active,
    .filter-btn:active,
    .quick-tag:active {
        background: rgba(0, 198, 255, 0.2);
    }
    
    /* 隐藏滚动条 */
    .workflow-steps::-webkit-scrollbar,
    .matrix-filters::-webkit-scrollbar {
        display: none;
    }
}

/* ========================================
   加载动画优化（移动端）
   ======================================== */
@media (max-width: 768px) {
    /* 减少动画，提升性能 */
    .tool-card::before,
    .logo-icon {
        animation: none;
    }
    
    /* 简化过渡效果 */
    * {
        transition-duration: 0.2s !important;
    }
}

/* ========================================
   防止内容溢出
   ======================================== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
}
