/* 小红书极简化风格样式 */
.profile-container {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    padding-top: 60px;
    padding-bottom: 80px;
}

.profile-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #f5f5f5;
    margin-bottom: 20px;
}

.profile-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.form-section {
    padding: 0 20px;
}

.form-group {
    margin-bottom: 6px;
}

.form-row {
    display: block;
    width: 100%;
}

.form-row .form-label {
    display: none; /* 隐藏标签，使用placeholder代替 */
}

.form-row .form-input,
.form-row .form-select,
.form-row .form-textarea,
.form-row .date-input,
.form-row .custom-select-container {
    width: 100%;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.required {
    color: #ff4757;
    display: none; /* 隐藏必填字段的*号 */
}

.avatar-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.avatar-upload {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-upload:hover {
    border-color: #ddd;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    background: #fafafa;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #ddd;
    background: #fff;
}

.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.form-select:focus {
    outline: none;
    border-color: #ddd;
    background-color: #fff;
}

/* 必选项样式 */
.form-input.required-field {
    border-color: #EAB308;
    background-color: #fafafa;
}

.form-input.required-field:focus {
    border-color: #EAB308;
    background-color: #fff;
}

.form-select.required-field {
    border-color: #EAB308;
    background-color: #fafafa;
}

.form-select.required-field:focus {
    border-color: #EAB308;
    background-color: #fff;
}

.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    background: #fafafa;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: #ddd;
    background: #fff;
}

.hobby-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

.hobby-section {
    margin-bottom: 6px;
    line-height: 1.5;
}

.hobby-section .form-label {
    display: inline;
    margin-right: 8px;
    vertical-align: baseline;
    font-size: 18px;
    /* font-weight: 600; */
    color: #333;
    line-height: 32px; /* 与标签高度对齐 */
}

.hobby-tags-container {
    display: inline;
}

.hobby-tags {
    display: inline;
    line-height: 1.5;
}

.hobby-tag {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
    vertical-align: baseline;
    padding: 6px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.hobby-tag.selected {
    background: #ff6b6b;
    color: #fff;
    border-color: #ff6b6b;
}

.hobby-tag:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.hobby-tag.selected:hover {
    background: #ff5252;
    color: #fff;
}

.hobby-tag.add-tag {
    background: #f8f9fa;
    border: 1px dashed #ddd;
    color: #999;
}

.hobby-tag.add-tag:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: #fff;
}

.custom-tag-input {
    display: none;
    padding: 6px 12px;
    border: 1px solid #ff6b6b;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    min-width: 80px;
}

/* 自定义选择器通用样式 */
.role-select-container,
.gender-select-container {
    position: relative;
    width: 100%;
}

.role-display,
.gender-display {
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    outline: none;
    transition: border-color 0.2s ease;
}

.role-display:focus,
.gender-display:focus {
    border-color: #ddd;
}

.role-display::after,
.gender-display::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
    transition: transform 0.2s ease;
}

.role-display.active::after,
.gender-display.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.role-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #EAB308;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.gender-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.role-option,
.gender-option {
    display: block;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.role-option:last-child,
.gender-option:last-child {
    border-bottom: none;
}

.role-option:hover,
.gender-option:hover {
    background-color: #fafafa;
}

.role-option input[type="radio"],
.gender-option input[type="radio"] {
    margin-right: 8px;
    accent-color: #EAB308;
}

.role-text,
.gender-text {
    font-size: 15px;
    color: #333;
}

/* 分隔线样式 */
.section-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 20px 0;
    border: none;
}

.save-button {
    width: 100%;
    padding: 16px;
    background: #FACC15;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 30px;
    box-shadow: none;
}

.save-button:hover {
    background: #EAB308;
    transform: none;
    box-shadow: none;
}

.save-button:active {
    background: #D97706;
    transform: none;
}

.avatar-input {
    display: none;
}

/* 日期输入框样式 */
.date-wrapper {
    position: relative;
    width: 100%;
}

.date-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.date-input:focus {
    outline: none;
    border-color: #ddd;
    background: #fff;
}

.date-input::-webkit-calendar-picker-indicator {
    opacity: 1;
    position: absolute;
    right: 16px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #666;
}

.date-placeholder {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 15px;
    pointer-events: none;
    transition: opacity 0.2s ease;
    opacity: 1;
    display: block;
}

.date-input.has-value + .date-placeholder {
    opacity: 0;
}

