/**
 * 表单优化增强样式 - 苹果设计风格
 * 提供与苹果产品一致的精致输入体验和视觉反馈
 * 特点：最小化的视觉元素、精确的油墨交互、微妙的动画过渡
 */

/* 输入框增强样式 - 苹果风格 */
.enhanced-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    line-height: 1.5;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.enhanced-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
    outline: none;
}

.enhanced-input:hover:not(:focus) {
    border-color: rgba(0, 0, 0, 0.25);
}

/* 注意力焦点状态 */
.enhanced-input:focus-visible {
    transform: scale(1.005);
}

/* 已填写状态 */
.enhanced-input.filled {
    background-color: #f9f9ff;
}

/* 输入状态样式 */
.input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within .input-label {
    color: #1d3557;
}

.character-counter {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 0.8rem;
    color: #666;
}

.character-counter.limit-close {
    color: #e63946;
}

/* 输入验证和反馈 */
.input-feedback {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #666;
    min-height: 20px;
}

.input-feedback.error {
    color: #e63946;
}

.input-feedback.success {
    color: #2a9d8f;
}

/* 提交按钮增强 - 苹果设计风格 */
.enhanced-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: center;
    letter-spacing: -0.01em;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    user-select: none;
}

.enhanced-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.enhanced-button:hover {
    background-color: #0077e6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.enhanced-button:hover::after {
    opacity: 1;
}

.enhanced-button:active {
    transform: translateY(1px);
    background-color: #0055b3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.enhanced-button.primary {
    background-color: #0066cc;
    color: white;
}

.enhanced-button.secondary {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.enhanced-button.secondary:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.enhanced-button.destructive {
    background-color: #ff3b30;
    color: white;
}

/* 强调按钮 */
.enhanced-button.accent {
    background-color: #ff9500;
    color: white;
}

/* 移动设备优化 */
@media (max-width: 768px) {
    .enhanced-input {
        padding: 10px 12px;
        font-size: 16px; /* 避免iOS中自动缩放 */
    }
    
    .input-wrapper {
        margin-bottom: 2rem; /* 更多空间防止点击错误 */
    }
    
    .enhanced-button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
    
    /* 确保输入框在移动设备上有足够空间 */
    textarea.enhanced-input {
        min-height: 100px;
    }
}

/* 输入动画效果 */
@keyframes inputHighlight {
    0% { border-color: #1d3557; }
    50% { border-color: #457b9d; }
    100% { border-color: #1d3557; }
}
