/* ===== H5 tenant templates =====
   The page logic stays the same. These classes only reskin the existing H5 UI. */

body.h5-template-classic {
    --template-name: classic;
}

/* Template 2: 心动粉 - soft dating-card style */
body.h5-template-rose {
    --primary: #ff4f8b;
    --primary-dark: #db2777;
    --gradient: linear-gradient(135deg, #ff4f8b 0%, #ff7a59 100%);
    --gradient-purple: linear-gradient(135deg, #ff4f8b, #8b5cf6);
    --bg: #fff4f8;
    --card-bg: rgba(255,255,255,.92);
    --text: #321526;
    --text-light: #9a637c;
    --shadow: 0 10px 26px rgba(219,39,119,.12);
    --shadow-lg: 0 22px 60px rgba(219,39,119,.22);
}

body.h5-template-rose .auth-page {
    background:
        radial-gradient(circle at 20% 12%, rgba(255,255,255,.7), transparent 28%),
        radial-gradient(circle at 82% 78%, rgba(251,113,133,.36), transparent 32%),
        linear-gradient(140deg, #ff7eb3 0%, #ff758c 48%, #ffb199 100%);
}

body.h5-template-rose .auth-card,
body.h5-template-rose .tenant-unavailable {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.36);
    box-shadow: 0 24px 70px rgba(157,23,77,.2);
}

body.h5-template-rose .app-page,
body.h5-template-rose .chat-messages {
    background:
        radial-gradient(circle at 12% 8%, rgba(255,79,139,.14), transparent 28%),
        linear-gradient(180deg, #fff7fb 0%, #fff 46%, #fff2f7 100%);
}

body.h5-template-rose .app-header,
body.h5-template-rose .app-nav,
body.h5-template-rose .chat-header,
body.h5-template-rose .chat-input-bar {
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(16px);
    border-color: rgba(255,79,139,.12);
}

body.h5-template-rose .swipe-card {
    border: 8px solid rgba(255,255,255,.88);
    border-radius: 30px;
    box-shadow: 0 26px 70px rgba(219,39,119,.28);
}

body.h5-template-rose .card-overlay {
    padding-bottom: 26px;
    background: linear-gradient(transparent 8%, rgba(51,12,35,.12) 38%, rgba(51,12,35,.82));
}

body.h5-template-rose .swipe-btn,
body.h5-template-rose .chat-list-item {
    background: rgba(255,255,255,.92);
    border-radius: 22px;
}

body.h5-template-rose .chat-list {
    gap: 10px;
    padding: 0 14px 14px;
}

body.h5-template-rose .chat-list-item {
    padding: 12px;
    border: 1px solid rgba(255,79,139,.08);
    box-shadow: 0 10px 24px rgba(219,39,119,.08);
}

body.h5-template-rose .chat-msg.received .chat-bubble {
    background: #fff;
    border: 1px solid rgba(255,79,139,.12);
    box-shadow: 0 8px 22px rgba(219,39,119,.08);
}

body.h5-template-rose .chat-msg.sent .chat-bubble,
body.h5-template-rose .chat-send {
    background: linear-gradient(135deg, #ff4f8b, #fb7185);
}

body.h5-template-rose .service-disclosure,
body.h5-template-rose .chat-system-msg.guarantee {
    background: #fff0f5;
    border-color: #ffc2d5;
    color: #9f1239;
}

/* Template 3: 霓虹夜 - dark neon swipe style */
body.h5-template-neon {
    --primary: #22d3ee;
    --primary-dark: #0891b2;
    --gradient: linear-gradient(135deg, #22d3ee 0%, #a855f7 100%);
    --gradient-purple: linear-gradient(135deg, #06b6d4, #7c3aed);
    --bg: #070a18;
    --card-bg: #111827;
    --text: #eef6ff;
    --text-light: #9ca3af;
    --shadow: 0 12px 34px rgba(34,211,238,.14);
    --shadow-lg: 0 28px 80px rgba(168,85,247,.28);
}

body.h5-template-neon {
    background: #070a18;
}

body.h5-template-neon .auth-page,
body.h5-template-neon .app-page,
body.h5-template-neon .chat-messages {
    background:
        radial-gradient(circle at 18% 14%, rgba(34,211,238,.26), transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(168,85,247,.28), transparent 30%),
        radial-gradient(circle at 50% 88%, rgba(244,63,94,.16), transparent 30%),
        #070a18;
}

body.h5-template-neon .auth-card,
body.h5-template-neon .tenant-unavailable,
body.h5-template-neon .app-header,
body.h5-template-neon .app-nav,
body.h5-template-neon .chat-header,
body.h5-template-neon .chat-input-bar {
    background: rgba(12,18,36,.82);
    border: 1px solid rgba(148,163,184,.18);
    box-shadow: 0 0 0 1px rgba(34,211,238,.05), 0 20px 70px rgba(0,0,0,.38);
    backdrop-filter: blur(18px);
}

body.h5-template-neon .app-title,
body.h5-template-neon .nav-btn.active {
    text-shadow: 0 0 18px rgba(34,211,238,.45);
}

body.h5-template-neon .header-right .btn-icon,
body.h5-template-neon .chat-back,
body.h5-template-neon .chat-list-name,
body.h5-template-neon .chat-header-info h3,
body.h5-template-neon .page-title {
    color: #eef6ff;
}

body.h5-template-neon .lang-switcher-mini,
body.h5-template-neon .chat-back,
body.h5-template-neon .chat-input-bar input {
    background: rgba(255,255,255,.08);
}

body.h5-template-neon .chat-input-bar input {
    border-color: rgba(34,211,238,.24);
    color: #eef6ff;
}

body.h5-template-neon .chat-input-bar input::placeholder {
    color: rgba(226,232,240,.45);
}

body.h5-template-neon .swipe-card {
    border: 1px solid rgba(34,211,238,.34);
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(168,85,247,.22),
        0 0 38px rgba(34,211,238,.14),
        0 28px 90px rgba(0,0,0,.45);
}

body.h5-template-neon .card-overlay {
    background: linear-gradient(transparent 0%, rgba(7,10,24,.3) 42%, rgba(7,10,24,.95));
}

body.h5-template-neon .card-tag {
    background: rgba(34,211,238,.16);
    border: 1px solid rgba(34,211,238,.28);
}

body.h5-template-neon .swipe-btn {
    background: rgba(15,23,42,.9);
    border: 1px solid rgba(148,163,184,.18);
}

body.h5-template-neon .chat-list {
    gap: 10px;
    padding: 0 14px 14px;
}

body.h5-template-neon .chat-list-item {
    padding: 12px;
    border: 1px solid rgba(148,163,184,.14);
    border-radius: 18px;
    background: rgba(15,23,42,.82);
}

body.h5-template-neon .chat-list-preview,
body.h5-template-neon .chat-list-time,
body.h5-template-neon .chat-msg-time,
body.h5-template-neon .matches-empty {
    color: rgba(226,232,240,.58);
}

body.h5-template-neon .chat-msg.received .chat-bubble {
    background: rgba(15,23,42,.95);
    border: 1px solid rgba(34,211,238,.16);
    color: #eef6ff;
}

body.h5-template-neon .chat-msg.sent .chat-bubble,
body.h5-template-neon .chat-send {
    background: linear-gradient(135deg, #06b6d4, #7c3aed);
}

body.h5-template-neon .service-disclosure,
body.h5-template-neon .chat-system-msg.guarantee {
    background: rgba(250,204,21,.08);
    border-color: rgba(250,204,21,.22);
    color: #fde68a;
}

/* ===== Template layout upgrade =====
   These overrides make each H5 template feel like a different product, not
   just a color swap. Business logic and DOM hooks remain unchanged. */

body[class*="h5-template-"] .auth-container {
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
body[class*="h5-template-"] .auth-container::-webkit-scrollbar { display: none; }
body[class*="h5-template-"] .auth-card,
body[class*="h5-template-"] .swipe-card,
body[class*="h5-template-"] .chat-list-item,
body[class*="h5-template-"] .profile-section,
body[class*="h5-template-"] .profile-header-card {
    transition: border-radius .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
}
body[class*="h5-template-"] .btn-guest:disabled {
    cursor: wait;
    opacity: .72;
}

/* Rose layout: mobile bottom sheet + soft dating card */
body.h5-template-rose .auth-page {
    align-items: flex-end;
    justify-content: center;
    overflow-y: auto;
    padding: 28px 14px max(18px, env(safe-area-inset-bottom, 0px));
}
body.h5-template-rose .auth-container {
    width: min(430px, 100%);
    max-width: 430px;
}
body.h5-template-rose .auth-logo {
    text-align: left;
    margin: 0 4px 18px;
}
body.h5-template-rose .logo-icon {
    margin: 0 0 10px;
    box-shadow: 0 14px 38px rgba(219,39,119,.28);
}
body.h5-template-rose .auth-logo h1 {
    font-size: 36px;
    letter-spacing: 4px;
}
body.h5-template-rose .logo-sub {
    color: rgba(255,255,255,.78);
}
body.h5-template-rose .auth-card {
    border-radius: 34px 34px 24px 24px;
    padding: 24px;
}
body.h5-template-rose .auth-tabs {
    border-radius: 999px;
    padding: 5px;
    background: rgba(255,255,255,.22);
}
body.h5-template-rose .auth-tab { border-radius: 999px; }
body.h5-template-rose .form-group input,
body.h5-template-rose .form-group select {
    padding-top: 13px;
    padding-bottom: 13px;
    border-radius: 18px;
    background: rgba(255,255,255,.76);
    border-color: rgba(255,255,255,.46);
    color: #4a1934;
}
body.h5-template-rose .form-group input::placeholder { color: rgba(74,25,52,.44); }
body.h5-template-rose .form-group i { color: #ff4f8b; }
body.h5-template-rose .form-group select option { background: #fff7fb; color: #4a1934; }
body.h5-template-rose .reg-upload-label,
body.h5-template-rose .reg-avatar-upload span { color: rgba(74,25,52,.62); }
body.h5-template-rose .reg-avatar-upload,
body.h5-template-rose .reg-album-slot {
    background: rgba(255,255,255,.58);
    border-color: rgba(255,255,255,.54);
}
body.h5-template-rose .reg-avatar-upload i,
body.h5-template-rose .reg-album-slot.empty i { color: rgba(255,79,139,.72); }
body.h5-template-rose .app-nav {
    margin: 0 14px 12px;
    height: 64px;
    border-radius: 999px;
    box-shadow: 0 18px 42px rgba(219,39,119,.16);
}
body.h5-template-rose .profile-header-card {
    margin: 14px 14px 0;
    border-radius: 28px;
}

/* Neon layout: terminal-like auth + glowing dark H5 */
body.h5-template-neon .auth-page {
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 22px 18px;
}
body.h5-template-neon .auth-container {
    max-width: 470px;
}
body.h5-template-neon .auth-logo {
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid rgba(34,211,238,.28);
    border-radius: 18px;
    background: rgba(2,6,23,.58);
    text-align: left;
}
body.h5-template-neon .logo-icon {
    width: 54px;
    height: 54px;
    margin: 0;
    box-shadow: 0 0 22px rgba(34,211,238,.4), inset 0 0 20px rgba(168,85,247,.25);
}
body.h5-template-neon .auth-logo h1 {
    font-size: 26px;
    letter-spacing: 2px;
    color: #e0f2fe;
}
body.h5-template-neon .logo-sub {
    grid-column: 2;
    margin-top: -18px;
    color: rgba(125,211,252,.72);
}
body.h5-template-neon .auth-card {
    position: relative;
    border-radius: 10px;
    padding: 22px;
}
body.h5-template-neon .auth-card::before {
    content: "";
    position: absolute;
    inset: 9px 9px auto;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, transparent, #22d3ee, #a855f7, transparent);
}
body.h5-template-neon .auth-tabs {
    border: 1px solid rgba(34,211,238,.18);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
}
body.h5-template-neon .auth-tab { border-radius: 7px; }
body.h5-template-neon .form-group input,
body.h5-template-neon .form-group select {
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    border-color: rgba(34,211,238,.18);
    color: #e0f2fe;
}
body.h5-template-neon .form-group select option { background: #0f172a; color: #e0f2fe; }
body.h5-template-neon .reg-upload-label,
body.h5-template-neon .reg-avatar-upload span { color: rgba(226,232,240,.62); }
body.h5-template-neon .reg-avatar-upload,
body.h5-template-neon .reg-album-slot {
    background: rgba(15,23,42,.74);
    border-color: rgba(34,211,238,.18);
}
body.h5-template-neon .app-nav {
    border-top: 1px solid rgba(34,211,238,.16);
}
body.h5-template-neon .profile-header-card,
body.h5-template-neon .profile-section {
    background: rgba(15,23,42,.86);
    border: 1px solid rgba(34,211,238,.13);
    color: #eef6ff;
}
body.h5-template-neon .profile-section h3,
body.h5-template-neon .form-row label { color: #cbd5e1; }
body.h5-template-neon .form-row input,
body.h5-template-neon .form-row select,
body.h5-template-neon .form-row textarea {
    background: rgba(255,255,255,.06);
    border-color: rgba(148,163,184,.16);
    color: #eef6ff;
}

/* Template 4: 清氧海岸 - airy two-column landing + floating app chrome */
body.h5-template-fresh {
    --primary: #10b981;
    --primary-dark: #0f766e;
    --gradient: linear-gradient(135deg, #10b981 0%, #38bdf8 100%);
    --gradient-purple: linear-gradient(135deg, #38bdf8, #a7f3d0);
    --bg: #edfdfa;
    --card-bg: #ffffff;
    --text: #123333;
    --text-light: #5f7f7b;
    --shadow: 0 12px 32px rgba(15,118,110,.1);
    --shadow-lg: 0 28px 75px rgba(14,165,160,.2);
}
body.h5-template-fresh .auth-page {
    align-items: center;
    overflow-y: auto;
    padding: 28px 18px;
    background:
        radial-gradient(circle at 18% 18%, rgba(56,189,248,.34), transparent 32%),
        radial-gradient(circle at 88% 72%, rgba(16,185,129,.24), transparent 36%),
        linear-gradient(160deg, #f0fdfa 0%, #ecfeff 52%, #ffffff 100%);
}
body.h5-template-fresh .auth-container {
    width: min(760px, 94vw);
    max-width: 760px;
    display: grid;
    grid-template-columns: .9fr 1fr;
    align-items: center;
    gap: 22px;
}
body.h5-template-fresh .auth-logo {
    margin: 0;
    padding: 28px;
    border-radius: 32px;
    background: rgba(255,255,255,.64);
    border: 1px solid rgba(15,118,110,.1);
    text-align: left;
    box-shadow: 0 22px 60px rgba(15,118,110,.12);
}
body.h5-template-fresh .logo-icon {
    margin: 0 0 18px;
    background: linear-gradient(135deg, #10b981, #22d3ee);
}
body.h5-template-fresh .auth-logo h1 {
    color: #0f766e;
    font-size: 42px;
    letter-spacing: 4px;
}
body.h5-template-fresh .logo-sub { color: #4b7f79; }
body.h5-template-fresh .auth-card {
    padding: 26px;
    border-radius: 30px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(15,118,110,.1);
    box-shadow: 0 30px 80px rgba(14,116,144,.14);
}
body.h5-template-fresh .auth-tabs {
    background: #e7fbf7;
    border-radius: 18px;
}
body.h5-template-fresh .auth-tab { color: #5f7f7b; border-radius: 15px; }
body.h5-template-fresh .form-group input,
body.h5-template-fresh .form-group select {
    border-radius: 16px;
    background: #f4fffc;
    border-color: #d6f4ee;
    color: #123333;
}
body.h5-template-fresh .form-group input::placeholder { color: #8da6a3; }
body.h5-template-fresh .form-group i { color: #10b981; }
body.h5-template-fresh .form-group select option { background: #ffffff; color: #123333; }
body.h5-template-fresh .reg-upload-label,
body.h5-template-fresh .reg-avatar-upload span { color: #5f7f7b; }
body.h5-template-fresh .reg-avatar-upload,
body.h5-template-fresh .reg-album-slot {
    border-color: #b7eadf;
    background: #f4fffc;
}
body.h5-template-fresh .reg-avatar-upload i,
body.h5-template-fresh .reg-album-slot.empty i { color: #10b981; }
body.h5-template-fresh .app-page,
body.h5-template-fresh .chat-messages {
    background:
        radial-gradient(circle at 12% 10%, rgba(56,189,248,.18), transparent 30%),
        linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}
body.h5-template-fresh .app-header,
body.h5-template-fresh .app-nav,
body.h5-template-fresh .chat-header,
body.h5-template-fresh .chat-input-bar {
    margin: 10px 14px 0;
    border: 1px solid rgba(15,118,110,.08);
    border-radius: 22px;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 34px rgba(15,118,110,.08);
}
body.h5-template-fresh .app-nav {
    height: 62px;
    margin: 0 14px 12px;
    border-radius: 999px;
}
body.h5-template-fresh .swipe-card {
    border-radius: 36px;
    border: 10px solid rgba(255,255,255,.9);
}
body.h5-template-fresh .swipe-btn {
    background: #fff;
    border: 1px solid rgba(15,118,110,.08);
}
body.h5-template-fresh .chat-list { gap: 10px; padding: 4px 14px 14px; }
body.h5-template-fresh .chat-list-item,
body.h5-template-fresh .profile-section {
    padding: 14px;
    border: 1px solid rgba(15,118,110,.08);
    border-radius: 22px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 12px 28px rgba(15,118,110,.07);
}
body.h5-template-fresh .profile-header-card {
    margin: 14px 14px 0;
    border-radius: 30px;
}
body.h5-template-fresh .service-disclosure,
body.h5-template-fresh .chat-system-msg.guarantee {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

/* Template 5: 黑金轻奢 - premium dark editorial */
body.h5-template-luxe {
    --primary: #d6a95d;
    --primary-dark: #b8893d;
    --gradient: linear-gradient(135deg, #d6a95d 0%, #f8e2a6 52%, #a66f2f 100%);
    --gradient-purple: linear-gradient(135deg, #201713, #d6a95d);
    --bg: #0e0b09;
    --card-bg: #19130f;
    --text: #f8ead2;
    --text-light: #b7a58b;
    --shadow: 0 12px 32px rgba(0,0,0,.32);
    --shadow-lg: 0 28px 80px rgba(0,0,0,.55);
}
body.h5-template-luxe {
    background: #0e0b09;
}
body.h5-template-luxe .auth-page,
body.h5-template-luxe .app-page,
body.h5-template-luxe .chat-messages {
    background:
        radial-gradient(circle at 50% -8%, rgba(214,169,93,.2), transparent 35%),
        radial-gradient(circle at 88% 76%, rgba(166,111,47,.18), transparent 30%),
        linear-gradient(180deg, #16100d 0%, #0e0b09 100%);
}
body.h5-template-luxe .auth-page {
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 24px 18px;
}
body.h5-template-luxe .auth-container { max-width: 430px; }
body.h5-template-luxe .auth-logo {
    margin-bottom: 18px;
}
body.h5-template-luxe .logo-icon {
    background: #19130f;
    border: 1px solid rgba(214,169,93,.5);
    color: #f8e2a6;
    box-shadow: 0 0 0 8px rgba(214,169,93,.08);
}
body.h5-template-luxe .auth-logo h1 {
    color: #f8ead2;
    letter-spacing: 10px;
}
body.h5-template-luxe .logo-sub { color: rgba(248,226,166,.6); }
body.h5-template-luxe .auth-card,
body.h5-template-luxe .tenant-unavailable {
    padding: 26px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(34,26,20,.94), rgba(17,13,10,.94));
    border: 1px solid rgba(214,169,93,.26);
    box-shadow: 0 34px 90px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.04);
}
body.h5-template-luxe .auth-tabs {
    padding: 0;
    border-bottom: 1px solid rgba(214,169,93,.22);
    border-radius: 0;
    background: transparent;
}
body.h5-template-luxe .auth-tab {
    border-radius: 0;
    color: rgba(248,234,210,.48);
    letter-spacing: 2px;
}
body.h5-template-luxe .auth-tab.active {
    background: transparent;
    color: #f8e2a6;
    box-shadow: inset 0 -2px 0 #d6a95d;
}
body.h5-template-luxe .form-group input,
body.h5-template-luxe .form-group select {
    border-radius: 4px;
    background: rgba(0,0,0,.2);
    border-color: rgba(214,169,93,.18);
    color: #f8ead2;
}
body.h5-template-luxe .form-group input::placeholder { color: rgba(248,234,210,.36); }
body.h5-template-luxe .form-group i { color: #d6a95d; }
body.h5-template-luxe .form-group select option { background: #19130f; color: #f8ead2; }
body.h5-template-luxe .btn-primary,
body.h5-template-luxe .chat-send,
body.h5-template-luxe .chat-msg.sent .chat-bubble {
    background: linear-gradient(135deg, #b8893d, #f8e2a6);
    color: #1c130b;
}
body.h5-template-luxe .btn-guest {
    border-color: rgba(214,169,93,.32);
    color: #f8e2a6;
}
body.h5-template-luxe .reg-upload-label,
body.h5-template-luxe .reg-avatar-upload span,
body.h5-template-luxe .reg-upload-hint { color: rgba(248,234,210,.6); }
body.h5-template-luxe .reg-avatar-upload,
body.h5-template-luxe .reg-album-slot {
    background: rgba(0,0,0,.18);
    border-color: rgba(214,169,93,.22);
}
body.h5-template-luxe .reg-avatar-upload i,
body.h5-template-luxe .reg-album-slot.empty i { color: #d6a95d; }
body.h5-template-luxe .app-header,
body.h5-template-luxe .app-nav,
body.h5-template-luxe .chat-header,
body.h5-template-luxe .chat-input-bar {
    background: rgba(18,13,10,.94);
    border-color: rgba(214,169,93,.18);
    color: #f8ead2;
}
body.h5-template-luxe .app-title,
body.h5-template-luxe .nav-btn.active {
    background: linear-gradient(135deg, #f8e2a6, #b8893d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.h5-template-luxe .header-right .btn-icon,
body.h5-template-luxe .chat-back,
body.h5-template-luxe .chat-list-name,
body.h5-template-luxe .chat-header-info h3,
body.h5-template-luxe .page-title { color: #f8ead2; }
body.h5-template-luxe .lang-switcher-mini,
body.h5-template-luxe .chat-back,
body.h5-template-luxe .chat-input-bar input {
    background: rgba(255,255,255,.06);
}
body.h5-template-luxe .chat-input-bar input {
    border-color: rgba(214,169,93,.18);
    color: #f8ead2;
}
body.h5-template-luxe .swipe-card {
    max-width: 340px;
    border: 1px solid rgba(214,169,93,.34);
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0,0,0,.6), 0 0 0 8px rgba(214,169,93,.06);
}
body.h5-template-luxe .card-overlay {
    background: linear-gradient(transparent 0%, rgba(14,11,9,.45) 38%, rgba(14,11,9,.96));
}
body.h5-template-luxe .card-tag {
    border: 1px solid rgba(214,169,93,.34);
    background: rgba(214,169,93,.12);
    color: #f8e2a6;
}
body.h5-template-luxe .swipe-btn,
body.h5-template-luxe .chat-list-item,
body.h5-template-luxe .profile-header-card,
body.h5-template-luxe .profile-section,
body.h5-template-luxe .chat-msg.received .chat-bubble {
    background: rgba(25,19,15,.94);
    border: 1px solid rgba(214,169,93,.16);
    color: #f8ead2;
}
body.h5-template-luxe .chat-list {
    gap: 10px;
    padding: 0 14px 14px;
}
body.h5-template-luxe .chat-list-item { border-radius: 8px; padding: 13px; }
body.h5-template-luxe .chat-list-preview,
body.h5-template-luxe .chat-list-time,
body.h5-template-luxe .chat-msg-time,
body.h5-template-luxe .matches-empty,
body.h5-template-luxe .form-row label { color: #b7a58b; }
body.h5-template-luxe .form-row input,
body.h5-template-luxe .form-row select,
body.h5-template-luxe .form-row textarea {
    background: rgba(255,255,255,.06);
    border-color: rgba(214,169,93,.16);
    color: #f8ead2;
}
body.h5-template-luxe .service-disclosure,
body.h5-template-luxe .chat-system-msg.guarantee {
    background: rgba(214,169,93,.08);
    border-color: rgba(214,169,93,.26);
    color: #f8e2a6;
}

/* Template 6: 纸感杂志 - editorial paper layout */
body.h5-template-magazine {
    --primary: #111827;
    --primary-dark: #000000;
    --gradient: linear-gradient(135deg, #111827, #4b5563);
    --gradient-purple: linear-gradient(135deg, #111827, #b45309);
    --bg: #f1eadf;
    --card-bg: #fffaf1;
    --text: #161616;
    --text-light: #6b6258;
    --shadow: 0 10px 28px rgba(32,24,18,.1);
    --shadow-lg: 0 26px 70px rgba(32,24,18,.2);
    --radius: 6px;
    --radius-sm: 3px;
}
body.h5-template-magazine .auth-page {
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 26px 18px;
    background:
        linear-gradient(rgba(17,24,39,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17,24,39,.035) 1px, transparent 1px),
        #f1eadf;
    background-size: 28px 28px;
}
body.h5-template-magazine .auth-container {
    width: min(820px, 94vw);
    max-width: 820px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 0;
    padding: 10px;
    background: #fffaf1;
    border: 1px solid #111827;
    box-shadow: 12px 12px 0 rgba(17,24,39,.16);
}
body.h5-template-magazine .auth-logo {
    min-height: 380px;
    margin: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #111827;
    text-align: left;
}
body.h5-template-magazine .logo-icon {
    margin: 0;
    width: 52px;
    height: 52px;
    border-radius: 0;
    background: #111827;
    box-shadow: none;
}
body.h5-template-magazine .auth-logo h1 {
    color: #111827;
    font-size: 46px;
    letter-spacing: 2px;
    line-height: 1.05;
}
body.h5-template-magazine .logo-sub {
    color: #6b6258;
    letter-spacing: 4px;
    text-transform: uppercase;
}
body.h5-template-magazine .auth-card {
    padding: 26px;
    border: 1px solid #111827;
    border-left: 0;
    border-radius: 0;
    background: #fffaf1;
    box-shadow: none;
}
body.h5-template-magazine .auth-tabs {
    padding: 0;
    border: 1px solid #111827;
    border-radius: 0;
    background: transparent;
}
body.h5-template-magazine .auth-tab {
    border-radius: 0;
    color: #6b6258;
}
body.h5-template-magazine .auth-tab + .auth-tab { border-left: 1px solid #111827; }
body.h5-template-magazine .auth-tab.active {
    background: #111827;
    box-shadow: none;
    color: #fffaf1;
}
body.h5-template-magazine .form-group input,
body.h5-template-magazine .form-group select {
    padding-left: 14px;
    border: 1px solid #111827;
    border-radius: 0;
    background: #fffaf1;
    color: #111827;
}
body.h5-template-magazine .form-group i { display: none; }
body.h5-template-magazine .form-group input::placeholder { color: #8a8176; }
body.h5-template-magazine .form-group select option { background: #fffaf1; color: #111827; }
body.h5-template-magazine .btn-primary,
body.h5-template-magazine .btn-guest {
    border-radius: 0;
    box-shadow: none;
    letter-spacing: 2px;
}
body.h5-template-magazine .btn-guest {
    border-color: #111827;
    color: #111827;
    background: transparent;
}
body.h5-template-magazine .reg-upload-label,
body.h5-template-magazine .reg-avatar-upload span,
body.h5-template-magazine .reg-upload-hint { color: #6b6258; }
body.h5-template-magazine .reg-avatar-upload,
body.h5-template-magazine .reg-avatar-preview {
    border-radius: 0;
}
body.h5-template-magazine .reg-avatar-upload,
body.h5-template-magazine .reg-album-slot {
    border-color: #111827;
    background: #f8f1e8;
    border-radius: 0;
}
body.h5-template-magazine .reg-avatar-upload i,
body.h5-template-magazine .reg-album-slot.empty i { color: #111827; }
body.h5-template-magazine .app-page,
body.h5-template-magazine .chat-messages {
    background: #f1eadf;
}
body.h5-template-magazine .app-header,
body.h5-template-magazine .app-nav,
body.h5-template-magazine .chat-header,
body.h5-template-magazine .chat-input-bar {
    background: #fffaf1;
    border-color: #111827;
    box-shadow: none;
}
body.h5-template-magazine .app-header {
    border-bottom: 1px solid #111827;
}
body.h5-template-magazine .app-title {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: #111827;
    letter-spacing: 2px;
}
body.h5-template-magazine .swipe-container {
    align-items: flex-start;
    padding-top: 24px;
}
body.h5-template-magazine .swipe-card {
    max-width: 330px;
    border: 1px solid #111827;
    border-radius: 0;
    box-shadow: 10px 10px 0 rgba(17,24,39,.16);
}
body.h5-template-magazine .card-image { filter: saturate(.86) contrast(1.05); }
body.h5-template-magazine .card-overlay {
    padding: 78px 18px 18px;
    background: linear-gradient(transparent 0%, rgba(255,250,241,.82) 52%, rgba(255,250,241,.98));
    color: #111827;
}
body.h5-template-magazine .card-tag {
    border: 1px solid #111827;
    border-radius: 0;
    background: transparent;
    color: #111827;
}
body.h5-template-magazine .swipe-btn,
body.h5-template-magazine .chat-list-item,
body.h5-template-magazine .profile-section,
body.h5-template-magazine .profile-header-card,
body.h5-template-magazine .chat-msg.received .chat-bubble {
    border: 1px solid #111827;
    border-radius: 0;
    background: #fffaf1;
    box-shadow: none;
}
body.h5-template-magazine .swipe-btn { color: #111827; }
body.h5-template-magazine .chat-list { gap: 8px; padding: 0 14px 14px; }
body.h5-template-magazine .chat-list-item { padding: 12px; }
body.h5-template-magazine .chat-list-item img,
body.h5-template-magazine .chat-header-avatar,
body.h5-template-magazine .avatar-wrapper img { border-radius: 0; }
body.h5-template-magazine .chat-msg.sent .chat-bubble,
body.h5-template-magazine .chat-send {
    background: #111827;
    color: #fffaf1;
    border-radius: 0;
}
body.h5-template-magazine .chat-bubble,
body.h5-template-magazine .chat-input-bar input,
body.h5-template-magazine .form-row input,
body.h5-template-magazine .form-row select,
body.h5-template-magazine .form-row textarea {
    border-radius: 0;
}
body.h5-template-magazine .chat-input-bar input,
body.h5-template-magazine .form-row input,
body.h5-template-magazine .form-row select,
body.h5-template-magazine .form-row textarea {
    border: 1px solid #111827;
    background: #fffaf1;
    color: #111827;
}
body.h5-template-magazine .profile-header-card {
    margin: 14px 14px 0;
    color: #111827;
}
body.h5-template-magazine .service-disclosure,
body.h5-template-magazine .chat-system-msg.guarantee {
    background: #fff3cf;
    border-color: #111827;
    color: #3f2d10;
}

@media (max-width: 720px) {
    body.h5-template-fresh .auth-container,
    body.h5-template-magazine .auth-container {
        display: block;
        width: min(430px, 94vw);
    }
    body.h5-template-fresh .auth-logo,
    body.h5-template-magazine .auth-logo {
        min-height: auto;
        margin-bottom: 14px;
    }
    body.h5-template-magazine .auth-card {
        border-left: 1px solid #111827;
    }
}

@media (max-height: 740px) {
    body.h5-template-rose .auth-logo,
    body.h5-template-luxe .auth-logo {
        margin-bottom: 10px;
    }
    body.h5-template-rose .logo-icon,
    body.h5-template-luxe .logo-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    body.h5-template-rose .auth-card,
    body.h5-template-luxe .auth-card {
        padding: 18px;
    }
}
