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

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* 标题栏 */
.header {
    text-align: center;
    padding: 20px 0 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 模式切换区域 */
.mode-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}

.mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.mode-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.settings-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    font-size: 12px;
    white-space: nowrap;
}

.settings-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.settings-btn:active {
    transform: scale(0.95);
}

/* 输入区域 */
.input-section {
    transition: all 0.3s ease;
}

.input-section.hidden {
    display: none;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
    font-size: 14px;
}

/* 选择器样式 */
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    color: #2c3e50;
    transition: all 0.3s ease;
    min-height: 48px;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select[multiple] {
    min-height: 60px;
}

/* 输入框容器 */
.input-with-lock {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 输入框样式 */
input[type="number"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    color: #2c3e50;
    transition: all 0.3s ease;
    min-height: 48px;
}

input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 锁定状态的输入框 */
input[type="number"].locked {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

/* 计算状态的输入框 */
input[type="number"].calculated {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.05);
    color: #27ae60;
    font-weight: 600;
}

/* 输入中状态的输入框 */
input[type="number"].inputting {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.05);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

/* 锁定按钮 */
.lock-btn {
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.lock-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.lock-btn:active {
    transform: scale(0.95);
}

/* 锁定状态的按钮 */
.lock-btn[data-locked="true"] {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-color: #3498db;
    color: white;
}

.lock-btn[data-locked="true"]:hover {
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* 提示文字 */
.multi-select-tip,
.exact-tip {
    text-align: center;
    color: #7f8c8d;
    font-size: 12px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
}

/* 结果区域 */
.results-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}

.results-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

/* 结果网格 */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.result-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.result-label {
    font-size: 11px;
    color: #7f8c8d;
    margin-bottom: 4px;
    font-weight: 500;
}

.result-price {
    font-size: 13px;
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 2px;
}

.result-rent {
    font-size: 12px;
    color: #3498db;
    margin-bottom: 2px;
}

.result-yield {
    font-size: 13px;
    font-weight: 600;
    color: #27ae60;
}

/* 底部说明 */
.footer {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.footer p {
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .container {
        padding: 8px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .mode-section,
    .results-section {
        padding: 15px;
    }
    
    .results-grid {
        gap: 8px;
    }
    
    .result-item {
        padding: 10px 6px;
        min-height: 85px;
    }
    
    .result-price,
    .result-yield {
        font-size: 12px;
    }
    
    .result-rent {
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 500px;
        margin: 0 auto;
        padding: 20px;
    }
    
    .results-grid {
        gap: 15px;
    }
    
    .result-item {
        min-height: 100px;
        padding: 15px 10px;
    }
    
    .result-label {
        font-size: 12px;
    }
    
    .result-price,
    .result-yield {
        font-size: 14px;
    }
    
    .result-rent {
        font-size: 13px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-section {
    animation: fadeIn 0.3s ease;
}

/* 防止选择文本 */
.settings-btn,
.result-item {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 触摸反馈 */
.settings-btn:active,
.result-item:active {
    opacity: 0.8;
}