/* ========================================
   十九楼对对象 - PC 婚恋网站主样式
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #ff6b6b;
    --primary-dark: #ee5a6f;
    --primary-gradient: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --border: #e8e8e8;
    --success: #52c41a;
    --warning: #faad14;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-width: 1100px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; vertical-align: middle; }
ul, ol { list-style: none; }
input, select, button, textarea { font-family: inherit; font-size: inherit; }
input:focus, select:focus, textarea:focus { outline: none; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* --- Header --- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    height: 64px;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 22px; font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex; align-items: center; gap: 8px;
}
.logo-icon { color: var(--primary); -webkit-text-fill-color: initial; font-size: 24px; }
.nav-menu { display: flex; align-items: center; gap: 8px; }
.nav-link {
    display: inline-block; padding: 8px 18px;
    color: var(--text); border-radius: 20px;
    font-size: 15px; font-weight: 500;
    transition: all 0.2s;
}
.nav-link:hover { background: #fff0f0; color: var(--primary); }
.nav-link.active { background: var(--primary-gradient); color: #fff; }
.nav-link-logout { color: var(--text-lighter); }
.nav-link-logout:hover { color: var(--primary); background: #fff0f0; }

/* --- Hero (compact for swipe) --- */
.hero {
    background: var(--primary-gradient);
    color: #fff; text-align: center;
    padding: 40px 0 20px;
}
.hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.hero p { font-size: 16px; opacity: 0.9; margin-bottom: 0; }

/* --- Gender Tabs --- */
.gender-tabs {
    display: flex; justify-content: center; gap: 12px;
    margin: 24px 0 32px;
}
.gender-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 32px; border-radius: 24px;
    border: 2px solid var(--border); background: #fff;
    font-size: 16px; font-weight: 500; color: var(--text);
    cursor: pointer; transition: all 0.2s;
}
.gender-tab:hover { border-color: var(--primary); color: var(--primary); }
.gender-tab.active {
    border-color: var(--primary); background: var(--primary-gradient);
    color: #fff;
}
.gender-tab .count {
    font-size: 13px; opacity: 0.8;
    background: rgba(0,0,0,0.06); padding: 2px 8px; border-radius: 10px;
}

/* ========================================
   Swipe Card 滑动交友
   ======================================== */
.hero-swipe { padding: 40px 0 20px; }
.hero-swipe h1 { font-size: 32px; }
.hero-swipe p { font-size: 16px; margin-bottom: 0; }

.swipe-container {
    max-width: 500px; margin: 0 auto; padding: 0 20px 40px;
    text-align: center;
}
.swipe-quota {
    text-align: center; color: var(--text-lighter); font-size: 14px;
    margin-bottom: 20px;
}
.swipe-quota strong { color: var(--primary); font-size: 18px; }

.swipe-stage {
    position: relative; width: 100%; height: 560px;
    display: flex; align-items: flex-start; justify-content: center;
    overflow: hidden;
}

