/**
 * 全局主题覆盖（在页面 CSS 之后加载）
 * - data-accent="pink" | "blue"：已登录男性为蓝，其余为粉
 * - data-theme="light" | "dark"：深夜模式
 */

/* ========== 浅蓝系（仅男性用户、浅色模式） ========== */
html[data-accent="blue"] {
    --color-primary: #3b7fc4;
    --color-primary-hover: #2f68a8;
    --color-accent: #7eb8e8;
    --color-accent-hover: #5fa8e0;
    --color-price: #2d6ea8;
    --color-success: #3d7db8;
    --color-border: rgba(160, 200, 240, 0.55);
    --color-shadow: rgba(59, 127, 196, 0.1);
    --glass-bg: rgba(252, 253, 255, 0.52);
    --glass-border: rgba(255, 255, 255, 0.82);
    --glass-shadow: rgba(59, 127, 196, 0.12);
    --section-glass: rgba(248, 252, 255, 0.58);
    --light-warm: #f3f8ff;
    --light-sage: #f5f9ff;
    --light-mist: #f8fbff;
    --light-neutral: #f6faff;
    --light-border: rgba(170, 205, 245, 0.65);
}

html[data-accent="blue"] body {
    background: linear-gradient(165deg, #c4e0ff 0%, #e4f0ff 32%, #f7fbff 58%, #ffffff 100%);
}

html[data-accent="blue"] body::before {
    background: #8ec5fc;
}

html[data-accent="blue"] body::after {
    background: #a8d4ff;
}

html[data-accent="blue"] .main-content .section-light {
    background: linear-gradient(165deg, rgba(248, 252, 255, 0.75) 0%, rgba(232, 244, 255, 0.55) 100%);
}

html[data-accent="blue"] .main-content .section-light--warm {
    background: linear-gradient(165deg, rgba(245, 250, 255, 0.78) 0%, rgba(228, 240, 255, 0.55) 100%);
}

html[data-accent="blue"] .main-content .section-light--sage {
    background: linear-gradient(165deg, rgba(246, 251, 255, 0.78) 0%, rgba(230, 242, 255, 0.55) 100%);
}

html[data-accent="blue"] .main-content .section-light--mist {
    background: linear-gradient(165deg, rgba(248, 252, 255, 0.78) 0%, rgba(240, 248, 255, 0.55) 100%);
}

/* 首页蓝调光斑 */
html[data-accent="blue"] body.page-home .home-glass-bg {
    background: linear-gradient(135deg, #d4e8ff 0%, #eef6ff 38%, #fbfdff 72%, #f5f9ff 100%);
}

html[data-accent="blue"] body.page-home .home-glass-bg::before {
    background: #7eb8f0;
}

html[data-accent="blue"] body.page-home .home-glass-bg::after {
    background: #a8d0fc;
}

/* 登录注册蓝调 */
html[data-accent="blue"] body.page-auth .auth-bg-orbs {
    background: linear-gradient(145deg, #d4e8ff 0%, #e8f2ff 38%, #f8fbff 72%, #ffffff 100%);
}

html[data-accent="blue"] body.page-auth .auth-bg-orbs::before {
    background: linear-gradient(135deg, #6eb0f0, #8ec5fc);
}

html[data-accent="blue"] body.page-auth .auth-bg-orbs::after {
    background: linear-gradient(135deg, #a8d0fc, #b8d8ff);
}

/* ========== 深夜模式（与粉/蓝叠加） ========== */
html[data-theme="dark"] {
    --color-ink: #ebe6ef;
    --color-ink-muted: #9a90a0;
    --color-paper: #1e1c24;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-shadow: rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(26, 24, 32, 0.78);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.5);
    --section-glass: rgba(28, 26, 36, 0.82);
    --light-border: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"][data-accent="pink"] {
    --color-primary: #e894b0;
    --color-primary-hover: #f0a8c0;
    --color-accent: #c07090;
    --color-accent-hover: #d080a0;
    --color-price: #f0a0b8;
    --color-success: #e894b0;
}

html[data-theme="dark"][data-accent="blue"] {
    --color-primary: #6eb0f0;
    --color-primary-hover: #8ec0f8;
    --color-accent: #5080c0;
    --color-accent-hover: #6095d0;
    --color-price: #7eb8f0;
    --color-success: #6eb0f0;
}

html[data-theme="dark"] body {
    background: linear-gradient(165deg, #0c0a10 0%, #12141c 40%, #161820 100%);
    color: var(--color-ink);
}

html[data-theme="dark"] body::before {
    background: #4a2848;
    opacity: 0.25;
}

html[data-theme="dark"] body::after {
    background: #1a3050;
    opacity: 0.22;
}

html[data-theme="dark"][data-accent="blue"] body::before {
    background: #203a68;
}

html[data-theme="dark"][data-accent="blue"] body::after {
    background: #1a4060;
}

html[data-theme="dark"] .main-header {
    background: rgba(22, 20, 28, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .main-nav a {
    color: var(--color-ink-muted);
}

html[data-theme="dark"] .main-nav a:hover {
    color: var(--color-primary);
}

html[data-theme="dark"] .main-nav a.nav-active,
html[data-theme="dark"] .main-nav a.nav-active:hover {
    color: var(--color-primary);
}

html[data-theme="dark"] .main-nav a.nav-active::after {
    opacity: 1;
    box-shadow: 0 0 12px rgba(199, 91, 122, 0.35);
}

html[data-theme="dark"] .logo {
    color: var(--color-ink);
}

html[data-theme="dark"] .theme-toggle {
    background: rgba(40, 38, 48, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .theme-toggle:hover {
    background: rgba(50, 48, 58, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] body:not(.page-home):not(.page-auth) .main-content {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .main-content .section-light,
html[data-theme="dark"] .main-content .section-light--neutral,
html[data-theme="dark"] .main-content .section-light--warm,
html[data-theme="dark"] .main-content .section-light--sage,
html[data-theme="dark"] .main-content .section-light--mist {
    background: linear-gradient(165deg, rgba(34, 32, 42, 0.92) 0%, rgba(28, 26, 36, 0.88) 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] section:not(.hero),
html[data-theme="dark"] .auth-form,
html[data-theme="dark"] .publish-form,
html[data-theme="dark"] .chat-layout {
    background: var(--section-glass);
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .form-group select {
    background: rgba(36, 34, 44, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-ink);
}

html[data-theme="dark"] .page-back {
    background: rgba(36, 34, 44, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-primary);
}

html[data-theme="dark"] .main-footer {
    background: linear-gradient(180deg, #0a0810 0%, #050508 100%);
    color: #9a90a0;
}

html[data-theme="dark"] .footer-nav a {
    color: #8a8090;
}

html[data-theme="dark"] .footer-nav a:hover {
    color: #fff;
}

html[data-theme="dark"] .float-contact-panel {
    background: rgba(30, 28, 38, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .symbol-confirm-popover {
    background: rgba(30, 28, 38, 0.94);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

/* 首页仪表盘深色 */
html[data-theme="dark"] body.page-home .home-glass-bg {
    background: linear-gradient(135deg, #121018 0%, #16141c 45%, #0e0c12 100%);
}

html[data-theme="dark"] body.page-home .home-glass-bg::before,
html[data-theme="dark"] body.page-home .home-glass-bg::after {
    opacity: 0.3;
}

html[data-theme="dark"] body.page-home .glass-card {
    background: rgba(30, 28, 38, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] body.page-home .glass-section {
    background: rgba(28, 26, 36, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] body.page-home .glass-hero-title,
html[data-theme="dark"] body.page-home .section-heading h2,
html[data-theme="dark"] body.page-home .glass-cal-head {
    color: var(--color-ink);
}

html[data-theme="dark"] body.page-home .glass-hero-sub,
html[data-theme="dark"] body.page-home .section-heading-desc,
html[data-theme="dark"] body.page-home .glass-clock-date {
    color: var(--color-ink-muted);
}

html[data-theme="dark"] body.page-home .product-card,
html[data-theme="dark"] body.page-home .job-card,
html[data-theme="dark"] body.page-home .post-item {
    background: rgba(32, 30, 40, 0.75);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.page-home .product-image {
    background: linear-gradient(145deg, rgba(40, 38, 48, 0.9), rgba(30, 28, 38, 0.85));
}

/* 登录注册深色 */
html[data-theme="dark"] body.page-auth .auth-bg-orbs {
    background: linear-gradient(145deg, #120c14 0%, #16121c 50%, #0e0c12 100%);
}

html[data-theme="dark"] body.page-auth .auth-form {
    background: rgba(28, 26, 36, 0.75);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] body.page-auth .auth-form h1 {
    color: var(--color-ink);
}

html[data-theme="dark"] body.page-auth .form-group input,
html[data-theme="dark"] body.page-auth .form-group textarea,
html[data-theme="dark"] body.page-auth .form-group select {
    background: rgba(36, 34, 44, 0.9);
    color: var(--color-ink);
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .msg-badge {
    background: var(--color-price);
}

/* 实用工具页深色 */
html[data-theme="dark"] .tools-jump a {
    background: rgba(36, 34, 44, 0.75);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-ink-muted);
}

html[data-theme="dark"] .tool-card {
    background: rgba(32, 30, 40, 0.72);
    border-color: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(199, 91, 122, 0.35);
}

html[data-theme="dark"] .tool-card:hover {
    background: rgba(40, 38, 50, 0.88);
    border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .tools-search-input {
    background: rgba(36, 34, 44, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--color-ink);
}

html[data-theme="dark"] .tools-modal {
    background: rgba(32, 30, 40, 0.96);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .tools-modal-url {
    background: rgba(28, 26, 36, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .tools-modal-overlay {
    background: rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .btn-modal-back {
    background: rgba(40, 38, 50, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--color-ink-muted);
}

/* 详情页「感兴趣推荐」深色 */
html[data-theme="dark"] .detail-recommend {
    background: rgba(28, 26, 36, 0.82);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .detail-recommend h3 {
    color: var(--color-ink);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .detail-rec-item a {
    background: rgba(36, 34, 44, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-ink);
}

html[data-theme="dark"] .detail-rec-item a:hover {
    border-color: rgba(199, 91, 122, 0.45);
    color: var(--color-primary);
}

/* ========== 积分奖励弹层 ========== */
.points-toast-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 12, 24, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: pointsToastFadeIn 0.25s ease;
}
@keyframes pointsToastFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.points-toast {
    position: relative;
    max-width: 320px;
    width: 100%;
    padding: 28px 22px 22px;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(255, 252, 245, 0.98), rgba(255, 245, 250, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 20px 50px rgba(180, 120, 90, 0.2), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    text-align: center;
}
html[data-theme="dark"] .points-toast {
    background: linear-gradient(160deg, rgba(42, 38, 48, 0.96), rgba(36, 32, 42, 0.96));
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5);
}
.points-toast-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
html[data-theme="dark"] .points-toast-close {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-ink-muted);
}
.points-toast-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 8px;
}
.points-toast-title {
    font-weight: 700;
    font-size: 17px;
    margin: 0 0 8px;
    color: var(--color-ink);
}
.points-toast-msg {
    font-size: 13px;
    color: var(--color-ink-muted);
    margin: 0 0 12px;
    line-height: 1.45;
}
.points-toast-delta {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #c75b7a;
}
html[data-accent="blue"] .points-toast-delta {
    color: #3b7fc4;
}
