/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #ff4458;
    --primary-dark: #e63946;
    --gradient: linear-gradient(135deg, #ff4458, #ff6b6b);
    --gradient-purple: linear-gradient(135deg, #667eea, #764ba2);
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --nav-height: 60px;
    --header-height: 56px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}
.tenant-theme-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    place-items: center;
    background: linear-gradient(145deg, #fff7f8, #f5f7fa);
    color: var(--text-light);
}
.tenant-theme-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.tenant-theme-loader i {
    color: var(--primary);
    font-size: 28px;
}
html.tenant-theme-loading .tenant-theme-loader { display: grid; }
html.tenant-theme-loading #auth-container,
html.tenant-theme-loading #app-page,
html.tenant-theme-loading #tenant-unavailable {
    visibility: hidden;
    pointer-events: none;
}
.hidden { display: none !important; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea {
    font-family: inherit;
    font-size: 14px;
    border: none;
    outline: none;
}
img { display: block; max-width: 100%; }

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--gradient);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255,68,88,0.4);
}
.btn-primary:active { transform: translateY(0); }

/* ===== 语言切换器 ===== */
.lang-switcher, .lang-switcher-mini {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 3px;
}
.lang-switcher { justify-content: center; margin-top: 24px; }
.lang-switcher button, .lang-switcher-mini button {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    border: none;
    background: transparent;
    cursor: pointer;
}
.lang-switcher button.active, .lang-switcher-mini button.active {
    background: rgba(255,255,255,0.9);
    color: var(--primary);
    font-weight: 600;
}
.lang-switcher-mini {
    background: rgba(0,0,0,0.08);
}
.lang-switcher-mini button {
    color: rgba(0,0,0,0.5);
}
.lang-switcher-mini button.active {
    background: var(--primary);
    color: #fff;
}
.lang-switcher-mini button:hover:not(.active) {
    color: var(--primary);
}
.lang-switcher button { padding: 6px 14px; font-size: 12px; }
.lang-switcher-mini button { padding: 4px 10px; font-size: 11px; }

/* ===== 主应用 ===== */
.app-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.app-header {
    height: var(--header-height);
    padding: 0 20px;
    padding-top: var(--safe-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    z-index: 100;
}
.header-left { display: flex; align-items: center; }
.app-title {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-light);
    font-size: 16px;
    transition: background 0.2s;
}
.btn-icon:hover { background: rgba(0,0,0,0.05); }

.app-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 80px;
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}
.page.active {
    display: block !important;
    visibility: visible;
    pointer-events: auto;
}

.app-nav {
    height: var(--nav-height);
    padding-bottom: var(--safe-bottom);
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: white;
    box-shadow: 0 -1px 0 rgba(0,0,0,0.05);
    z-index: 100;
}
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 20px;
    color: var(--text-light);
    font-size: 10px;
    transition: color 0.2s;
}
.nav-btn i { font-size: 20px; }
.nav-btn.active { color: var(--primary); }
.nav-btn.active i { transform: scale(1.1); }

/* ===== 模态框 ===== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}
.modal-content {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    animation: modalIn 0.4s ease;
}
@keyframes modalIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== 匹配成功弹窗 ===== */
.match-modal-content {
    background: linear-gradient(180deg, #ff4458, #ff6b6b);
    color: white;
}
.match-modal-content h2 { font-size: 28px; margin: 16px 0 8px; }
.match-user { font-size: 18px; opacity: 0.9; margin-bottom: 20px; }
.match-hearts { font-size: 48px; }
.match-hearts i { animation: heartPulse 0.6s ease infinite alternate; color: white; }
@keyframes heartPulse {
    from { transform: scale(1); }
    to { transform: scale(1.2); }
}
.match-avatar-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}
.match-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
}
.match-center-heart { color: white; font-size: 24px; }
.match-modal-content .btn-primary {
    background: white;
    color: var(--primary);
    font-weight: 700;
}

/* ===== 滚动条 ===== */
.page::-webkit-scrollbar { width: 0; }