/* 卡片 */
.swipe-card {
    position: absolute; top: 0; width: 100%; max-width: 380px;
    background: #fff; border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden; cursor: grab; user-select: none;
    transition: box-shadow 0.2s, transform 0.05s;
    will-change: transform;
}
.swipe-card.dragging { cursor: grabbing; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.swipe-card.fly-left {
    animation: flyLeft 0.4s ease-out forwards;
    pointer-events: none;
}
.swipe-card.fly-right {
    animation: flyRight 0.4s ease-out forwards;
    pointer-events: none;
}
.swipe-card.snap-back {
    animation: snapBack 0.35s ease-out;
}

@keyframes flyLeft {
    to { transform: translateX(-180%) rotate(-25deg); opacity: 0; }
}
@keyframes flyRight {
    to { transform: translateX(180%) rotate(25deg); opacity: 0; }
}
@keyframes snapBack {
    from { transform: var(--snap-from, translateX(0) rotate(0deg)); }
    to { transform: translateX(0) rotate(0deg); }
}

.swipe-card-photo {
    width: 100%; height: 360px; position: relative;
    overflow: hidden; background: #f0f0f0;
    pointer-events: none;
}
.swipe-card-photo img {
    width: 100%; height: 100%; object-fit: cover;
}
.swipe-card-photo .photo-placeholder {
    width: 100%; height: 100%; display: flex;
    align-items: center; justify-content: center;
    font-size: 80px; color: #ddd; background: #f5f5f5;
}

/* 图片上的信息层 */
.swipe-card-info {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 60px 20px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff; text-align: left; pointer-events: none;
}
.swipe-card-info .name-line {
    font-size: 24px; font-weight: 700; margin-bottom: 4px;
    display: flex; align-items: center; gap: 8px;
}
.swipe-card-info .level-tag {
    font-size: 12px; background: rgba(255,255,255,0.25);
    padding: 2px 8px; border-radius: 10px;
}
.swipe-card-info .meta-line {
    font-size: 14px; opacity: 0.9; display: flex; gap: 8px; flex-wrap: wrap;
}

/* 详情区 */
.swipe-card-body {
    padding: 16px 20px 20px; text-align: left;
}
.swipe-card-body .info-row {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.swipe-card-body .info-tag {
    font-size: 13px; padding: 4px 10px;
    background: #f5f5f5; border-radius: 6px; color: var(--text-light);
}
.swipe-card-body .info-text {
    font-size: 14px; color: var(--text-light); line-height: 1.7;
    margin-bottom: 6px;
}
.swipe-card-body .info-text strong { color: var(--text); }

/* 操作按钮 - 卡片左右两侧 */
.swipe-actions {
    display: flex; justify-content: center; gap: 28px;
    margin-top: 20px; position: relative; z-index: 10;
}

/* 按钮移到卡片两侧（绝对定位） */
.swipe-stage .swipe-actions-side {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, calc(-50% - 30px));
    width: 100%; max-width: 500px; height: 0; z-index: 10; pointer-events: none;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 10px;
}
.swipe-stage .swipe-actions-side .swipe-btn {
    pointer-events: auto;
}
.swipe-btn {
    width: 56px; height: 56px; border-radius: 50%;
    border: none; cursor: pointer; font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.swipe-btn:active { transform: scale(0.9); }
.swipe-btn-pass {
    background: #fff; color: #999; border: 2px solid #e0e0e0;
}
.swipe-btn-pass:hover { border-color: #ccc; color: #666; }
.swipe-btn-like {
    background: var(--primary-gradient); color: #fff;
}
.swipe-btn-like:hover { transform: scale(1.08); }

/* 空状态 */
.swipe-empty {
    text-align: center; padding: 60px 0;
}
.swipe-empty-icon { font-size: 56px; margin-bottom: 16px; }
.swipe-empty p { font-size: 16px; color: var(--text-light); margin-bottom: 8px; }

.swipe-login-hint {
    margin-top: 16px; font-size: 14px; color: var(--text-lighter);
}
.swipe-login-hint a { color: var(--primary); font-weight: 500; }

/* --- Auth Badge --- */
.auth-badge {
    display: inline-block; font-size: 12px; padding: 2px 8px;
    border-radius: 4px; font-weight: 500;
}
.auth-badge.verified { background: #e6f7e6; color: var(--success); }
.auth-badge.unverified { background: #f5f5f5; color: var(--text-lighter); }

/* --- Page Content --- */
.page-content { padding: 40px 0 60px; min-height: 60vh; }

/* --- Auth Forms (Login / Register) --- */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: calc(100vh - 64px - 100px); padding: 40px 0;
}
.auth-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 48px 40px;
    width: 100%; max-width: 420px;
}
.auth-card h2 { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.auth-card .auth-subtitle { text-align: center; color: var(--text-lighter); margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 14px; font-weight: 500;
    color: var(--text); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; height: 44px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fafafa; transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 3px rgba(255,107,107,0.1);
}
.form-group textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 80px; }

.btn-primary {
    display: block; width: 100%; height: 46px; line-height: 46px;
    background: var(--primary-gradient); color: #fff; border: none;
    border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
    text-align: center;
    cursor: pointer; transition: all 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,107,107,0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.auth-footer { text-align: center; margin-top: 20px; color: var(--text-lighter); }
.auth-footer a { color: var(--primary); font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

.form-error { color: var(--primary); font-size: 13px; margin-top: 4px; }
.form-success { color: var(--success); font-size: 13px; margin-top: 4px; }
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 20px; font-size: 14px;
}
.alert-error { background: #fff0f0; color: var(--primary); border: 1px solid #ffd4d4; }
.alert-success { background: #e6f7e6; color: var(--success); border: 1px solid #b7eb8f; }

/* --- Profile Card / Verify Card (centered form card) --- */
.profile-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 32px;
    max-width: 700px; margin: 0 auto;
}
.profile-card h2 { font-size: 22px; margin-bottom: 24px; }
.profile-info { margin-bottom: 24px; }
.profile-info dt { font-size: 13px; color: var(--text-lighter); margin-bottom: 4px; }
.profile-info dd { font-size: 15px; color: var(--text); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.profile-info dd:last-child { border-bottom: none; }
.verify-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px; font-size: 13px;
}
.verify-status.pending { background: #fff7e6; color: var(--warning); }
.verify-status.verified { background: #e6f7e6; color: var(--success); }
.verify-status.none { background: #f5f5f5; color: var(--text-lighter); }

/* --- Guest Detail Page --- */
.guest-detail { max-width: 900px; margin: 0 auto; }
.guest-detail-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.guest-detail-header {
    display: flex; gap: 30px; padding: 32px;
    background: var(--primary-gradient); color: #fff;
    align-items: center;
}
.guest-detail-header .photo {
    width: 180px; height: 180px; border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.4); overflow: hidden;
    flex-shrink: 0; background: rgba(255,255,255,0.2);
}
.guest-detail-header .photo img {
    width: 100%; height: 100%; object-fit: cover;
}
.guest-detail-header .basic h3 { font-size: 24px; margin-bottom: 4px; }
.guest-detail-header .basic .id-text { font-size: 14px; opacity: 0.8; margin-bottom: 8px; }
.guest-detail-header .basic .hot-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,0.2); padding: 4px 12px;
    border-radius: 20px; font-size: 13px;
}
.guest-detail-body { padding: 28px 32px; }
.guest-detail-body .tag-row {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px;
}
.guest-detail-body .tag-item {
    padding: 6px 14px; background: #f5f5f5;
    border-radius: 20px; font-size: 14px; color: var(--text);
}
.guest-detail-body .info-section { margin-bottom: 24px; }
.guest-detail-body .info-section h4 {
    font-size: 16px; font-weight: 600; padding-bottom: 8px;
    border-bottom: 2px solid var(--primary); margin-bottom: 12px;
    display: inline-block;
}
.guest-detail-body .info-section p {
    font-size: 15px; color: var(--text-light); line-height: 1.8;
}
.guest-detail-body .btn-consult {
    display: inline-block; margin-top: 16px;
    padding: 12px 36px;
    background: var(--primary-gradient); color: #fff;
    border: none; border-radius: 24px;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.guest-detail-body .btn-consult:hover {
    transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,107,107,0.4);
}

/* --- QR Modal --- */
.qr-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.5);
}
.qr-modal.active { display: flex; }
.qr-modal-card {
    background: #fff; border-radius: var(--radius);
    padding: 36px 32px; text-align: center;
    position: relative; max-width: 380px; width: 90%;
}
.qr-modal-close {
    position: absolute; top: 12px; right: 16px;
    width: 36px; height: 36px; border: none; background: #f5f5f5;
    border-radius: 50%; font-size: 22px; cursor: pointer;
    color: var(--text-light); line-height: 36px;
}
.qr-modal-close:hover { background: #ffe8e8; color: var(--primary); }
.qr-modal-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.qr-modal-desc { color: var(--text-lighter); margin-bottom: 20px; }
.qr-modal-image { width: 220px; height: 220px; border-radius: var(--radius-sm); }

/* --- Footer --- */
.site-footer {
    background: #333; color: #aaa; padding: 30px 0; text-align: center;
}
.site-footer a { color: #ccc; }
.site-footer a:hover { color: #fff; }

/* --- Toast --- */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    padding: 12px 24px; border-radius: var(--radius-sm);
    color: #fff; font-size: 14px; z-index: 2000;
    animation: toastIn 0.3s ease; pointer-events: none;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--primary); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Loading --- */
.loading { text-align: center; padding: 40px 0; color: var(--text-lighter); }
.loading::after { content: '加载中...'; }

/* --- Empty State --- */
.empty { text-align: center; padding: 60px 0; color: var(--text-lighter); }
.empty .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty p { font-size: 15px; }

/* --- File Upload --- */
.file-upload-box {
    border: 2px dashed var(--border); border-radius: var(--radius-sm);
    padding: 24px; text-align: center; cursor: pointer;
    transition: all 0.15s ease; position: relative; min-height: 120px;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    /* 点击反馈提速：去掉可能造成延迟的效果 */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.file-upload-box:hover { border-color: var(--primary); background: #fff8f8; }
.file-upload-box:active { background: #fff0f0; transform: scale(0.98); }
.file-upload-box.has-file { border-style: solid; border-color: var(--success); }
.file-upload-box .preview-img { max-height: 200px; border-radius: 4px; }
.file-upload-box .placeholder { color: var(--text-lighter); pointer-events: none; }
.file-upload-box .upload-spinner {
    display: none; width: 24px; height: 24px; border: 3px solid #eee;
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.file-upload-box input[type="file"] {
    position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none;
}

/* --- Responsive tweaks for medium screens --- */
@media (max-width: 1400px) {
    .guest-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
    .guest-grid { grid-template-columns: repeat(3, 1fr); }
}
