/**
 * 政务中心页面 - 响应式样式（优化版）
 * 针对手机端进行全面响应式优化
 */

/* 确保页面可以滚动 */
html, body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 页面容器 - 高度由JavaScript动态控制 */
.politics-page {
    position: relative;
    width: 100%;
    min-height: 800px; /* 默认最小高度，JavaScript会根据状态调整 */
}

/* 确保政务页面可以滚动 */
body .page-wrapper,
body .page-no-header {
    min-height: auto; /* 高度自适应内容 */
    height: auto !important;
    overflow-y: visible !important;
    position: relative !important;
}

body main {
    min-height: auto; /* 高度自适应内容 */
    height: auto;
    overflow: visible;
    position: relative;
    padding-bottom: 100px;
}

/* ==================== 表单输入样式 ==================== */
.politics-page input[type="text"],
.politics-page input[type="tel"],
.politics-page input[type="date"] {
    font-size: 14px;
    outline: none;
}

.politics-page input[type="text"]:focus,
.politics-page input[type="tel"]:focus,
.politics-page input[type="date"]:focus {
    border-bottom-color: #c61f0d;
}

.politics-page button:active {
    opacity: 0.8;
}

.politics-page input[type="radio"] {
    accent-color: #c61f0d;
    cursor: pointer;
}

/* ==================== 响应式支持 ==================== */

/* 超小屏手机 (≤320px) */
@media (max-width: 320px) {
    /* 确保可以滚动 */
    html, body {
        height: auto !important;
        min-height: 100vh !important;
    }
    
    .container {
        min-height: 2300px !important;
        height: auto !important;
    }
    
    .page-wrapper {
        min-height: 2300px !important;
        height: auto !important;
    }
    
    main {
        min-height: 2300px !important;
        padding-bottom: 120px !important;
    }
    
    .politics-page {
        font-size: 0.85em; /* 整体缩小15% */
    }
}

/* 小屏手机 (321px-374px) */
@media (min-width: 321px) and (max-width: 374px) {
    .politics-page {
        font-size: 0.92em; /* 整体缩小8% */
    }
}

/* 标准屏幕 (375px) - 保持原始设计 */
@media (min-width: 375px) and (max-width: 413px) {
    .politics-page {
        max-width: 375px;
        margin: 0 auto;
    }
}

/* 大屏手机 (414px+) - 居中显示 */
@media (min-width: 414px) {
    .politics-page {
        max-width: 375px;
        margin: 0 auto;
    }
}

/* 平板竖屏 (768px+) */
@media (min-width: 768px) {
    .politics-page {
        max-width: 375px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
}

/* 桌面 (1024px+) */
@media (min-width: 1024px) {
    .politics-page {
        max-width: 375px;
        margin: 0 auto;
    }
}

/* 横屏优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .politics-page {
        padding-top: 10px;
    }
    
    /* 减小表单间距 */
    .politics-page > div[style*="background:white"] {
        margin-top: -10px;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .politics-page button,
    .politics-page input {
        -webkit-tap-highlight-color: rgba(198, 31, 13, 0.1);
    }
    
    .politics-page button:active {
        transform: scale(0.98);
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .politics-page img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .politics-page button,
    .politics-page input {
        transition: none;
    }
    
    * {
        scroll-behavior: auto !important;
    }
}

/* ==================== 按钮样式优化 ==================== */
.politics-page button {
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.politics-page button:hover {
    opacity: 0.9;
}

/* ==================== 表单优化 ==================== */
.politics-page input[type="radio"] {
    min-width: 16px;
    min-height: 16px;
    margin: 0 5px;
}

/* 表单容器优化 */
.politics-page > div[style*="background:white"] {
    transition: box-shadow 0.3s;
}

.politics-page > div[style*="background:white"]:focus-within {
    box-shadow: 0px 2px 8px 0px rgba(198,31,13,0.2) !important;
}
