/* CSS变量定义 */
:root {
    --bg-color: #F8F5F2;
    --card-bg: #FFFFFF;
    --primary-text: #3D2C1D;
    --secondary-text: #6B5B4B;
    --border-color: #DCDCDC;
    --focus-border: #A08C7D;
    --readonly-bg: #F8F5F2;
    --separator-color: #EAE5E1;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --focus-shadow: rgba(160, 140, 125, 0.2);
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Source Han Sans CN', sans-serif;
    background-color: var(--bg-color);
    min-height: 100vh;
    line-height: 1.6;
}

/* 主容器 - 使用Flexbox居中 */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

/* 计算器卡片 */
.calculator-card {
    background-color: var(--card-bg);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px var(--shadow-color);
    width: 100%;
    max-width: 500px;
}

/* 主标题 */
h1 {
    font-size: 22px;
    color: var(--primary-text);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

/* 输入和输出区域 */
.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 输入组和输出组 */
.input-group,
.output-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 标签样式 */
label {
    font-size: 15px;
    color: var(--secondary-text);
    flex-basis: 120px;
    flex-shrink: 0;
    font-weight: 500;
}

/* 输入框和输出框基础样式 */
input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    color: var(--primary-text);
    font-family: inherit;
    transition: all 0.3s ease-in-out;
    outline: none;
}

/* 输入框焦点效果 */
input[type="number"]:focus {
    border-color: var(--focus-border);
    box-shadow: 0 0 0 3px var(--focus-shadow);
}

/* 只读输出框样式 */
input[readonly] {
    background-color: var(--readonly-bg);
    font-weight: bold;
    border: 1px solid transparent;
    cursor: default;
}

/* 结果更新动画类 */
.result-update {
    opacity: 0;
    transform: translateY(5px);
}

.result-show {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease-out;
}

/* 分隔线 */
hr {
    border: none;
    height: 1px;
    background-color: var(--separator-color);
    margin: 18px 0;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 600px) {
    .container {
        padding: 8px;
        align-items: flex-start;
        padding-top: 15px;
    }
    
    .calculator-card {
        padding: 18px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .input-section,
    .output-section {
        gap: 12px;
    }
    
    .input-group,
    .output-group {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    label {
        flex-basis: auto;
        margin-bottom: 6px;
        font-size: 14px;
    }
    
    input {
        width: 100%;
        padding: 8px 10px;
        font-size: 16px;
    }
    
    hr {
        margin: 12px 0;
    }
}

/* 输入框占位符样式 */
input::placeholder {
    color: #999;
    opacity: 0.7;
}

/* 移除数字输入框的默认箭头 (Webkit) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 移除数字输入框的默认箭头 (Firefox) */
input[type="number"] {
    -moz-appearance: textfield;
}

/* 确保在小屏幕上的可读性 */
@media (max-width: 480px) {
    .container {
        padding: 5px;
        padding-top: 10px;
    }
    
    .calculator-card {
        padding: 15px;
    }
    
    h1 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .input-section,
    .output-section {
        gap: 10px;
    }
    
    input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 8px 10px;
    }
    
    label {
        font-size: 13px;
    }
    
    hr {
        margin: 10px 0;
    }
}

/* 免费鉴定按钮样式 */
.service-section {
    margin-top: 20px;
    text-align: center;
}

.service-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.service-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.service-btn:active {
    transform: translateY(0);
}

/* 移动端按钮优化 */
@media (max-width: 600px) {
    .service-section {
        margin-top: 15px;
    }
    
    .service-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}