/* 移动端响应式CSS - 适用于所有测试页面 */

/* 通用触摸优化 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 通用按钮触摸优化 */
button, input[type="button"], input[type="submit"], 
.btn, .template-button, .copy-button {
    touch-action: manipulation;
    min-height: 44px;
    cursor: pointer;
}

/* 防止iOS safari缩放 */
input[type="text"], input[type="password"], 
input[type="email"], input[type="tel"], 
textarea, select {
    font-size: 16px;
}

/* 通用表单元素优化 */
input, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 4px;
    box-sizing: border-box;
}

/* 通用按钮状态 */
button:active, .btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* 文本可读性优化 */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 通用间距优化 */
.mobile-spacing {
    margin: 15px auto;
    padding: 0 20px;
}

/* 通用卡片样式优化 */
.card-mobile {
    margin: 10px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 通用容器移动端优化 */
@media screen and (max-width: 768px) {
    /* 主要按钮样式 */
    button:not(.template-button):not(.copy-button) {
        min-width: calc(100% - 20px) !important;
        max-width: 400px !important;
        margin: 8px 10px !important;
        padding: 12px 20px !important;
        font-size: 17px !important;
    }
    
    /* 代码容器 */
    .code-container, .demo, #demo {
        width: calc(100% - 20px) !important;
        margin: 15px 10px !important;
        padding: 15px !important;
        border-radius: 8px !important;
    }
    
    /* 输入框容器 */
    .custom-input-container, .input-container {
        width: calc(100% - 20px) !important;
        margin: 10px 10px !important;
        padding: 0 !important;
    }
    
    /* 输入框 */
    input[type="text"], input[type="password"], 
    textarea, #customInput {
        width: calc(100% - 24px) !important;
        min-height: 44px !important;
        padding: 12px !important;
        margin: 0 !important;
        font-size: 16px !important;
    }
    
    /* 模板按钮容器 */
    .template-buttons {
        width: calc(100% - 20px) !important;
        margin: 10px 10px 15px 10px !important;
    }
    
    /* 结果区域 */
    .results, #signatureResults, .result-area {
        width: calc(100% - 20px) !important;
        margin: 20px 10px !important;
        padding: 15px !important;
    }
    
    /* 头部区域padding调整 */
    ul {
        padding: 40px 0 20px 0 !important;
    }
    
    /* 表格横向滚动 */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media screen and (max-width: 480px) {
    /* 小屏幕按钮样式 */
    button:not(.template-button):not(.copy-button) {
        min-width: calc(100% - 16px) !important;
        margin: 6px 8px !important;
        padding: 14px 16px !important;
        font-size: 16px !important;
    }
    
    /* 小屏幕代码容器 */
    .code-container, .demo, #demo {
        width: calc(100% - 16px) !important;
        margin: 12px 8px !important;
        padding: 12px !important;
        border-radius: 6px !important;
    }
    
    /* 小屏幕输入框容器 */
    .custom-input-container, .input-container {
        width: calc(100% - 16px) !important;
        margin: 8px 8px !important;
    }
    
    /* 小屏幕输入框 */
    input[type="text"], input[type="password"], 
    textarea, #customInput {
        width: calc(100% - 20px) !important;
        padding: 10px !important;
        font-size: 15px !important;
    }
    
    /* 小屏幕模板按钮 */
    .template-buttons {
        width: calc(100% - 16px) !important;
        margin: 8px 8px 12px 8px !important;
    }
    
    .template-button {
        flex: 1 1 calc(50% - 6px) !important;
        max-width: calc(50% - 6px) !important;
        margin: 3px !important;
        padding: 12px 8px !important;
        font-size: 14px !important;
        min-height: 42px !important;
    }
    
    /* 小屏幕结果区域 */
    .results, #signatureResults, .result-area {
        width: calc(100% - 16px) !important;
        margin: 15px 8px !important;
        padding: 12px !important;
    }
    
    /* 小屏幕头部padding */
    ul {
        padding: 30px 0 15px 0 !important;
    }
    
    /* 复制按钮 */
    .copy-button {
        padding: 4px 8px !important;
        font-size: 11px !important;
        min-height: 32px !important;
    }
    
    /* 结果容器 */
    .result-container {
        margin-bottom: 15px !important;
        padding: 12px !important;
    }
    
    /* 文字大小调整 */
    .result-title {
        font-size: 14px !important;
    }
    
    .result-value {
        font-size: 12px !important;
        padding: 8px !important;
    }
}

/* 横屏优化 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    ul {
        padding: 20px 0 10px 0 !important;
    }
    
    .i-header, .header {
        padding: 20px 15px !important;
    }
    
    button {
        margin: 4px 8px !important;
        padding: 8px 16px !important;
    }
}

/* 高分辨率屏幕优化 */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    .copy-button, .template-button {
        border: none;
        -webkit-font-smoothing: antialiased;
    }
}