* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --error-color: #e74c3c;
    --text-color: #333;
    --bg-color: #f5f7fa;
    --card-bg: #f8f9fa;
    --border-color: #ddd;
    --success-color: #2ecc71;
    --info-color: #3498db;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding: 15px;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5rem;
    padding-top: 5px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
    width: 100%;
}

input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    height: 50px;
    font-family: inherit;
}

input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

button {
    padding: 0 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    height: 50px;
    font-weight: 500;
    transition: background 0.3s;
    touch-action: manipulation;
}

button:hover {
    background: var(--primary-dark);
}

button:active {
    transform: scale(0.98);
}

.error-message {
    color: var(--error-color);
    margin: 10px 0;
    min-height: 20px;
    font-size: 14px;
    padding: 8px 12px;
    background: rgba(231, 76, 60, 0.08);
    border-radius: 6px;
    display: none;
}

.result-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 18px;
    margin: 18px 0;
    display: none;
}

.result-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.result-item:last-child {
    border-bottom: none;
}

.label {
    font-weight: bold;
    width: 80px;
    color: #2c3e50;
    flex-shrink: 0;
}

.value {
    flex: 1;
    word-break: break-word;
    min-width: 150px;
}

.note {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.5;
}

/* 移动设备优化 */
@media (max-width: 480px) {
    .container {
        padding: 16px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    input, button {
        height: 48px;
        font-size: 15px;
        padding: 0 14px;
    }
    
    .result-item {
        padding: 9px 0;
    }
    
    .label {
        width: 75px;
        font-size: 14px;
    }
    
    .value {
        font-size: 14px;
    }
    
    .note {
        font-size: 12px;
        margin-top: 12px;
    }
    
    /* 增加触摸区域 */
    input, button {
        min-height: 48px;
    }
}

/* 针对超小屏幕（如iPhone SE）进一步优化 */
@media (max-width: 380px) {
    .container {
        padding: 12px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    input, button {
        height: 44px;
        font-size: 14px;
    }
    
    .label {
        width: 70px;
        font-size: 13px;
    }
    
    .value {
        font-size: 13px;
        min-width: 120px;
    }
    
    .note {
        font-size: 11px;
        line-height: 1.4;
    }
}

/* 确保在移动设备上可缩放 */
@media (hover: none) {
    input, button {
        touch-action: manipulation;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-width: 768px) {
    .container {
        max-width: 90%;
    }
}

/* 按钮和输入框的焦点状态优化 - 移动设备友好 */
input:focus, button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* 防止页面在iOS上被"弹性"拉伸 */
html {
    overscroll-behavior-y: contain;
}

/* 优化滚动体验 */
body {
    -webkit-overflow-scrolling: touch;
}

/* 增加点击区域的大小 */
a, button {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* 移动端键盘友好 - 确保输入时页面不会意外缩放 */
input {
    -webkit-text-size-adjust: 100%;
}