.date-input:focus + .date-placeholder {
    opacity: 0;
}

.date-input:valid + .date-placeholder {
    opacity: 0;
}

.date-display {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    font-size: 15px;
    pointer-events: none;
    display: none;
}

/* 地区选择器样式 */
.region-selector-container {
    position: relative;
    width: 100%;
}

.region-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    color: #333;
}

.region-display:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.region-display:active {
    background: #dee2e6;
}

.region-text {
    flex: 1;
}

.region-arrow {
    transition: transform 0.2s ease;
    opacity: 0.6;
}

/* 地区选择弹窗样式 */
.region-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.region-modal {
    background: white;
    width: 85%;
    max-width: 380px;
    max-height: 70vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.region-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    background: #fafafa;
}

.region-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.region-close:hover {
    background: #f0f0f0;
    color: #666;
}

.region-modal-content {
    max-height: calc(70vh - 80px);
    overflow-y: auto;
    padding: 8px 0;
}

.region-group {
    border-bottom: 1px solid #f5f5f5;
}

.region-group:last-child {
    border-bottom: none;
}

.region-province {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background: #fff;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.region-province:hover {
    background: #f8f9fa;
    border-left-color: #007bff;
}

.region-province.expanded {
    background: #f0f8ff;
    border-left-color: #007bff;
    color: #007bff;
}

.region-province.single-city {
    border-left: 3px solid transparent;
}

.region-province.single-city:hover {
    background: #f0f8ff;
    border-left-color: #28a745;
    color: #28a745;
}

.province-arrow {
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.region-cities {
    display: none;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.region-city {
    padding: 12px 24px 12px 48px;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    background: #fafafa;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.region-city:before {
    content: '•';
    position: absolute;
    left: 36px;
    color: #ccc;
    font-size: 12px;
}

.region-city:hover {
    background: #e3f2fd;
    color: #1976d2;
    border-left-color: #1976d2;
}

.region-city:last-child {
    border-bottom: none;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .region-modal {
        width: 90%;
        max-height: 75vh;
    }
    
    .region-modal-header {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .region-province {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .region-city {
        padding: 10px 20px 10px 40px;
        font-size: 14px;
    }
    
    .region-city:before {
        left: 32px;
    }
}

/* 移动端日期输入框优化 */
@media (max-width: 768px) {
    .profile-container {
        padding-top: 40px;
        padding-bottom: 60px;
    }
    
    .hobby-tag {
        font-size: 12px;
        padding: 4px 8px;
        margin-right: 5px;
        margin-bottom: 5px;
    }
    
    .hobby-section .form-label {
        font-size: 16px;
        line-height: 28px;
    }
    
    /* 移动端日期输入框特殊处理 */
    .date-input {
        color: #333;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .date-input::-webkit-calendar-picker-indicator {
        opacity: 1;
        position: absolute;
        right: 16px;
        width: 24px;
        height: 24px;
        cursor: pointer;
        color: #666;
    }
    
    /* 确保移动端placeholder可见 */
    .date-placeholder {
        opacity: 1 !important;
        display: block !important;
        z-index: 1;
    }
    
    .date-input:focus + .date-placeholder,
    .date-input.has-value + .date-placeholder {
        opacity: 0 !important;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 0 15px;
    }
    
    .hobby-section .form-label {
        font-size: 16px;
        line-height: 28px;
    }
    
    .hobby-tag {
        font-size: 12px;
        padding: 4px 8px;
        margin-right: 5px;
        margin-bottom: 5px;
    }
}

/* 页面加载状态优化 */
body.page-loading .avatar-container {
    opacity: 0.8;
}

body.page-loading .form-input,
body.page-loading .form-select,
body.page-loading .form-textarea {
    transition: none;
}

/* 平滑过渡效果 */
.avatar-container {
    transition: opacity 0.3s ease;
}

.form-input,
.form-select,
.form-textarea {
    transition: all 0.2s ease;
}

/* 防止内容跳动 */
.avatar-image {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-input[value="微信用户"] {
    color: #999;
}

/* 授权按钮样式 - 微信风格扁平化 */
.auth-button-container {
    margin-top: 12px;
    text-align: center;
}

.auth-button {
    background: #07c160;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: normal;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: none;
    min-width: 120px;
}

.auth-button:hover {
    background: #06ad56;
}

.auth-button:active {
    background: #059048;
}