/* 移动端控件尺寸优化样式 */

/* 按钮基础优化 */
@media (max-width: 768px) {
    /* 主要按钮样式 */
    .btn, 
    .btn-primary, 
    .btn-secondary, 
    .btn-success, 
    .btn-danger,
    .buy-btn,
    .checkin-btn,
    .submit-btn {
        min-height: 44px; /* iOS推荐的最小触控区域 */
        min-width: 44px;
        padding: 12px 20px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 12px;
        border: none;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        position: relative;
        overflow: hidden;
    }
    
    /* 主要按钮 */
    .btn-primary,
    .buy-btn,
    .checkin-btn {
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
        color: white;
    }
    
    .btn-primary:active,
    .buy-btn:active,
    .checkin-btn:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    /* 次要按钮 */
    .btn-secondary {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        color: #495057;
        border: 1px solid #dee2e6;
    }
    
    .btn-secondary:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    }
    
    /* 成功按钮 */
    .btn-success {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        color: white;
    }
    
    /* 危险按钮 */
    .btn-danger {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
        color: white;
    }
    
    /* 小按钮 */
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
        padding: 8px 16px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    /* 大按钮 */
    .btn-lg {
        min-height: 52px;
        padding: 16px 24px;
        font-size: 1.1rem;
        border-radius: 16px;
    }
    
    /* 全宽按钮 */
    .btn-block {
        width: 100%;
        margin: 8px 0;
    }
    
    /* 图标按钮 */
    .btn-icon {
        min-width: 44px;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        font-size: 1.2rem;
    }
    
    /* 输入框优化 */
    .form-control,
    .cute-input,
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 1rem;
        border: 2px solid #e9ecef;
        border-radius: 12px;
        background: #ffffff;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-control:focus,
    .cute-input:focus,
    input:focus,
    textarea:focus,
    select:focus {
        outline: none;
        border-color: #4CAF50;
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
        transform: translateY(-1px);
    }
    
    /* 标签优化 */
    label {
        font-size: 0.9rem;
        font-weight: 600;
        color: #495057;
        margin-bottom: 8px;
        display: block;
    }
    
    /* 表单组优化 */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* 复选框和单选框优化 */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 12px;
        cursor: pointer;
    }
    
    /* 开关按钮优化 */
    .switch {
        position: relative;
        display: inline-block;
        width: 60px;
        height: 34px;
        margin: 0;
    }
    
    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }
    
    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: 0.4s;
        border-radius: 34px;
    }
    
    .slider:before {
        position: absolute;
        content: "";
        height: 26px;
        width: 26px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }
    
    input:checked + .slider {
        background-color: #4CAF50;
    }
    
    input:checked + .slider:before {
        transform: translateX(26px);
    }
    
    /* 评分控件优化 */
    .rating-selector {
        display: flex;
        justify-content: center;
        gap: 12px;
        padding: 16px 0;
        flex-wrap: wrap;
    }
    
    .rating-option {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
        border: 2px solid #e9ecef;
        border-radius: 12px;
        background: #ffffff;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        font-weight: 600;
        color: #495057;
        text-align: center;
        user-select: none;
    }
    
    .rating-option:active {
        transform: scale(0.95);
    }
    
    .rating-option.selected {
        border-color: #4CAF50;
        background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
        color: #2e7d32;
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }
    
    /* 星级评分优化 */
    .star-rating {
        display: flex;
        justify-content: center;
        gap: 8px;
        padding: 16px 0;
    }
    
    .star {
        font-size: 2rem;
        color: #ddd;
        cursor: pointer;
        transition: all 0.3s ease;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
    
    .star:active {
        transform: scale(0.9);
    }
    
    .star.active,
    .star.selected {
        color: #ffc107;
        text-shadow: 0 2px 4px rgba(255, 193, 7, 0.5);
    }
    
    /* 滑块控件优化 */
    .slider-container {
        padding: 20px 0;
    }
    
    .range-slider {
        width: 100%;
        height: 8px;
        border-radius: 4px;
        background: #e9ecef;
        outline: none;
        -webkit-appearance: none;
    }
    
    .range-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: #4CAF50;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    }
    
    .range-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: #4CAF50;
        cursor: pointer;
        border: none;
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    }
    
    /* 下拉选择优化 */
    .select-wrapper {
        position: relative;
    }
    
    .select-wrapper::after {
        content: '▼';
        position: absolute;
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
        pointer-events: none;
        color: #6c757d;
        font-size: 0.8rem;
    }
    
    select {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        padding-right: 40px;
        cursor: pointer;
    }
    
    /* 搜索框优化 */
    .search-box {
        position: relative;
        margin-bottom: 20px;
    }
    
    .search-input {
        padding-left: 44px;
        background: #f8f9fa;
        border: 2px solid transparent;
    }
    
    .search-input:focus {
        background: #ffffff;
        border-color: #4CAF50;
    }
    
    .search-icon {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: #6c757d;
        font-size: 1.2rem;
        pointer-events: none;
    }
    
    /* 标签页优化 */
    .tab-nav {
        display: flex;
        background: #f8f9fa;
        border-radius: 12px;
        padding: 4px;
        margin-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-item {
        flex: 1;
        min-width: 80px;
        padding: 12px 16px;
        text-align: center;
        border-radius: 8px;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.9rem;
        font-weight: 500;
        color: #6c757d;
        white-space: nowrap;
    }
    
    .tab-item.active {
        background: #ffffff;
        color: #4CAF50;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* 卡片选择器优化 */
    .card-selector {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
        margin: 16px 0;
    }
    
    .card-option {
        padding: 16px 12px;
        border: 2px solid #e9ecef;
        border-radius: 12px;
        background: #ffffff;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
        min-height: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .card-option:active {
        transform: scale(0.98);
    }
    
    .card-option.selected {
        border-color: #4CAF50;
        background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }
    
    .card-option-icon {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }
    
    .card-option-text {
        font-size: 0.85rem;
        font-weight: 500;
        color: #495057;
        line-height: 1.2;
    }
}

/* 超小屏幕控件优化 */
@media (max-width: 480px) {
    .btn {
        min-height: 40px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .form-control,
    .cute-input,
    input,
    textarea,
    select {
        min-height: 40px;
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .rating-option {
        min-width: 40px;
        min-height: 40px;
        font-size: 1rem;
    }
    
    .star {
        font-size: 1.5rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .card-selector {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .card-option {
        padding: 12px 8px;
        min-height: 70px;
    }
    
    .card-option-icon {
        font-size: 1.3rem;
    }
    
    .card-option-text {
        font-size: 0.8rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 移除悬停效果，使用激活状态 */
    .btn:hover,
    .rating-option:hover,
    .star:hover,
    .card-option:hover,
    .tab-item:hover {
        transform: none;
    }
    
    /* 增强激活反馈 */
    .btn:active,
    .rating-option:active,
    .star:active,
    .card-option:active,
    .tab-item:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* 触摸反馈 */
    .btn,
    .rating-option,
    .star,
    .card-option,
    .tab-item {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}