* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f0e8;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

.user-container {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 100px;
    position: relative;
}

/* ========== 顶部 ========== */
.user-header {
    position: relative;
    padding: 40px 20px 30px;
    text-align: center;
    overflow: hidden;
}
.header-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 50%, #d35400 100%);
    z-index: 0;
}
.header-bg::before {
    content: '🏮';
    position: absolute;
    font-size: 120px;
    opacity: 0.1;
    top: -20px; right: -10px;
}
.header-title {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    letter-spacing: 4px;
}
.user-info {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    object-fit: cover;
    background: #fff;
}
.user-nickname {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}
.wechat-login-btn {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    backdrop-filter: blur(4px);
}

/* ========== 用户名输入 ========== */
.username-section {
    padding: 0 16px;
}
.username-input-wrap {
    position: relative;
}
.username-input {
    width: 100%;
    padding: 14px 14px;
    border: 2px solid #e8dcc8;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}
.username-input:focus {
    border-color: #c0392b;
}
.username-input.error {
    border-color: #e74c3c;
    background: #fff5f5;
}
.username-count {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #bbb;
    pointer-events: none;
}
.username-hint {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 6px;
    min-height: 16px;
    padding-left: 4px;
}
.username-hint.ok {
    color: #27ae60;
}

/* ========== 区块标题 ========== */
.section-title {
    font-size: 17px;
    font-weight: bold;
    color: #8b4513;
    margin: 24px 20px 12px;
    padding-left: 12px;
    border-left: 4px solid #c0392b;
}

/* ========== 自定义祝福输入 ========== */
.custom-blessing-section {
    padding: 0 16px;
    margin-top: 20px;
}
.custom-input-wrap {
    position: relative;
}
.custom-blessing-input {
    width: 100%;
    min-height: 70px;
    padding: 12px 60px 12px 14px;
    border: 2px solid #e8dcc8;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #333;
    outline: none;
    resize: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.custom-blessing-input:focus {
    border-color: #c0392b;
}
.custom-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 12px;
    color: #bbb;
    pointer-events: none;
}
.custom-hint {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 6px;
    min-height: 16px;
    padding-left: 4px;
}
.custom-hint.ok {
    color: #27ae60;
}

/* ========== 预设祝福列表 ========== */
.preset-list {
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.preset-item {
    position: relative;
    padding: 14px 12px;
    background: #fff;
    border: 2px solid #e8dcc8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preset-item:active {
    transform: scale(0.97);
}
.preset-item.selected {
    border-color: #c0392b;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.2);
}
.preset-text {
    font-size: 14px;
    color: #5a3a1a;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
}
.preset-item.selected .preset-text {
    color: #c0392b;
}
.preset-check {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #c0392b;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
}
.preset-item.selected .preset-check {
    display: flex;
}

/* ========== 自定义输入 ========== */
.custom-section {
    padding: 0 16px;
}
.custom-input {
    width: 100%;
    min-height: 80px;
    padding: 12px 14px;
    border: 2px solid #e8dcc8;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    background: #fff;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
}
.custom-input:focus {
    border-color: #c0392b;
}

/* ========== 发送按钮 ========== */
.send-section {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent 0%, #f5f0e8 30%);
    z-index: 10;
}
.send-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.4);
    transition: all 0.2s;
    letter-spacing: 4px;
}
.send-btn:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.3);
}
.send-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}
.btn-icon {
    font-size: 22px;
}

/* ========== 弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}
.modal-overlay.show {
    display: flex;
}
.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 36px 30px;
    text-align: center;
    width: 80%;
    max-width: 320px;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.success-icon {
    font-size: 60px;
    margin-bottom: 16px;
    animation: float 2s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.modal-content h3 {
    font-size: 22px;
    color: #c0392b;
    margin-bottom: 8px;
}
.modal-content p {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
}
.modal-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

/* ========== 加载 ========== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    color: #fff;
}
.loading-overlay.show {
    display: flex;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
