/* ========================================
   知辰在线工具网 - 通用移动端响应式样式
   适用于所有子页面
   ======================================== */

/* ========================================
   子页面通用布局调整
   ======================================== */

/* 平板设备 (1024px及以下) */
@media (max-width: 1024px) {
    /* 页面容器 */
    .copyright-container,
    .beian-container,
    .page-container {
        max-width: 95%;
        padding: 40px 30px;
        margin: 20px auto;
    }
    
    /* 标题调整 */
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 1.8rem !important;
    }
    
    h3 {
        font-size: 1.4rem !important;
    }
    
    /* 内容区域 */
    .section {
        margin-bottom: 30px;
    }
    
    /* 卡片布局 */
    .contact-card,
    .info-card {
        padding: 25px;
    }
}

/* 手机设备 (768px及以下) */
@media (max-width: 768px) {
    /* 页面基础样式 */
    body {
        padding: 20px 12px !important;
    }
    
    /* 页面容器 */
    .copyright-container,
    .beian-container,
    .page-container {
        padding: 30px 20px;
        border-radius: 16px;
        margin: 10px auto;
    }
    
    /* 页面头部 */
    .copyright-header,
    .page-header {
        margin-bottom: 35px;
        padding-bottom: 25px;
    }
    
    /* 标题大小 */
    .copyright-header h1,
    .page-header h1 {
        font-size: 2rem !important;
        margin-bottom: 16px;
    }
    
    .copyright-header .subtitle,
    .page-header .subtitle {
        font-size: 1rem !important;
        line-height: 1.6;
    }
    
    .section-title,
    h2 {
        font-size: 1.5rem !important;
        margin-bottom: 16px;
    }
    
    .section-subtitle,
    h3 {
        font-size: 1.2rem !important;
        margin-bottom: 12px;
    }
    
    /* 段落文字 */
    p, li {
        font-size: 0.95rem !important;
        line-height: 1.7;
    }
    
    /* 列表 */
    ul, ol {
        padding-left: 24px;
    }
    
    li {
        margin-bottom: 10px;
    }
    
    /* 内容区块 */
    .section {
        margin-bottom: 30px;
    }
    
    /* 图标 */
    .icon,
    .section-icon {
        font-size: 2rem !important;
        margin-bottom: 12px;
    }
    
    /* 卡片样式 */
    .contact-card,
    .info-card,
    .feature-box {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .contact-card h3,
    .info-card h3 {
        font-size: 1.1rem !important;
    }
    
    /* 信息项 */
    .info-item {
        padding: 12px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .info-label {
        font-size: 0.9rem !important;
        min-width: auto;
    }
    
    .info-value {
        font-size: 0.95rem !important;
        padding-left: 0;
    }
    
    /* 按钮 */
    .btn,
    .back-btn,
    button {
        padding: 12px 24px;
        font-size: 0.95rem !important;
        width: 100%;
        max-width: 300px;
        margin: 10px auto;
        display: block;
    }
    
    /* 链接 */
    a {
        word-break: break-all;
    }
    
    /* 表格响应式 */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* 网格布局调整 */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    /* 弹性布局调整 */
    .flex-row {
        flex-direction: column;
        gap: 12px;
    }
    
    /* 警告框 */
    .alert,
    .warning-box {
        padding: 16px;
        font-size: 0.9rem !important;
        margin: 16px 0;
    }
    
    /* 引用块 */
    blockquote {
        padding: 16px;
        margin: 16px 0;
        font-size: 0.95rem !important;
    }
    
    /* 代码块 */
    pre, code {
        font-size: 0.85rem !important;
        padding: 12px;
        overflow-x: auto;
    }
    
    /* 图片响应式 */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    /* 视频响应式 */
    iframe,
    video {
        max-width: 100%;
        height: auto;
    }
}

/* 小屏手机设备 (480px及以下) */
@media (max-width: 480px) {
    /* 极简模式 */
    body {
        padding: 16px 8px !important;
    }
    
    .copyright-container,
    .beian-container,
    .page-container {
        padding: 24px 16px;
        border-radius: 12px;
    }
    
    .copyright-header,
    .page-header {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }
    
    .copyright-header h1,
    .page-header h1 {
        font-size: 1.6rem !important;
        margin-bottom: 12px;
    }
    
    .copyright-header .subtitle,
    .page-header .subtitle {
        font-size: 0.9rem !important;
    }
    
    .section-title,
    h2 {
        font-size: 1.3rem !important;
        margin-bottom: 12px;
    }
    
    .section-subtitle,
    h3 {
        font-size: 1.1rem !important;
        margin-bottom: 10px;
    }
    
    p, li {
        font-size: 0.9rem !important;
        line-height: 1.6;
    }
    
    .contact-card,
    .info-card {
        padding: 16px;
    }
    
    .icon,
    .section-icon {
        font-size: 1.8rem !important;
    }
    
    .btn,
    .back-btn,
    button {
        padding: 10px 20px;
        font-size: 0.9rem !important;
    }
}

/* ========================================
   触摸优化
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    a, button, .clickable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 移除hover效果 */
    *:hover {
        transition: none;
    }
    
    /* 添加触摸反馈 */
    a:active,
    button:active,
    .clickable:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* ========================================
   字体大小调整（提升可读性）
   ======================================== */
@media (max-width: 768px) {
    /* 基础字体大小 */
    html {
        font-size: 15px;
    }
    
    /* 确保最小字体大小 */
    * {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

/* ========================================
   横屏优化
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .copyright-container,
    .beian-container,
    .page-container {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .copyright-header,
    .page-header {
        padding-bottom: 16px;
        margin-bottom: 24px;
    }
    
    .section {
        margin-bottom: 20px;
    }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .copyright-container,
    .beian-container,
    .page-container {
        border: 1px solid #000;
        box-shadow: none;
        padding: 20px;
    }
    
    /* 隐藏导航和按钮 */
    .back-btn,
    .nav,
    .menu {
        display: none !important;
    }
}

/* ========================================
   辅助功能优化
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   深色模式适配（如果页面支持）
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* 自动适配深色模式的设备 */
    /* 已有深色主题，无需额外调整 */
}

/* ========================================
   防止内容溢出
   ======================================== */
@media (max-width: 768px) {
    * {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* 长链接换行 */
    a[href^="http"],
    a[href^="https"] {
        word-break: break-all;
    }
    
    /* 防止表格溢出 */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 防止代码溢出 */
    pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
