/* 六合彩开奖网站样式 - 支持 H5 自适应 */
:root {
    --primary: #c41e3a;
    --primary-dark: #9a1830;
    --success: #34a853;
    --warning: #fbbc04;
    --error: #ea4335;
    --ball-size: 48px;
    --ball-square-width: 68px;
    --ball-square-height: 78px;
}

/* 前台主题变量 - 默认明亮（html 无 data-theme 或未设置 dark 时） */
.front-page {
    --gold: #d4a017;
    --bg: #0f1419;
    --card-bg: #1a2332;
    --text: #e8eaed;
    --text-muted: #9aa0a6;
    --border: #2d3748;
    --surface: #1a2332;
    --surface-muted: rgba(0, 0, 0, 0.2);
    --surface-subtle: rgba(255, 255, 255, 0.08);
    --hover-bg: #222b3a;
    --badge-bg: rgba(212, 160, 23, 0.15);
    --tag-bg: rgba(212, 160, 23, 0.2);
    --tag-color: #d4a017;
    --tag-border: rgba(212, 160, 23, 0.35);
    --countdown-bg: rgba(251, 188, 4, 0.08);
    --countdown-border: transparent;
    --countdown-wait-bg: rgba(196, 30, 58, 0.12);
    --countdown-wait-border: rgba(196, 30, 58, 0.25);
    --countdown-label: #fbbc04;
    --countdown-timer: #fbbc04;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --soft-shadow: none;
    --tab-shadow: none;
    --scroll-track: rgba(255, 255, 255, 0.06);
    --scroll-thumb: rgba(212, 160, 23, 0.42);
    --scroll-thumb-hover: rgba(212, 160, 23, 0.72);
    --scroll-thumb-border: rgba(15, 20, 25, 0.85);
}

html[data-theme="light"] .front-page {
    --gold: #b45309;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --surface: #ffffff;
    --surface-muted: #f9fafb;
    --surface-subtle: #f3f4f6;
    --hover-bg: #fef2f2;
    --badge-bg: #fee2e2;
    --tag-bg: #fef3c7;
    --tag-color: #92400e;
    --tag-border: #fcd34d;
    --countdown-bg: #fffbeb;
    --countdown-border: #fde68a;
    --countdown-wait-bg: #fef2f2;
    --countdown-wait-border: #fecaca;
    --countdown-label: #b45309;
    --countdown-timer: #d97706;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --soft-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    --tab-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --scroll-track: #eceff3;
    --scroll-thumb: rgba(180, 83, 9, 0.38);
    --scroll-thumb-hover: rgba(180, 83, 9, 0.62);
    --scroll-thumb-border: rgba(255, 255, 255, 0.9);
}

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

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* ===== 前台 ===== */
.front-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }

.theme-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text);
    font-size: .8rem;
    cursor: pointer;
    box-shadow: var(--soft-shadow);
    transition: background .2s, border-color .2s, color .2s;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.site-header {
    background: transparent;
    padding: 16px 0 2px;
    text-align: center;
    box-shadow: none;
}

.site-brand {
    max-width: 640px;
    margin: 0 auto;
}

.site-brand-inner {
    position: relative;
    padding: 18px 16px 16px;
    border-radius: 12px;
    background: linear-gradient(165deg, var(--card-bg) 0%, var(--surface-muted) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.site-brand-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 52%, var(--primary-dark) 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.site-brand-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--primary), var(--gold), transparent);
    opacity: 0.85;
}

.site-title {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.35;
    word-break: break-word;
    letter-spacing: 0.04em;
    background: linear-gradient(
        90deg,
        #ff0040 0%,
        #ff6b00 10%,
        #ffd000 20%,
        #00c853 30%,
        #00b0ff 40%,
        #651fff 50%,
        #ff4081 60%,
        var(--primary) 70%,
        var(--gold) 80%,
        #ff0040 100%
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation:
        site-title-gradient-shift 3s linear infinite,
        site-title-hue-cycle 4.5s ease-in-out infinite;
}

html[data-theme="light"] .site-title {
    background: linear-gradient(
        90deg,
        #c41e3a 0%,
        #ff1744 8%,
        #ff6d00 18%,
        #ffb300 28%,
        #00c853 38%,
        #0091ea 48%,
        #6200ea 58%,
        #ff4081 68%,
        #d50000 78%,
        #ff9100 88%,
        #c41e3a 100%
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation:
        site-title-gradient-shift 2.8s linear infinite,
        site-title-hue-cycle 4s ease-in-out infinite,
        site-title-light-glow 3s ease-in-out infinite;
}

html[data-theme="dark"] .site-title {
    background: linear-gradient(
        90deg,
        #ff4757 0%,
        #ffa502 12%,
        #ffd700 24%,
        #7bed9f 36%,
        #70a1ff 48%,
        #ff6b81 60%,
        #ff4757 72%,
        #ffd700 84%,
        #ff6348 100%
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation:
        site-title-gradient-shift 3s linear infinite,
        site-title-hue-cycle 4.5s ease-in-out infinite,
        site-title-glow-pulse 2.8s ease-in-out infinite;
}

@keyframes site-title-gradient-shift {
    0% { background-position: 0% center; }
    100% { background-position: 400% center; }
}

@keyframes site-title-hue-cycle {
    0%, 100% { filter: hue-rotate(0deg) saturate(1.2) brightness(1); }
    33% { filter: hue-rotate(18deg) saturate(1.45) brightness(1.06); }
    66% { filter: hue-rotate(-12deg) saturate(1.35) brightness(1.03); }
}

@keyframes site-title-light-glow {
    0%, 100% { filter: hue-rotate(0deg) saturate(1.3) brightness(1); }
    50% { filter: hue-rotate(22deg) saturate(1.55) brightness(1.06); }
}

@keyframes site-title-glow-pulse {
    0%, 100% { text-shadow: 0 0 8px rgba(255, 107, 122, 0.25); }
    50% { text-shadow: 0 0 16px rgba(255, 215, 0, 0.35), 0 0 24px rgba(255, 71, 87, 0.2); }
}

@media (prefers-reduced-motion: reduce) {
    .site-title {
        animation: none;
        background-size: 100% auto;
        filter: none;
        text-shadow: none;
    }
}

.site-almanac-line {
    position: relative;
    z-index: 1;
    display: inline-block;
    max-width: 100%;
    margin: 10px auto 4px;
    padding: 9px 18px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: 0.04em;
    color: var(--tag-color);
    word-break: break-word;
    text-align: center;
    border-radius: 999px;
    background: linear-gradient(165deg, var(--surface-subtle) 0%, var(--tag-bg) 100%);
    box-shadow:
        var(--soft-shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.site-almanac-line::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 52%, var(--primary-dark) 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.9;
}

html[data-theme="light"] .site-almanac-line {
    color: #8b4513;
    background: linear-gradient(165deg, #fffdf8 0%, #fef3c7 100%);
    box-shadow:
        0 2px 8px rgba(180, 83, 9, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html[data-theme="dark"] .site-almanac-line {
    color: #f0c674;
    background: linear-gradient(165deg, rgba(212, 160, 23, 0.12) 0%, rgba(196, 30, 58, 0.1) 100%);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-lottery-tags {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.site-lottery-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--tag-color);
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: var(--soft-shadow);
}

html[data-theme="dark"] .site-brand-inner {
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.content-slot { margin-top: 12px; }
.content-slot-header {
    max-width: 640px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 10px;
    margin-bottom: 0;
}
.content-slot-history {
    max-width: 640px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 32px;
}

.content-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--soft-shadow);
}

.content-block:last-child { margin-bottom: 0; }

.content-ads {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
    justify-content: flex-start;
}

.content-block.content-ads {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 14px;
    box-shadow: var(--soft-shadow);
}

.content-ad-item {
    color: inherit;
    text-decoration: none;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.content-ad-text-wrap {
    position: relative;
    flex: 1 1 calc((100% - 20px) / 3);
    max-width: 100%;
    min-width: 0;
    width: auto;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.content-ad-text-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 1.5px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--gold) 50%, var(--primary-dark) 100%);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.content-ad-text-wrap::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 6px;
    border: 1px solid rgba(196, 30, 58, 0.12);
    pointer-events: none;
}

html[data-theme="dark"] .content-ad-text-wrap {
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .content-ad-text-wrap::after {
    border-color: rgba(212, 160, 23, 0.28);
}

.content-ad-link.content-ad-text-wrap:hover {
    transform: translateY(-1px);
    box-shadow:
        0 6px 18px rgba(196, 30, 58, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] .content-ad-link.content-ad-text-wrap:hover {
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.content-ad-image-wrap {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: var(--soft-shadow);
}

.content-ad-link:hover { opacity: .9; }

.content-ad-title {
    font-size: .8rem;
    color: var(--primary);
    margin-bottom: 6px;
    font-weight: 600;
    text-align: center;
}

.content-ad-text {
    font-size: 18px;
    line-height: 1.5;
    word-break: break-word;
    text-align: center;
}

.content-ad-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.content-block.content-predictions {
    text-align: left;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--soft-shadow);
}

.content-block.content-predictions + .content-block.content-predictions {
    margin-top: 10px;
}

.content-block.content-predictions + .content-block.content-chart-image,
.content-block.content-chart-image + .content-block.content-predictions,
.content-block.content-chart-image + .content-block.content-chart-image {
    margin-top: 10px;
}

.content-predictions-title {
    font-size: .85rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.prediction-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.prediction-item:last-child { border-bottom: none; padding-bottom: 0; }

.prediction-period {
    font-size: .8rem;
    color: var(--text-muted);
    min-width: 56px;
}

.prediction-zodiacs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.zodiac-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: .75rem;
    background: var(--tag-bg);
    color: var(--tag-color);
    border: 1px solid var(--tag-border);
}

.zodiac-tag.wave-red { background: rgba(220, 53, 69, .15); color: #ff6b7a; border-color: rgba(220, 53, 69, .35); }
.zodiac-tag.wave-blue { background: rgba(13, 110, 253, .15); color: #6ea8fe; border-color: rgba(13, 110, 253, .35); }
.zodiac-tag.wave-green { background: rgba(25, 135, 84, .15); color: #75d99a; border-color: rgba(25, 135, 84, .35); }
.zodiac-tag.element-metal { background: rgba(212, 160, 23, .15); color: #d4a017; border-color: rgba(212, 160, 23, .4); font-weight: 700; }
.zodiac-tag.element-wood { background: rgba(46, 170, 46, .15); color: #2eaa2e; border-color: rgba(46, 170, 46, .4); font-weight: 700; }
.zodiac-tag.element-water { background: rgba(33, 150, 243, .15); color: #2196f3; border-color: rgba(33, 150, 243, .4); font-weight: 700; }
.zodiac-tag.element-fire { background: rgba(229, 57, 53, .15); color: #e53935; border-color: rgba(229, 57, 53, .4); font-weight: 700; }
.zodiac-tag.element-earth { background: rgba(184, 115, 51, .15); color: #b87333; border-color: rgba(184, 115, 51, .4); font-weight: 700; }
.zodiac-tag.number-tag { font-family: monospace; letter-spacing: .03em; }
.zodiac-tag.tail-tag {
    min-width: 28px;
    text-align: center;
    font-family: monospace;
    font-weight: 700;
}

.content-block.content-predictions-tail {
    padding: 0;
    overflow: hidden;
    background: #1a9a4a;
    border: 1px solid #157a3c;
    border-radius: 6px;
}

.tail-predict-header {
    padding: 10px 12px;
    text-align: center;
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #2fbf6a 0%, #1a9a4a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.tail-predict-list {
    background: #1a9a4a;
}

.tail-predict-row {
    padding: 8px 12px;
    font-size: .88rem;
    line-height: 1.6;
    color: #111;
    border-bottom: 1px solid rgba(255, 255, 255, .35);
}

.tail-predict-row:last-child {
    border-bottom: none;
}

.tail-period {
    font-weight: 700;
}

.tail-label,
.tail-bracket {
    color: #d40000;
    font-weight: 700;
}

.tail-open {
    color: #111;
}

.tail-digit-hit {
    display: inline-block;
    padding: 0 3px;
    background: #ffeb3b;
    color: #d40000;
    font-weight: 700;
}

.tail-hit-mark,
.zodiac-hit-mark,
.prediction-hit-mark:not(.prediction-pending-mark) {
    display: inline-block;
    padding: 1px 6px;
    color: #d40000;
    font-weight: 700;
    background: #ffeb3b;
    border-radius: 3px;
    line-height: 1.3;
}

.prediction-hit-mark {
    margin-left: 4px;
}

.prediction-pending-mark {
    color: var(--text-muted, #888);
    font-weight: 400;
    background: transparent;
    padding: 0;
}

.content-block.content-predictions-zodiac {
    padding: 0;
    overflow: hidden;
    background: #1a9a4a;
    border: 1px solid #157a3c;
    border-radius: 6px;
}

.zodiac-predict-header {
    padding: 10px 12px;
    text-align: center;
    font-size: .95rem;
    font-weight: 700;
    color: #d40000;
    background: linear-gradient(180deg, #2fbf6a 0%, #1a9a4a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .25);
}

.zodiac-predict-list {
    background: #1a9a4a;
}

.zodiac-predict-row {
    padding: 8px 12px;
    font-size: .88rem;
    line-height: 1.6;
    color: #111;
    border-bottom: 1px solid rgba(255, 255, 255, .35);
}

.zodiac-predict-row:last-child {
    border-bottom: none;
}

.zodiac-period,
.zodiac-label {
    font-weight: 700;
}

.zodiac-bracket {
    display: inline-block;
    padding: 0 4px;
    color: #d40000;
    font-weight: 700;
    background: #ffeb3b;
}

.zodiac-open {
    color: #1565c0;
    font-weight: 700;
}

.zodiac-char-hit {
    display: inline-block;
    padding: 0 2px;
    background: #ff9800;
    color: #d40000;
    font-weight: 700;
}

.content-block.content-predictions-zodiac {
    color: var(--text-muted, #888);
}

.content-block.content-chart-image {
    margin-top: 10px;
    padding: 0;
    overflow: hidden;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--soft-shadow);
}

.content-block.content-reference-gallery {
    margin-top: 10px;
    padding: 0;
    overflow: hidden;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--soft-shadow);
}

.reference-gallery-wrap {
    position: relative;
    line-height: 0;
    cursor: zoom-in;
}

.reference-gallery-image {
    display: block;
    width: 100%;
    height: auto;
}

.gallery-admin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.gallery-admin-item {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.gallery-admin-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.gallery-admin-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    font-size: .8125rem;
}

.gallery-upload-form {
    margin-top: 12px;
}

.chart-images-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-images-list .content-block.content-chart-image {
    margin-top: 0;
}

.chart-images-list .content-block.content-chart-image:first-child {
    margin-top: 10px;
}

.chart-image-wrap {
    position: relative;
    line-height: 0;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
}

.chart-image-zoomable {
    cursor: zoom-in;
}

.chart-image-zoomable:hover .chart-zoom-hint {
    opacity: 1;
}

.chart-zoom-hint {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: .72rem;
    line-height: 1.2;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}

.chart-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

img.chart-lightbox-zoomed {
    position: fixed;
    z-index: 10002;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto !important;
    height: auto !important;
    max-width: 96vw;
    max-height: calc(92vh - 60px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .45);
    cursor: zoom-out;
}

.chart-period-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(212, 0, 0, .88);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.chart-image-title {
    padding: 8px 12px;
    text-align: center;
    font-size: .85rem;
    color: var(--text-muted, #666);
    border-top: 1px solid var(--border, #ddd);
}

body.chart-lightbox-open {
    overflow: hidden;
}

.chart-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.chart-lightbox[hidden] {
    display: none !important;
}

.chart-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .82);
}

.chart-lightbox-panel {
    position: relative;
    z-index: 1;
    max-width: min(96vw, 920px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-lightbox-img {
    max-width: 100%;
    max-height: calc(92vh - 60px);
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .45);
}

.chart-lightbox-caption {
    margin-top: 10px;
    color: #fff;
    font-size: .95rem;
    text-align: center;
    position: relative;
    z-index: 10003;
}

.chart-lightbox-close {
    position: absolute;
    top: -12px;
    right: -8px;
    z-index: 10003;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #222;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.chart-lightbox-close:hover {
    background: #fff;
}

/* 号码对照表（玄机图下方） */
.content-reference-tables {
    margin-top: 10px;
    padding: 10px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--soft-shadow);
}

html[data-theme="dark"] .content-reference-tables {
    background: var(--card-bg, #1a2332);
    border-color: var(--border, #2d3748);
}

.ref-table-section {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg, #fff);
}

html[data-theme="dark"] .ref-table-section {
    background: var(--card-bg, #1a2332);
    border-color: var(--border, #2d3748);
}

.ref-table-section + .ref-table-section {
    margin-top: 10px;
}

html[data-theme="dark"] .ref-table-section + .ref-table-section {
    margin-top: 10px;
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .82rem;
}

.ref-table-head {
    text-align: center;
    padding: 8px 10px;
    background: #f5f5f5;
    color: #333;
    font-weight: 700;
    border-bottom: 1px solid #ddd;
}

html[data-theme="dark"] .ref-table-head {
    background: var(--surface-subtle, rgba(255,255,255,.06));
    color: var(--text, #e8eaed);
    border-bottom-color: var(--border, #2d3748);
}

.ref-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

html[data-theme="dark"] .ref-table td {
    border-bottom-color: var(--border, #2d3748);
}

.ref-table tr:last-child td {
    border-bottom: none;
}

.ref-row-label {
    width: 52px;
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
    color: #333;
}

html[data-theme="dark"] .ref-row-label {
    color: var(--text, #e8eaed);
}

.ref-label-metal { color: #d4a017; }
.ref-label-wood { color: #2eaa2e; }
.ref-label-water { color: #2196f3; }
.ref-label-fire { color: #e53935; }
.ref-label-earth { color: #b87333; }
.ref-label-red { color: #e53935; }
.ref-label-blue { color: #1e88e5; text-decoration: underline; }
.ref-label-green { color: #43a047; }

.ref-row-nums {
    line-height: 0;
}

.ref-num {
    display: inline-block;
    min-width: 26px;
    height: 22px;
    line-height: 22px;
    margin: 2px 1px;
    padding: 0 2px;
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
    border-radius: 2px;
    vertical-align: middle;
}

.ref-num-red { background: #e53935; }
.ref-num-blue { background: #1e88e5; }
.ref-num-green { background: #43a047; }

.ref-table-sum {
    table-layout: fixed;
}

.ref-table-sum td {
    padding: 0;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

html[data-theme="dark"] .ref-table-sum td {
    border-bottom-color: var(--border, #2d3748);
}

.ref-table-sum tr:last-child td {
    border-bottom: none;
}

.ref-table-sum .ref-row-label {
    width: 72px;
    min-width: 72px;
    padding: 8px 6px;
    text-align: center;
    font-weight: 700;
    color: #1e88e5;
    text-decoration: underline;
    border-right: 1px solid #e0e0e0;
    white-space: nowrap;
    vertical-align: middle;
}

html[data-theme="dark"] .ref-table-sum .ref-row-label {
    color: #64b5f6;
    border-right-color: var(--border, #2d3748);
}

.ref-table-sum td.ref-row-nums {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    line-height: normal;
}

.ref-table-sum .ref-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-size: .74rem;
    font-weight: 700;
    border-radius: 3px;
}

.ref-attr-text,
.ref-attr-inline-row {
    color: #222;
    line-height: 1.6;
}

.ref-attr-inline-row {
    text-align: center;
    padding: 8px 10px !important;
}

.ref-attr-inline-row .ref-attr-inline-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 14px;
}

.ref-attr-inline-row .ref-row-label {
    width: auto;
    display: inline;
    text-decoration: underline;
}

html[data-theme="dark"] .ref-attr-text,
html[data-theme="dark"] .ref-attr-inline-row {
    color: var(--text, #e8eaed);
}

.ref-attr-inline {
    white-space: nowrap;
}

.ref-zodiac-grid-cell {
    padding: 10px 8px !important;
}

.ref-zodiac-grid {
    display: grid;
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 10px 8px;
}

.ref-zodiac-item {
    min-width: 0;
}

.ref-zodiac-head {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.ref-zodiac-name {
    font-weight: 700;
    color: #333;
}

html[data-theme="dark"] .ref-zodiac-name {
    color: var(--text, #e8eaed);
}

.ref-zodiac-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
}

.ref-zodiac-clash {
    font-size: .75rem;
    color: #666;
}

html[data-theme="dark"] .ref-zodiac-clash {
    color: var(--text-muted, #9aa0a6);
}

.ref-zodiac-nums {
    line-height: 0;
}

@media (max-width: 480px) {
    .ref-zodiac-grid {
        grid-template-rows: repeat(6, auto);
        grid-auto-columns: minmax(0, 1fr);
    }

    .ref-num {
        min-width: 24px;
        height: 20px;
        line-height: 20px;
        font-size: .68rem;
    }

    .ref-table-sum .ref-row-label {
        width: 58px;
        min-width: 58px;
        padding: 6px 4px;
        font-size: .78rem;
    }

    .ref-table-sum td.ref-row-nums {
        gap: 1px;
        padding: 4px 5px;
    }

    .ref-table-sum .ref-num {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: .66rem;
    }
}

.lottery-panel,
.history-section {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.lottery-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px 14px 14px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
    margin: 2px auto 6px;
}

.lottery-panel .lottery-tabs {
    margin-top: 0;
}

.lottery-panel .lottery-tabs.tabs {
    margin-bottom: 10px;
    padding-bottom: 0;
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
}

.lottery-panel .lottery-tabs .tab {
    flex: 1 1 0;
    min-width: 0;
    padding: clamp(8px, 2vw, 10px) clamp(4px, 1.5vw, 8px);
    font-size: clamp(0.65rem, 2.6vw, 0.875rem);
    white-space: normal;
    line-height: 1.25;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.lottery-result {
    width: 100%;
}

.lottery-result-inner .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
}

.lottery-result-inner .card-header-result {
    align-items: center;
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.lottery-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 4px 0 24px;
}

.lottery-board.single {
    grid-template-columns: 1fr;
    margin-top: 2px;
}

.lottery-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.lottery-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.lottery-card .card-header-result {
    align-items: center;
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.result-headline {
    font-size: .95rem;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}

.result-period {
    color: var(--primary);
    font-weight: 700;
}

.result-countdown-box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    white-space: nowrap;
}

.result-countdown-label {
    font-size: .82rem;
    color: var(--text);
}

.result-countdown-timer {
    font-size: .95rem;
    font-weight: 700;
    font-family: "Courier New", monospace;
    color: var(--primary);
    letter-spacing: .5px;
}

.lottery-card h2 { font-size: 1.1rem; color: var(--gold); }

.period-badge {
    background: var(--badge-bg);
    color: var(--gold);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .8rem;
    white-space: nowrap;
}

.result-status {
    text-align: center;
    color: var(--text-muted);
    font-size: .8rem;
    margin-bottom: 10px;
}

.balls-row {
    display: flex;
    flex-wrap: nowrap;
    gap: clamp(3px, 1.2vw, 8px);
    align-items: stretch;
    justify-content: center;
    width: 100%;
    padding: 2px 0;
    box-sizing: border-box;
}

.lottery-panel .balls-row .ball {
    flex: 1 1 0;
    flex-shrink: 1;
    min-width: 0;
    width: 0;
    height: auto;
    aspect-ratio: 34 / 39;
    max-width: var(--ball-square-width);
    padding: clamp(4px, 1.2vw, 8px) clamp(2px, 0.6vw, 5px) clamp(3px, 0.8vw, 5px);
}

.lottery-panel .balls-row .ball .num {
    font-size: clamp(0.82rem, 4.5vw, 1.6rem);
}

.lottery-panel .balls-row .ball .ball-meta {
    min-height: clamp(14px, 3.8vw, 24px);
    padding: clamp(1px, 0.4vw, 3px) 0;
}

.lottery-panel .balls-row .ball .ball-meta-text {
    font-size: clamp(0.52rem, 2.4vw, 0.82rem);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lottery-panel .balls-row .ball-plus {
    flex: 0 0 auto;
    font-size: clamp(0.85rem, 3.8vw, 1.6rem);
    margin: 0 clamp(1px, 0.4vw, 4px);
    align-self: center;
}

.lottery-panel .balls-row .ball-reveal-pending {
    background: linear-gradient(145deg, #4a5568 0%, #2d3748 100%);
    color: #fbbf24;
    border: 2px dashed rgba(251, 191, 36, .55);
    animation: ball-reveal-pulse 1.2s ease-in-out infinite;
}

.lottery-panel .balls-row .ball-reveal-pending .num {
    font-size: 1.35rem;
}

@keyframes ball-reveal-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .82; transform: scale(.96); }
}

.ball {
    width: var(--ball-square-width);
    height: var(--ball-square-height);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-weight: 700;
    flex-shrink: 0;
    padding: 8px 5px 5px;
    box-sizing: border-box;
    overflow: hidden;
}

.ball .num {
    font-size: 1.5rem;
    line-height: 1.1;
    color: #fff;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ball.red { background: #e53935; color: #fff; }
.ball.blue { background: #1e88e5; color: #fff; }
.ball.green { background: #43a047; color: #fff; }

.ball .ball-meta {
    width: 100%;
    background: #fff;
    border-radius: 5px;
    padding: 3px 0;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ball .ball-meta-text {
    font-size: .78rem;
    font-weight: 600;
    color: #222;
    line-height: 1.1;
    white-space: nowrap;
}

.ball.special {
    border: none;
    box-shadow: none;
}

.ball-plus {
    font-size: 1.6rem;
    color: var(--text);
    margin: 0 6px;
    flex-shrink: 0;
    font-weight: 700;
}

.countdown-box {
    text-align: center;
    padding: 14px;
    background: var(--countdown-bg);
    border: 1px solid var(--countdown-border);
    border-radius: 10px;
    margin-top: 12px;
}

.countdown-box.waiting-new {
    background: var(--countdown-wait-bg);
    border: 1px solid var(--countdown-wait-border);
}

.countdown-box .label { color: var(--countdown-label); font-size: .8rem; }
.countdown-box.waiting-new .label { color: #ff8a80; }

html[data-theme="dark"] .countdown-box.waiting-new .label { color: #ff8a80; }
html[data-theme="light"] .countdown-box.waiting-new .label { color: var(--primary); }

.countdown-box .timer {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: "Courier New", monospace;
    color: var(--countdown-timer);
    letter-spacing: 1px;
    margin: 4px 0;
}

.countdown-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.draw-time { text-align: center; color: var(--text-muted); font-size: .8rem; margin-top: 10px; }

.no-data { text-align: center; color: var(--text-muted); padding: 30px 16px; font-size: .9rem; }

/* 历史记录 - 折叠展开 */
.history-section { margin: 4px auto 6px; flex: 1; }

.history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-size: .95rem;
    transition: background .2s, border-color .2s;
    box-shadow: var(--soft-shadow);
}

.history-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--gold);
}

.history-toggle-title {
    color: var(--gold);
    font-weight: 600;
}

.history-toggle-hint {
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 400;
}

.history-toggle-icon {
    margin-left: auto;
    font-size: .75rem;
    color: var(--text-muted);
    transition: transform .25s ease;
}

.history-toggle[aria-expanded="true"] .history-toggle-icon {
    transform: rotate(180deg);
}

.history-panel {
    overflow: hidden;
    max-height: 80vh;
    opacity: 1;
    transition: max-height .35s ease, opacity .25s ease, margin .35s ease;
    margin-top: 12px;
}

.history-panel.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
}

.history-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 16px;
    font-size: .875rem;
    margin: 10px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.section-title {
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 12px;
    padding-left: 4px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.tab {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    font-size: .875rem;
    white-space: nowrap;
    text-align: center;
    box-shadow: var(--tab-shadow);
}

.tab.active, .tab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.25);
}

.history-list {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}

.history-title { color: var(--gold); font-weight: 600; }
.history-count { color: var(--text-muted); }

.history-scroll {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
    padding: 10px;
}

/* 历史记录滚动条 - WebKit */
.history-scroll::-webkit-scrollbar {
    width: 10px;
}

.history-scroll::-webkit-scrollbar-track {
    margin: 10px 2px;
    background: var(--scroll-track);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .history-scroll::-webkit-scrollbar-track {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.history-scroll::-webkit-scrollbar-thumb {
    min-height: 48px;
    border-radius: 999px;
    border: 2px solid var(--scroll-thumb-border);
    background: linear-gradient(180deg, var(--gold) 0%, var(--primary) 100%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.history-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--scroll-thumb-hover) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.28);
}

.history-scroll::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.history-scroll::-webkit-scrollbar-corner {
    background: transparent;
}

.history-item {
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--soft-shadow);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.history-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface-subtle);
    font-size: .7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.history-item .period { color: var(--gold); font-weight: 600; font-size: .875rem; }
.history-item .time { color: var(--text-muted); font-size: .75rem; margin-left: auto; }

.history-item .mini-balls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.mini-ball {
    width: 38px;
    height: 44px;
    border-radius: 6px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-weight: 700;
    padding: 3px 2px 2px;
    box-sizing: border-box;
    overflow: hidden;
    vertical-align: middle;
    flex-shrink: 0;
}

.mini-ball .mini-num {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    color: #fff;
    line-height: 1;
}

.mini-ball .mini-meta {
    width: 100%;
    background: #fff;
    border-radius: 3px;
    font-size: .48rem;
    font-weight: 600;
    color: #222;
    text-align: center;
    line-height: 1.1;
    padding: 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-ball.red { background: #e53935; }
.mini-ball.blue { background: #1e88e5; }
.mini-ball.green { background: #43a047; }
.mini-ball.special {
    border: none;
    box-shadow: none;
}

/* 号码预测保持圆形，不受开奖方形样式影响 */
.mini-ball.prediction-num-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
    overflow: visible;
}

.mini-ball.prediction-num-ball.red { background: linear-gradient(145deg, #ff4757, #c0392b); }
.mini-ball.prediction-num-ball.blue { background: linear-gradient(145deg, #3498db, #2980b9); }
.mini-ball.prediction-num-ball.green { background: linear-gradient(145deg, #2ecc71, #27ae60); }

.site-footer {
    text-align: center;
    padding: 20px 16px;
    color: var(--text-muted);
    font-size: .8rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
    background: var(--surface);
}

.loading { text-align: center; padding: 40px 16px; color: var(--text-muted); }

/* ===== 后台 H5 自适应 ===== */
.admin-body { background: #f0f2f5; color: #333; min-height: 100vh; }

.admin-nav {
    background: #001529;
    color: #fff;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
    min-height: 56px;
}

.nav-brand {
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
    text-align: center;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.nav-links a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: .8rem;
    white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active { color: #fff; background: var(--primary); }

.admin-main { max-width: 1200px; margin: 0 auto; padding: 16px; width: 100%; }
.admin-main h2 { margin-bottom: 16px; font-size: 1.25rem; }

.card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    overflow: hidden;
}

.card h3 { margin-bottom: 12px; font-size: 1rem; }
.domain-switcher-card { border: 1px solid #dbeafe; background: linear-gradient(135deg, #f8fbff 0%, #fff 100%); }
.domain-switcher-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.domain-switcher-title { margin-bottom: 6px; font-size: 1rem; }
.domain-switcher-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.domain-switcher-form label { font-size: .875rem; font-weight: 500; margin: 0; }
.text-muted { color: #6b7280; font-weight: 400; font-size: .9em; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: 16px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: .875rem; color: #374151; }

.admin-body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.admin-body .form-group select,
.admin-body .form-group textarea,
.admin-body .reference-table-item input,
.admin-body .domain-switcher-form select,
.admin-body .filter-bar select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: .875rem;
    color: #1f2937;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.admin-body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):hover,
.admin-body .form-group select:hover,
.admin-body .form-group textarea:hover,
.admin-body .reference-table-item input:hover,
.admin-body .domain-switcher-form select:hover {
    border-color: #b8bec9;
}

.admin-body .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus,
.admin-body .form-group select:focus,
.admin-body .form-group textarea:focus,
.admin-body .reference-table-item input:focus,
.admin-body .domain-switcher-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, .12);
}

.admin-body .form-group textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.5;
}

.admin-body .form-group input::placeholder,
.admin-body .form-group textarea::placeholder,
.admin-body .reference-table-item input::placeholder {
    color: #9ca3af;
}

.admin-body .form-group input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-size: .875rem;
    cursor: pointer;
}

.admin-body .form-group input[type="file"]:hover {
    border-color: var(--primary);
    background: #fff5f6;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 16px; /* 防止 iOS 缩放 */
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }

.visits-search-form .form-group {
    margin-bottom: 0;
}

.visits-search-form .visits-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-body .visits-search-form .visits-search-row > input {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: .02em;
}

.visits-search-form .visits-search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.visits-search-form .visits-search-actions .btn {
    white-space: nowrap;
    min-height: 42px;
    border-radius: 8px;
}

.visits-search-form .visits-search-actions-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.visits-search-form .visits-date-row {
    flex-wrap: wrap;
}

.visits-search-form .visits-date-row input[type="date"] {
    flex: 1 1 160px;
    min-width: 0;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    color: var(--text, #222);
}

.visits-date-sep {
    color: var(--text-muted, #666);
    font-size: .875rem;
    flex-shrink: 0;
}

.visits-ip-table .visits-sort-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.visits-ip-table .visits-sort-link:hover {
    color: var(--primary, #c0392b);
}

.visits-ip-table .visits-sort-link.active {
    color: var(--primary, #c0392b);
}

.visits-view-times-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, .35);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    white-space: nowrap;
}

.visits-view-times-btn:hover {
    opacity: .95;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, .45);
    color: #fff;
}

.visits-ban-form {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.visits-manual-ban-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: .875rem;
    color: #374151;
}

.admin-body .visits-manual-ban-form .visits-manual-ban-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-body .visits-manual-ban-form .visits-manual-ban-input,
.admin-body .visits-manual-ban-form #manual-ban-ip {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    flex: 1 1 280px;
    width: auto;
    min-width: 260px;
    max-width: 420px;
    min-height: 46px;
    height: 46px;
    margin: 0;
    padding: 12px 16px 12px 44px;
    border: 1px solid #d5dce6;
    border-radius: 12px;
    outline: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .92rem;
    letter-spacing: .04em;
    line-height: 1.2;
    color: #111827;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px 18px;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, .04), 0 1px 2px rgba(16, 24, 40, .04);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.admin-body .visits-manual-ban-form .visits-manual-ban-input::placeholder,
.admin-body .visits-manual-ban-form #manual-ban-ip::placeholder {
    color: #9ca3af;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
    font-size: .875rem;
    opacity: 1;
}

.admin-body .visits-manual-ban-form .visits-manual-ban-input:hover,
.admin-body .visits-manual-ban-form #manual-ban-ip:hover {
    border-color: #b8c2d0;
    background-color: #fcfdff;
}

.admin-body .visits-manual-ban-form .visits-manual-ban-input:focus,
.admin-body .visits-manual-ban-form #manual-ban-ip:focus {
    border-color: var(--primary, #c41e3a);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, .12), inset 0 1px 2px rgba(16, 24, 40, .04);
}

.admin-body .visits-manual-ban-form .visits-manual-ban-row .btn {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: .875rem;
    text-decoration: none;
    color: #fff;
    background: #666;
    transition: opacity .2s;
    text-align: center;
}
.btn:hover { opacity: .85; }
.btn-primary { background: var(--primary); }
.btn-secondary { background: #666; }
.btn-danger { background: var(--error); }
.btn-sm { padding: 6px 10px; font-size: .75rem; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 600px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.table th { background: #fafafa; font-weight: 600; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 500;
}
.badge-success { background: #e6f7e6; color: var(--success); }
.badge-warning { background: #fff8e1; color: #e65100; }
.badge-error { background: #fce8e6; color: var(--error); }

.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; font-size: .875rem; }
.alert-success { background: #e6f7e6; color: var(--success); }
.alert-error { background: #fce8e6; color: var(--error); }

.hint { color: #999; font-size: .8rem; margin-bottom: 10px; line-height: 1.5; }
.text-muted { color: #999; }
.text-center { text-align: center; }

.filter-bar { margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.filter-bar a {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    background: #f5f5f5;
    font-size: .8rem;
}
.filter-bar a.active { background: var(--primary); color: #fff; }

.filter-bar-pills { gap: 8px; }
.filter-pill {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    background: #f0f2f5;
    font-size: .85rem;
    border: 1px solid #e8e8e8;
    transition: all .2s;
}
.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(196, 30, 58, .25);
}

.form-group-full { width: 100%; }

.prediction-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 12px 0 16px;
}

.prediction-settings-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fafbfc;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.prediction-settings-name {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.prediction-settings-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.prediction-settings-fields .form-group {
    margin-bottom: 0;
}

.reference-table-group {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafbfc;
}

.reference-table-group:last-of-type {
    margin-bottom: 0;
}

.reference-table-title {
    font-size: .95rem;
    margin: 0 0 12px;
    color: var(--primary);
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.reference-table-hint {
    margin: -4px 0 12px;
    font-size: .82rem;
    color: #6b7280;
}

.reference-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px 16px;
}

.reference-table-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color .2s, box-shadow .2s;
}

.reference-table-item:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, .08);
}

.reference-table-item label {
    display: block;
    font-size: .82rem;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 600;
}

.reference-table-item input {
    font-family: "Courier New", Consolas, monospace;
    font-size: .82rem;
    padding: 8px 10px;
    border-radius: 6px;
}

.prediction-type-settings {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prediction-type-setting-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.prediction-type-switch {
    min-width: 90px;
}

.prediction-type-count {
    margin-bottom: 0 !important;
    min-width: 120px;
}

.prediction-type-count label {
    font-size: .75rem;
}

.readonly-input {
    opacity: .75;
    cursor: not-allowed;
    background: #f3f4f6 !important;
    color: #6b7280 !important;
}

@media (min-width: 768px) {
    .prediction-settings-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

.list-summary {
    color: #888;
    font-size: .8rem;
    margin-bottom: 12px;
}

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.list-toolbar .list-summary {
    margin-bottom: 0;
}

.inline-form { display: inline; }

.btn-action-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-action {
    border: 1px solid transparent;
    font-weight: 500;
    min-width: 68px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    transition: all .2s;
}

.btn-action:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.12); }

.btn-show {
    background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-color: #a5d6a7;
}

.btn-hide {
    background: linear-gradient(180deg, #fff8e1 0%, #ffecb3 100%);
    color: #e65100;
    border-color: #ffe082;
}

.btn-delete {
    background: linear-gradient(180deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-color: #ef9a9a;
}

.btn-save {
    min-width: 120px;
    padding: 10px 24px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(196, 30, 58, .3);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: .85rem;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    transition: all .2s;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(196, 30, 58, .25);
}

.pagination-btn.disabled {
    opacity: .45;
    cursor: not-allowed;
    background: #fafafa;
}

.visits-pagination {
    margin-top: 16px;
    padding-top: 14px;
}

.visits-pagination .pagination-info {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    font-size: .82rem;
    color: #666;
    white-space: nowrap;
}

.draw-time-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 200px;
}

.input-datetime-sm {
    padding: 6px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: .75rem;
    max-width: 170px;
}

.btn-edit {
    background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border-color: #90caf9;
}

.table-draws td .btn-action-group form {
    margin: 0;
}

.draws-edit-hint {
    margin: 0 0 12px;
}

.editable-cell {
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.editable-cell:hover {
    background: #f0f7ff;
    box-shadow: inset 0 0 0 1px #90caf9;
}

.editable-cell.is-editing {
    background: #fff;
    box-shadow: inset 0 0 0 2px #1976d2;
    padding: 0;
}

.editable-cell.is-saving {
    opacity: 0.65;
    pointer-events: none;
}

.editable-input {
    width: 100%;
    min-width: 72px;
    padding: 8px 10px;
    border: none;
    border-radius: 4px;
    font-size: .875rem;
    background: #fff;
    color: #333;
    outline: none;
}

.editable-input-wide {
    min-width: 240px;
}

.editable-cell-wide {
    min-width: 220px;
}

.code-block {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
    font-size: .75rem;
    overflow-x: auto;
    margin: 8px 0;
    word-break: break-all;
}

.result-item { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: .875rem; }

.admin-thumb {
    max-width: 80px;
    max-height: 48px;
    border-radius: 4px;
    vertical-align: middle;
}

.upload-progress {
    margin-top: 10px;
}

.upload-progress-track {
    width: 100%;
    height: 8px;
    background: #eceff3;
    border-radius: 999px;
    overflow: hidden;
}

.upload-progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #ff6b81 100%);
    border-radius: 999px;
    transition: width .15s ease;
}

.upload-progress-text {
    display: inline-block;
    margin-top: 6px;
    font-size: .75rem;
    color: #666;
}

.chart-admin-preview-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
}

.chart-admin-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.chart-admin-preview-item {
    width: 180px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.chart-admin-preview-item.is-current {
    border-color: var(--primary, #c41e3a);
    box-shadow: 0 0 0 1px rgba(196, 30, 58, 0.15);
}

.chart-admin-preview-item img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #f3f4f6;
}

.chart-admin-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px 10px;
    font-size: .75rem;
    color: #555;
}

.chart-admin-preview-meta .badge-current {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(196, 30, 58, 0.1);
    color: var(--primary, #c41e3a);
    font-weight: 600;
}

.chart-admin-preview-meta .badge-replaced {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-weight: 600;
}

.chart-admin-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 120px;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: .82rem;
    font-weight: 600;
}

.chart-admin-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 10px;
}

.chart-admin-preview-actions .btn-sm {
    font-size: .72rem;
    padding: 4px 8px;
}

.chart-admin-preview-error {
    padding: 6px 10px 8px;
    font-size: .72rem;
    line-height: 1.4;
    color: #b91c1c;
    background: #fef2f2;
    border-top: 1px solid #fecaca;
}

.chart-admin-preview-item.is-refresh-failed {
    border-color: #fca5a5;
}

.chart-slot-replace-label {
    margin: 0;
    cursor: pointer;
}

.chart-slot-replace-label.is-busy {
    opacity: .6;
    pointer-events: none;
}

.chart-admin-preview-item.is-empty {
    border-style: dashed;
}

.content-preview-cell { max-width: 200px; white-space: normal !important; }
.zodiac-list-cell { white-space: normal !important; max-width: 240px; }

.zodiac-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zodiac-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: .875rem;
    cursor: pointer;
    transition: all .2s;
    user-select: none;
}

.zodiac-check:hover {
    border-color: #cbd5e1;
    background: #f9fafb;
}

.zodiac-check:has(input:checked) {
    border-color: var(--primary);
    background: #fff5f6;
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(196, 30, 58, .1);
}

.zodiac-check input[type="checkbox"],
.zodiac-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-group-btn { display: flex; flex-direction: column; justify-content: flex-end; }

.color-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-row input[type="color"] {
    width: 52px;
    height: 42px;
    padding: 3px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.color-input-row input[type="color"]:hover {
    border-color: var(--primary);
}

.font-color-text {
    flex: 1;
}

.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 42px;
    transition: border-color .2s, background-color .2s, box-shadow .2s;
}

.switch-label:hover {
    border-color: #cbd5e1;
    background: #f9fafb;
}

.switch-label:has(input:checked) {
    border-color: rgba(196, 30, 58, .35);
    background: #fff5f6;
}

.switch-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.switch-text {
    font-size: .875rem;
    font-weight: 500;
    color: #333;
}

.prediction-period-preview {
    padding: 10px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    color: #374151;
    min-height: 42px;
    display: flex;
    align-items: center;
}

.domain-switcher-form select {
    min-width: 220px;
    font-size: .875rem;
}

/* 登录/安装 */
.login-page, .install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px;
}

.login-box, .install-box {
    background: #fff;
    padding: 24px 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    color: #333;
}

.login-box h1, .install-box h1 { text-align: center; margin-bottom: 20px; font-size: 1.35rem; }

/* ===== 响应式断点 ===== */
@media (min-width: 480px) {
    :root {
        --ball-square-width: 74px;
        --ball-square-height: 84px;
    }
    .ball .num { font-size: 1.6rem; }
    .ball .ball-meta-text { font-size: .82rem; }
    .site-brand-inner { padding: 22px 20px 18px; border-radius: 14px; }
    .site-title { font-size: 1.85rem; }
    .site-almanac-line { font-size: .84rem; padding: 10px 20px; }
    .site-lottery-tag { font-size: .82rem; padding: 6px 14px; }
    .lottery-panel { padding: 16px 14px 18px; }
    .lottery-card { padding: 20px; }
    .countdown-box .timer { font-size: 1.8rem; }
}

@media (min-width: 768px) {
    .site-header { padding: 20px 0 4px; }
    .site-title { font-size: 2rem; }
    .lottery-board { gap: 24px; margin: 32px 0; }
    .lottery-panel { padding: 18px 16px 20px; border-radius: 16px; }
    .lottery-board.single { margin-top: 4px; margin-bottom: 24px; }
    .lottery-card { padding: 24px; border-radius: 16px; }
    .lottery-card h2 { font-size: 1.25rem; }
    .countdown-box .timer { font-size: 2rem; }
    .form-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .nav-brand { width: auto; text-align: left; margin-right: 20px; }
    .nav-links { width: auto; justify-content: flex-start; }
    .admin-nav { flex-wrap: nowrap; padding: 0 24px; }
    .admin-main { padding: 24px; }
    .card { padding: 24px; }
}

@media (min-width: 1024px) {
    .history-scroll { max-height: 600px; }
}

@media (max-width: 767px) {
    .content-ad-text-wrap {
        flex: 1 1 calc((100% - 10px) / 2);
        max-width: 100%;
        min-width: 0;
        width: auto;
    }

    .content-ad-text {
        white-space: normal;
        word-break: break-word;
        overflow: visible;
        text-overflow: clip;
    }
}

.list-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.admin-modal-open {
    overflow: hidden;
}

.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(4px);
}

.admin-modal-backdrop[hidden] {
    display: none !important;
}

.admin-modal {
    width: min(960px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #2a2d34 0%, #1f2228 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    overflow: hidden;
}

.admin-modal-wide {
    width: min(1080px, 100%);
}

.admin-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.admin-modal-body-form {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.admin-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .02);
}

.admin-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.admin-modal-subtitle {
    margin: 6px 0 0;
    font-size: .82rem;
    color: #9aa0a6;
}

.admin-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #ddd;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.admin-modal-close:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.admin-modal-body {
    padding: 0 22px;
    overflow: auto;
}

.admin-modal-table {
    margin-top: 12px;
}

.admin-modal .table th,
.admin-modal .table td {
    color: #e8eaed;
    border-bottom-color: rgba(255, 255, 255, .1);
}

.admin-modal .table th {
    background: rgba(255, 255, 255, .07);
    color: #f1f3f4;
}

.admin-modal .table tbody tr:hover td {
    background: rgba(255, 255, 255, .04);
}

.admin-modal .lottery-name-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.3;
    border: 1px solid transparent;
}

.admin-modal .lottery-name-hk {
    color: #ff8a80;
    background: rgba(255, 82, 82, .16);
    border-color: rgba(255, 82, 82, .28);
}

.admin-modal .lottery-name-new_hk {
    color: #82b1ff;
    background: rgba(66, 133, 244, .16);
    border-color: rgba(66, 133, 244, .28);
}

.admin-modal .lottery-name-macau {
    color: #69f0ae;
    background: rgba(46, 125, 50, .16);
    border-color: rgba(46, 125, 50, .28);
}

.admin-modal-empty {
    padding: 48px 16px;
    text-align: center;
    color: #9aa0a6;
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 0, 0, .12);
}

.admin-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 22px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .02);
}

.random-regenerate-schedule-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-modal-switch {
    margin: 0;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .14);
}

.admin-modal-switch .switch-text {
    color: #ffffff;
    font-size: .875rem;
    font-weight: 600;
}

.admin-modal-auto-hint {
    color: #b8bcc2;
    font-size: .82rem;
    line-height: 1.5;
}

.admin-modal-interval-label,
.admin-modal-interval-unit {
    color: #d0d4da;
    font-size: .84rem;
    font-weight: 500;
}

.random-regenerate-schedule-form input[type="number"] {
    width: 88px;
}

.admin-modal-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 0 18px;
    margin-top: 4px;
}

.admin-modal-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: .84rem;
    font-weight: 500;
    color: #d7dbe0;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    transition: all .2s ease;
}

.admin-modal-page-btn:hover:not(.disabled):not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .18);
    transform: translateY(-1px);
}

.admin-modal-page-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #4a9eff 0%, #2f6fd6 100%);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(47, 111, 214, .35);
    font-weight: 700;
}

.admin-modal-page-btn.disabled {
    opacity: .38;
    cursor: not-allowed;
}

#regenerate-all-predictions-btn {
    background: linear-gradient(135deg, #ff8a65 0%, #e64a19 100%);
    border: none;
    box-shadow: 0 4px 14px rgba(230, 74, 25, .28);
}

#regenerate-all-predictions-btn:hover {
    filter: brightness(1.05);
}

@media (max-width: 767px) {
    .admin-modal-backdrop {
        padding: 12px;
    }

    .admin-modal-header,
    .admin-modal-body,
    .admin-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 359px) {
    :root {
        --ball-square-width: 56px;
        --ball-square-height: 64px;
    }
    .ball .num { font-size: 1.25rem; }
    .ball .ball-meta-text { font-size: .68rem; }
    .mini-ball { width: 32px; height: 38px; }
    .mini-ball .mini-num { font-size: .65rem; }
    .mini-ball .mini-meta { font-size: .42rem; }
}

/* ===== 多风格预测模块 ===== */
.pm-block { margin-top: 12px; overflow: hidden; }
.pm-module-title {
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    padding: 8px 12px;
    background: linear-gradient(180deg, #0d8f45 0%, #0a7a3a 100%);
    color: #fff;
    letter-spacing: 0.04em;
}
.pm-promo-header { text-align: center; font-weight: 800; padding: 8px 10px; letter-spacing: 0.02em; }
.pm-hit { color: #ff0000; background: #ffff00; font-weight: 800; }
.pm-accuracy-hit { color: #059669; font-weight: 800; }
.pm-accuracy-miss { color: #dc2626; font-weight: 800; }
.pm-accuracy-pending { color: #d97706; font-weight: 800; }
.pm-style1 { background: #000; color: #fff; border-radius: 8px; }
.pm-style1-header { background: #e60012; color: #ffff00; font-size: 1rem; }
.pm-style1-body { padding: 10px 12px 14px; }
.pm-style1-row { font-size: .95rem; font-weight: 700; line-height: 1.8; text-align: center; }
.pm-s1-label { color: #00ff00; }
.pm-s1-val { color: #ff0000; }
.pm-style1-footer { text-align: center; margin-top: 8px; font-weight: 700; font-size: .95rem; }
.pm-style2-list { background: #fff; }
.pm-style2-row { padding: 8px 10px; font-weight: 700; font-size: .88rem; border-bottom: 1px solid #e5e5e5; text-align: center; }
.pm-style2-row.pm-alt { background: #f5f5f5; }
.pm-s2-period, .pm-s2-source, .pm-s2-stats { color: #111; }
.pm-s2-tag { color: #e60012; }
.pm-style3 { background: #fff; text-align: center; padding: 8px 10px 12px; }
.pm-s3-dash { color: #008000; font-weight: 700; margin: 6px 0; }
.pm-s3-period { color: #e60012; font-weight: 800; font-size: .95rem; }
.pm-s3-poem { color: #cc0099; font-weight: 800; margin: 4px 0; }
.pm-s3-explain { color: #e60012; font-weight: 700; font-size: .85rem; margin: 4px 0; }
.pm-s3-pick { color: #0000cc; font-weight: 800; margin: 3px 0; }
.pm-style4 { background: #fff; padding: 6px 10px; }
.pm-s4-head { font-weight: 800; font-size: .95rem; margin-bottom: 4px; }
.pm-s4-hl { background: #ffff00; padding: 0 4px; }
.pm-s4-line { font-weight: 700; font-size: .88rem; line-height: 1.65; }
.pm-s4-a { color: #cc0099; } .pm-s4-av { color: #0000cc; }
.pm-s4-b { color: #ff6600; } .pm-s4-bv { color: #006666; }
.pm-s4-c { color: #00aa00; } .pm-s4-cv { color: #cc0000; }
.pm-s4-d { color: #006600; } .pm-s4-dv { color: #993300; }
.pm-s4-e { color: #0000cc; } .pm-s4-ev { color: #111; }
.pm-s4-hit { color: #b91c1c; background: #fef08a; font-weight: 900; }
.pm-s4-promo { text-align: center; color: #e60012; font-weight: 800; margin: 8px 0 4px; font-size: .85rem; }
.pm-s4-new { background: #e60012; color: #fff; font-size: .7rem; padding: 1px 4px; border-radius: 2px; }
.pm-s4-hr { border: none; border-top: 1px solid #ddd; margin: 8px 0; }
.pm-style5-block { border-top: 3px double #999; border-bottom: 3px double #999; margin-bottom: 2px; }
.pm-s5-head { background: #ffffcc; color: #1a1a1a; text-align: center; font-weight: 800; padding: 6px 8px; font-size: .88rem; border-bottom: 1px solid #ccc; }
.pm-s5-period { color: #006600; } .pm-s5-title { color: #e60012; }
.pm-s5-res { background: #ffff00; padding: 0 3px; }
.pm-s5-acc { font-weight: 800; }
.pm-s5-acc.pm-accuracy-hit { color: #059669; }
.pm-s5-acc.pm-accuracy-miss { color: #dc2626; }
.pm-s5-acc.pm-accuracy-pending { color: #d97706; }
.pm-s5-body { background: #fff; padding: 8px 6px; text-align: center; }
.pm-s5-row { margin: 4px 0; }
.pm-s5-cell { color: #0000aa; font-weight: 700; font-size: .85rem; margin: 0 6px; }
.pm-style6 { background: #fff; }
.pm-style6-row { padding: 8px 10px; border-bottom: 1px solid #eee; font-weight: 700; font-size: .9rem; }
.pm-s6-period, .pm-s6-open { color: #111; }
.pm-s6-sep { color: #e60012; }
.pm-style7 { background: #fff; padding: 6px 8px; }
.pm-style7-row { font-weight: 700; font-size: .88rem; line-height: 1.9; border-bottom: 1px solid #f0f0f0; }
.pm-style8 { background: #ffffee; padding: 6px 8px; color: #1a1a1a; }
.pm-style8-block { border-bottom: 1px solid #e8e0c8; padding: 8px 6px; text-align: center; color: #1a1a1a; }
.pm-s8-result { font-weight: 800; font-size: .95rem; margin-bottom: 4px; color: #111827; }
.pm-s8-line { font-weight: 700; font-size: .9rem; line-height: 1.7; color: #1f2937; }
.pm-s8-result .pm-accuracy-hit { color: #059669; }
.pm-s8-result .pm-accuracy-miss { color: #dc2626; }
.pm-s8-result .pm-accuracy-pending { color: #d97706; }
.pm-s8-line .pm-hit { color: #b91c1c; background: #fef08a; }
.pm-style9 { background: #fff; overflow: hidden; }
.pm-style9-list { padding: 4px 0; }
.pm-style9-row {
    padding: 7px 4px;
    line-height: 1.5;
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}
.pm-style9-row-inner {
    display: inline-block;
    white-space: nowrap;
    font-weight: 800;
    font-size: .9rem;
    line-height: 1.5;
    transform-origin: center center;
    max-width: none;
}
.pm-s9-period { color: #0000cc; }
.pm-s9-title { color: #e60012; }
.pm-s9-knife { color: #333; letter-spacing: -0.15em; }
.pm-s9-wave { font-weight: 900; }
.pm-s9-wave-red { color: #e60012; }
.pm-s9-wave-green { color: #009900; }
.pm-s9-wave-blue { color: #0000cc; }
.pm-s9-open { color: #e60012; }
.pm-s9-status { margin-left: 2px; }
.pm-s9-hit { color: #059669; }
.pm-s9-miss { color: #dc2626; }
.pm-style9-empty { text-align: center; color: #999; padding: 16px 8px; font-weight: 700; }
@media (max-width: 480px) {
    .pm-style9-row-inner {
        font-size: clamp(.68rem, 3.4vw, .88rem);
    }
    .pm-s9-knife {
        letter-spacing: -0.12em;
        font-size: .92em;
    }
}
.pm-style10 { background: #fff; }
.pm-style10-block { border-bottom: 1px solid #eee; padding: 10px 8px; text-align: center; }
.pm-s10-head { font-weight: 800; font-size: .92rem; color: #111; }
.pm-s10-nums { color: #e60012; font-weight: 800; font-size: .95rem; margin-top: 4px; }
.pm-style11 { background: #fff; }
.pm-style11-list { padding: 2px 0; }
.pm-style11-row {
    padding: 5px 8px;
    font-weight: 700;
    font-size: .9rem;
    line-height: 1.65;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
.pm-s11-period { color: #111; }
.pm-s11-cat { color: #d946ef; font-weight: 800; }
.pm-s11-arrow { color: #0000cc; margin: 0 2px; }
.pm-s11-pred { color: #0000cc; font-weight: 800; }
.pm-s11-pred .pm-s11-hit { background: #ffff00; color: #0000cc; }
.pm-s11-open { color: #e60012; font-weight: 800; margin-left: 2px; }
.pm-style11-empty { text-align: center; color: #999; padding: 16px 8px; font-weight: 700; }
.art-four-reference {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    padding: 8px 10px 10px;
    margin-bottom: 4px;
    background: #eef2ff;
    border-bottom: 1px solid #c7d2fe;
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.5;
}
.art-four-ref-item {
    color: #0f172a;
}
.art-four-ref-label {
    color: #dc2626;
}
.content-predictions-art-four .content-predictions-title { margin-bottom: 0; }
html[data-theme="dark"] .pm-style11 .art-four-reference,
html[data-theme="dark"] .content-predictions-art-four .art-four-reference {
    background: #eef2ff;
    border-bottom-color: #c7d2fe;
}
html[data-theme="dark"] .pm-style11 .art-four-ref-item,
html[data-theme="dark"] .content-predictions-art-four .art-four-ref-item {
    color: #0f172a;
}
html[data-theme="dark"] .pm-style11 .art-four-ref-label,
html[data-theme="dark"] .content-predictions-art-four .art-four-ref-label {
    color: #dc2626;
}
.pm-style12 { background: #fff; }
.pm-style12-list { padding: 2px 0; }
.pm-style12-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    font-weight: 800;
    font-size: .9rem;
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
}
.pm-s12-period { color: #0000cc; }
.pm-s12-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    background: #ff69b4;
    color: #fff;
    font-size: .78em;
    font-weight: 900;
    line-height: 1;
}
.pm-s12-label { color: #111; }
.pm-s12-env { font-size: .95em; }
.pm-s12-box {
    padding: 1px 6px;
    font-weight: 900;
    letter-spacing: .02em;
}
.pm-s12-box-pending,
.pm-s12-box-hit { background: #ffff00; }
.pm-s12-box-miss { background: #111; }
.pm-s12-parity-odd { color: #e60012; }
.pm-s12-parity-even { color: #0000cc; }
.pm-s12-box-miss.pm-s12-parity-odd { color: #e60012; }
.pm-s12-box-miss.pm-s12-parity-even { color: #ff4444; }
.pm-s12-point { font-size: .95em; }
.pm-s12-result { color: #0000cc; font-weight: 800; }
.pm-s12-acc { margin-left: 2px; font-weight: 900; }
.pm-style12-empty { text-align: center; color: #999; padding: 16px 8px; font-weight: 700; }
.pm-style13 { background: #fff; }
.pm-style13-group {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #e8e8e8;
    min-height: 72px;
}
.pm-style13-group:last-child { border-bottom: none; }
.pm-s13-periods,
.pm-s13-results {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 8px 10px;
    flex-shrink: 0;
}
.pm-s13-periods { min-width: 72px; }
.pm-s13-results { min-width: 88px; text-align: right; }
.pm-s13-period { font-weight: 700; font-size: .9rem; color: #111; line-height: 1.8; }
.pm-s13-pred {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: #0000cc;
    font-weight: 800;
    font-size: .92rem;
    text-align: center;
    line-height: 1.5;
}
.pm-s13-open { color: #cc0000; font-weight: 800; font-size: .9rem; line-height: 1.8; }
.pm-s13-acc { margin-left: 4px; font-weight: 800; }
.pm-s13-empty { text-align: center; color: #999; padding: 16px 8px; font-weight: 700; }
.pm-style14 { background: #fff; padding: 4px 0; }
.pm-style14-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pm-style14-table th,
.pm-style14-table td {
    padding: 8px 6px;
    text-align: center;
    font-weight: 800;
    font-size: .9rem;
    color: #cc0000;
    border-bottom: 1px solid #f0f0f0;
}
.pm-style14-table th { font-size: .88rem; }
.pm-s14-acc { margin-left: 2px; font-weight: 900; }
.pm-s14-empty { text-align: center; color: #999; padding: 16px 8px; font-weight: 700; }
.pm-style15 { background: #fff; }
.pm-style15-block { border-bottom: 1px solid #ddd; }
.pm-style15-block:last-child { border-bottom: none; }
.pm-s15-head {
    background: linear-gradient(180deg, #0d8f45 0%, #0a7a3a 100%);
    color: #fff;
    font-weight: 800;
    font-size: .9rem;
    padding: 7px 8px;
    text-align: center;
    line-height: 1.5;
}
.pm-s15-period { color: #fff; }
.pm-s15-title { color: #ffff00; }
.pm-s15-open { color: #fff; }
.pm-s15-open-val { color: #ff4444; }
.pm-s15-acc { margin-left: 2px; }
.pm-s15-head .pm-accuracy-hit { color: #fff; }
.pm-s15-head .pm-accuracy-miss { color: #fecaca; }
.pm-s15-head .pm-accuracy-pending { color: #fde68a; }
.pm-s15-nums {
    background: #e8e8e8;
    color: #111;
    font-weight: 800;
    font-size: .86rem;
    padding: 8px 6px;
    text-align: center;
    line-height: 1.7;
    letter-spacing: 0.01em;
    word-break: break-all;
}
.pm-s15-nums .pm-hit { color: #ff0000; background: #ffff00; }
.pm-s15-empty { text-align: center; color: #999; padding: 16px 8px; font-weight: 700; }
html[data-theme="dark"] .pm-style5 .pm-s5-head { background: #ffffcc; color: #1a1a1a; }
html[data-theme="dark"] .pm-style5 .pm-s5-head,
html[data-theme="dark"] .pm-style2-list,
html[data-theme="dark"] .pm-style3,
html[data-theme="dark"] .pm-style4,
html[data-theme="dark"] .pm-style5 .pm-s5-body,
html[data-theme="dark"] .pm-style6,
html[data-theme="dark"] .pm-style7,
html[data-theme="dark"] .pm-style8,
html[data-theme="dark"] .pm-style9,
html[data-theme="dark"] .pm-style10,
html[data-theme="dark"] .pm-style11,
html[data-theme="dark"] .pm-style12,
html[data-theme="dark"] .pm-style13,
html[data-theme="dark"] .pm-style14,
html[data-theme="dark"] .pm-style15 { background: rgba(255,255,255,.96); color: #111; }
html[data-theme="dark"] .pm-style8,
html[data-theme="dark"] .pm-style8-block,
html[data-theme="dark"] .pm-s8-result,
html[data-theme="dark"] .pm-s8-line { color: #111827; }
html[data-theme="dark"] .pm-s8-result .pm-accuracy-hit { color: #047857; }
html[data-theme="dark"] .pm-s8-result .pm-accuracy-miss { color: #b91c1c; }
html[data-theme="dark"] .pm-s8-result .pm-accuracy-pending { color: #b45309; }
html[data-theme="dark"] .pm-s5-acc.pm-accuracy-hit { color: #047857; }
html[data-theme="dark"] .pm-s5-acc.pm-accuracy-miss { color: #b91c1c; }
html[data-theme="dark"] .pm-s5-acc.pm-accuracy-pending { color: #b45309; }
html[data-theme="dark"] .pm-style9,
html[data-theme="dark"] .pm-style9-row { color: #111; }
html[data-theme="dark"] .pm-style11-row,
html[data-theme="dark"] .pm-style12-row,
html[data-theme="dark"] .pm-s13-period,
html[data-theme="dark"] .pm-s13-pred { color: #111; }
html[data-theme="dark"] .pm-style14-table th,
html[data-theme="dark"] .pm-style14-table td { color: #cc0000; }
html[data-theme="dark"] .pm-s13-pred { color: #0000cc; }
html[data-theme="dark"] .pm-s13-open { color: #cc0000; }
html[data-theme="dark"] .pm-module-title {
    background: linear-gradient(180deg, #0f9d4f 0%, #0b7a3d 100%);
    color: #fff;
}
.pm-style-empty { background: #fff; text-align: center; padding: 0; }
.pm-style-empty-header { background: #e60012; color: #ffff00; font-size: .9rem; }
.pm-style-empty-body { padding: 14px 12px; color: #666; font-size: .88rem; }
.pm-s9-empty { text-align: center; color: #999; padding: 16px; }
.prediction-module-rows { display: grid; gap: 8px; margin-top: 8px; }
.prediction-module-row { display: grid; grid-template-columns: 80px 120px 80px 1fr; gap: 8px; align-items: center; }
@media (max-width: 767px) { .prediction-module-row { grid-template-columns: 1fr 1fr; } }

/* ===== 后台预测模块管理 ===== */
.prediction-modules-card { overflow: hidden; }
.pm-admin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.pm-admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-admin-toolbar-form { margin: 0; }
.pm-admin-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
    padding: 18px 20px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .04);
}
.pm-admin-panel-add {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fffafb 0%, #fff 100%);
}
.pm-admin-panel-edit {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}
.pm-admin-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.pm-admin-panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b1228 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.pm-admin-panel-sub {
    display: block;
    font-size: .82rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 2px;
}
.pm-admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.pm-admin-form-grid-add { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pm-optional { font-size: .75rem; color: #9ca3af; font-weight: 400; }
.pm-field-hint { margin-top: 4px; margin-bottom: 0; font-size: .78rem; }
.pm-admin-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 16px;
}
.pm-switch-card {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    min-width: 180px;
}
.pm-style-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 16px;
}
.pm-style-preview-label { font-size: .82rem; color: #6b7280; font-weight: 600; }
.pm-style-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #c41e3a 0%, #d4a017 100%);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
}
.pm-style-meta { font-size: .82rem; color: #374151; }
.pm-rows-panel {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 16px;
}
.pm-rows-head {
    padding: 12px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.pm-rows-head .hint { margin: 0; font-size: .78rem; }
.pm-rows-table { padding: 10px 12px 12px; }
.pm-rows-table-head {
    display: grid;
    grid-template-columns: 90px 120px 80px 1fr;
    gap: 8px;
    padding: 0 4px 8px;
    font-size: .75rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.pm-rows-table .prediction-module-row {
    grid-template-columns: 90px 120px 80px 1fr;
    padding: 6px 4px;
    border-bottom: 1px solid #f3f4f6;
}
.pm-rows-table .prediction-module-row:last-child { border-bottom: none; }
.pm-rows-table .prediction-module-row input,
.pm-rows-table .prediction-module-row select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .88rem;
}
.pm-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.pm-module-list { margin-top: 4px; }
.pm-module-list-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.pm-module-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.pm-module-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .05);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.pm-module-card:hover {
    border-color: #fecaca;
    box-shadow: 0 4px 14px rgba(196, 30, 58, .08);
    transform: translateY(-1px);
}
.pm-module-card-off {
    opacity: .72;
    background: #f9fafb;
}
.pm-module-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.pm-module-style-tag {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    color: #fff;
    background: #6b7280;
}
.pm-module-style-tag-style1 { background: #111; }
.pm-module-style-tag-style2 { background: #2563eb; }
.pm-module-style-tag-style3 { background: #9333ea; }
.pm-module-style-tag-style4 { background: #ea580c; }
.pm-module-style-tag-style5 { background: #ca8a04; }
.pm-module-style-tag-style6 { background: #0891b2; }
.pm-module-style-tag-style7 { background: #059669; }
.pm-module-style-tag-style8 { background: #b45309; }
.pm-module-style-tag-style9 { background: #dc2626; }
.pm-module-style-tag-style10 { background: #7c3aed; }
.pm-module-style-tag-style11 { background: #db2777; }
.pm-module-style-tag-style12 { background: #0284c7; }
.pm-module-style-tag-style13 { background: #7c3aed; }
.pm-module-style-tag-style14 { background: #be123c; }
.pm-module-style-tag-style15 { background: #0d8f45; }

.pred-decor-gif {
    display: inline-block;
    vertical-align: middle;
    height: 1.15em;
    width: auto;
    max-height: 20px;
    margin: 0 2px;
    object-fit: contain;
}
.pred-decor-fire {
    max-height: 22px;
}
.pm-module-title,
.content-predictions-title,
.tail-predict-header,
.zodiac-predict-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ===== 前台预测模块快捷导航 ===== */
.pm-module-nav-mount {
    width: 100%;
    max-width: 640px;
    margin: 10px auto 8px;
    padding: 0 4px;
}
.pm-module-nav-mount[hidden] {
    display: none !important;
}
.pm-module-nav-sentinel {
    height: 1px;
    margin: 0;
    pointer-events: none;
}
.pm-module-nav-bar {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 2px 10px;
    box-shadow: none;
}
.pm-module-nav-bar.is-stuck {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 16px);
    max-width: 640px;
    z-index: 320;
    padding: 8px 6px 10px;
    border-radius: 0 0 12px 12px;
    background: color-mix(in srgb, var(--card-bg) 88%, transparent);
    border: 1px solid var(--border);
    border-top: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.pm-module-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 6px;
}
.pm-module-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 4px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 48%, #16a34a 100%);
    color: #fff;
    font-size: clamp(.68rem, 2.4vw, .78rem);
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 2px 6px rgba(22, 163, 74, .24),
        inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    word-break: break-all;
}
.pm-module-nav-btn:hover,
.pm-module-nav-btn:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        0 4px 10px rgba(22, 163, 74, .32),
        inset 0 1px 0 rgba(255, 255, 255, .4);
}
.pm-module-nav-btn.is-active {
    background: linear-gradient(180deg, #fb7185 0%, #ef4444 52%, #dc2626 100%);
    border-color: rgba(255, 255, 255, .28);
    box-shadow:
        0 3px 10px rgba(220, 38, 38, .35),
        inset 0 1px 0 rgba(255, 255, 255, .32);
}
.pm-module-nav-btn.is-active:hover,
.pm-module-nav-btn.is-active:focus-visible {
    box-shadow:
        0 5px 12px rgba(220, 38, 38, .38),
        inset 0 1px 0 rgba(255, 255, 255, .36);
}
.pm-module-nav-btn.pm-module-nav-top {
    background: linear-gradient(180deg, #5eead4 0%, #14b8a6 52%, #0d9488 100%);
    box-shadow:
        0 2px 6px rgba(13, 148, 136, .28),
        inset 0 1px 0 rgba(255, 255, 255, .35);
}
.pm-module-nav-btn.pm-module-nav-top:hover,
.pm-module-nav-btn.pm-module-nav-top:focus-visible {
    box-shadow:
        0 4px 10px rgba(13, 148, 136, .34),
        inset 0 1px 0 rgba(255, 255, 255, .4);
}
.pm-module-nav-placeholder {
    display: none;
    height: 0;
}
.pm-module-nav-placeholder.visible {
    display: block;
}
.pm-module-section {
    scroll-margin-top: 72px;
}
@media (max-width: 520px) {
    .pm-module-nav-grid {
        gap: 6px 4px;
    }
    .pm-module-nav-btn {
        min-height: 32px;
        padding: 5px 3px;
        font-size: clamp(.64rem, 2.2vw, .72rem);
    }
}
@media (min-width: 600px) {
    .pm-module-nav-grid {
        gap: 8px;
    }
    .pm-module-nav-btn {
        min-height: 36px;
        padding: 7px 6px;
        font-size: .8rem;
    }
}
html[data-theme="dark"] .pm-module-nav-bar.is-stuck {
    background: color-mix(in srgb, var(--card-bg) 90%, transparent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .pm-module-nav-btn {
    color: #fff;
}
.pm-module-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.35;
}
.pm-module-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
    font-size: .78rem;
    color: #6b7280;
}
.pm-module-card-meta span {
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 999px;
}
.pm-module-card-style {
    font-size: .8rem;
    color: #4b5563;
    margin-bottom: 12px;
    line-height: 1.4;
}
.pm-module-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}
.pm-module-card-actions form { margin: 0; display: inline; }
.pm-empty-state {
    text-align: center;
    padding: 36px 20px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #fafbfc;
}
.pm-empty-icon { font-size: 2rem; margin-bottom: 8px; }
.pm-empty-state p { margin: 0 0 6px; font-weight: 600; color: #374151; }
@media (max-width: 767px) {
    .pm-admin-head { flex-direction: column; }
    .pm-rows-table-head { display: none; }
    .pm-rows-table .prediction-module-row { grid-template-columns: 1fr 1fr; }
}

/* ===== 交流大厅 ===== */
.pm-module-nav-btn.pm-module-nav-chat {
    background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 52%, #2563eb 100%);
    box-shadow:
        0 2px 6px rgba(37, 99, 235, .28),
        inset 0 1px 0 rgba(255, 255, 255, .35);
}
.pm-module-nav-btn.pm-module-nav-chat:hover,
.pm-module-nav-btn.pm-module-nav-chat:focus-visible {
    box-shadow:
        0 4px 10px rgba(37, 99, 235, .34),
        inset 0 1px 0 rgba(255, 255, 255, .4);
}
body.chat-lobby-open { overflow: hidden; }
.chat-lobby-modal[hidden] { display: none !important; }
.chat-lobby-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}
.chat-lobby-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}
.chat-lobby-panel {
    --chat-panel-bg: #ffffff;
    --chat-panel-text: #1f2937;
    --chat-panel-muted: #64748b;
    --chat-header-bg: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    --chat-header-title: #1d4ed8;
    --chat-close-bg: #ffffff;
    --chat-close-color: #64748b;
    --chat-marquee-bg: #fff7ed;
    --chat-marquee-border: #fed7aa;
    --chat-messages-bg: #f1f5f9;
    --chat-bubble-bg: #ffffff;
    --chat-bubble-border: #e2e8f0;
    --chat-bubble-text: #111827;
    --chat-bubble-mine-bg: #dbeafe;
    --chat-bubble-mine-border: #93c5fd;
    --chat-bubble-mine-text: #1e3a8a;
    --chat-input-bg: #ffffff;
    --chat-input-border: #cbd5e1;
    --chat-tool-bg: #ffffff;
    --chat-tool-border: #cbd5e1;
    --chat-emoji-bg: #f1f5f9;
    --chat-status-border: #e2e8f0;
    position: relative;
    width: min(100%, 520px);
    max-height: min(88vh, 720px);
    height: min(88vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--chat-panel-bg);
    color: var(--chat-panel-text);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    overflow: hidden;
}
html[data-theme="dark"] .chat-lobby-panel {
    --chat-panel-bg: #1a2332;
    --chat-panel-text: #e8eaed;
    --chat-panel-muted: #9aa0a6;
    --chat-header-bg: linear-gradient(180deg, #1e3a5f 0%, #1a2332 100%);
    --chat-header-title: #93c5fd;
    --chat-close-bg: #243044;
    --chat-close-color: #e8eaed;
    --chat-marquee-bg: #2a2118;
    --chat-marquee-border: #5b4630;
    --chat-messages-bg: #0f1419;
    --chat-bubble-bg: #243044;
    --chat-bubble-border: #334155;
    --chat-bubble-text: #f1f5f9;
    --chat-bubble-mine-bg: #1e3a5f;
    --chat-bubble-mine-border: #3b82f6;
    --chat-bubble-mine-text: #eff6ff;
    --chat-input-bg: #243044;
    --chat-input-border: #475569;
    --chat-tool-bg: #243044;
    --chat-tool-border: #475569;
    --chat-emoji-bg: #1a2332;
    --chat-status-border: #2d3748;
    border-color: #2d3748;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.chat-lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--chat-input-border);
    background: var(--chat-header-bg);
    flex-shrink: 0;
}
.chat-lobby-header-main { min-width: 0; flex: 1; }
.chat-lobby-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--chat-header-title);
}
.chat-lobby-guest {
    margin: 4px 0 0;
    font-size: .78rem;
    color: var(--chat-panel-muted);
}
.chat-lobby-close {
    border: none;
    background: var(--chat-close-bg);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--chat-close-color);
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.chat-lobby-close:active { transform: scale(.96); }
.chat-lobby-marquee {
    position: relative;
    overflow: hidden;
    height: 34px;
    line-height: 34px;
    background: var(--chat-marquee-bg);
    border-bottom: 1px solid var(--chat-marquee-border);
    flex-shrink: 0;
}
.chat-lobby-marquee[hidden] { display: none !important; }
.chat-lobby-marquee-track {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
    animation: chat-lobby-marquee-scroll var(--chat-marquee-duration, 18s) linear infinite;
}
.chat-lobby-marquee-item {
    display: inline-block;
    padding-right: 4em;
    font-size: .88rem;
    font-weight: 700;
}
@keyframes chat-lobby-marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-1 * var(--chat-marquee-distance, 50%))); }
}
.chat-lobby-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 12px;
    background: var(--chat-messages-bg);
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb, #c41e3a) var(--scroll-track, rgba(0, 0, 0, .06));
}
.chat-lobby-messages::-webkit-scrollbar {
    width: 8px;
}
.chat-lobby-messages::-webkit-scrollbar-track {
    margin: 8px 2px;
    background: var(--scroll-track, rgba(0, 0, 0, .06));
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04);
}
html[data-theme="dark"] .chat-lobby-messages::-webkit-scrollbar-track {
    background: var(--scroll-track, rgba(255, 255, 255, .06));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.chat-lobby-messages::-webkit-scrollbar-thumb {
    min-height: 40px;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    background: linear-gradient(180deg, var(--gold, #e8b923) 0%, var(--primary, #c41e3a) 100%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.chat-lobby-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--scroll-thumb-hover, #d4a017) 0%, var(--primary-dark, #9f1830) 100%);
    box-shadow: 0 2px 8px rgba(196, 30, 58, .28);
}
.chat-lobby-messages::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--primary, #c41e3a) 0%, var(--primary-dark, #9f1830) 100%);
}
.chat-lobby-messages::-webkit-scrollbar-corner {
    background: transparent;
}
.chat-lobby-empty {
    text-align: center;
    color: var(--chat-panel-muted);
    padding: 28px 12px;
    font-size: .9rem;
}
.chat-lobby-msg {
    margin-bottom: 10px;
    max-width: 92%;
}
.chat-lobby-msg.is-mine {
    margin-left: auto;
}
.chat-lobby-msg-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: .75rem;
    color: var(--chat-panel-muted);
}
.chat-lobby-msg.is-mine .chat-lobby-msg-head {
    justify-content: flex-end;
}
.chat-lobby-msg-name {
    font-weight: 700;
    color: var(--chat-panel-text);
}
.chat-lobby-msg-body {
    background: var(--chat-bubble-bg);
    border: 1px solid var(--chat-bubble-border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: .9rem;
    line-height: 1.5;
    word-break: break-word;
    color: var(--chat-bubble-text);
}
.chat-lobby-msg.is-mine .chat-lobby-msg-body {
    background: var(--chat-bubble-mine-bg);
    border-color: var(--chat-bubble-mine-border);
    color: var(--chat-bubble-mine-text);
}
.chat-lobby-msg-text {
    white-space: pre-wrap;
    color: inherit;
}
.chat-lobby-media-btn {
    display: inline-block;
    position: relative;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    max-width: 100%;
    text-align: left;
}
.chat-lobby-media-image {
    display: block;
    max-width: 220px;
    max-height: 180px;
    border-radius: 8px;
}
.chat-lobby-media-video {
    display: block;
    max-width: 260px;
    max-height: 180px;
    border-radius: 8px;
    background: #000;
    pointer-events: none;
}
.chat-lobby-media-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    pointer-events: none;
}
.chat-media-preview[hidden] { display: none !important; }
.chat-media-preview {
    position: fixed;
    inset: 0;
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.chat-media-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}
.chat-media-preview-panel {
    position: relative;
    z-index: 1;
    max-width: min(96vw, 920px);
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-media-preview-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.chat-media-preview-body {
    max-width: 100%;
    max-height: 90vh;
}
.chat-media-preview-image,
.chat-media-preview-video {
    display: block;
    max-width: min(96vw, 920px);
    max-height: 86vh;
    border-radius: 10px;
    background: #000;
}
body.chat-media-preview-open { overflow: hidden; }
.chat-lobby-status {
    padding: 6px 12px;
    font-size: .8rem;
    color: var(--chat-panel-muted);
    border-top: 1px solid var(--chat-status-border);
    background: var(--chat-panel-bg);
}
.chat-lobby-status.is-error { color: #dc2626; }
html[data-theme="dark"] .chat-lobby-status.is-error { color: #f87171; }
.chat-lobby-emoji {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--chat-status-border);
    background: var(--chat-panel-bg);
    max-height: 120px;
    overflow-y: auto;
}
.chat-lobby-emoji[hidden] { display: none !important; }
.chat-lobby-emoji-btn {
    border: none;
    background: var(--chat-emoji-bg);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    cursor: pointer;
}
.chat-lobby-toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 12px 0;
    border-top: 1px solid var(--chat-status-border);
    background: var(--chat-panel-bg);
}
.chat-lobby-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--chat-tool-border);
    border-radius: 8px;
    background: var(--chat-tool-bg);
    color: var(--chat-panel-text);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}
.chat-lobby-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    flex-shrink: 0;
    background: var(--chat-panel-bg);
}
.chat-lobby-form.is-banned { opacity: .65; }
.chat-lobby-form textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    border: 1px solid var(--chat-input-border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.4;
    font-family: inherit;
    background: var(--chat-input-bg);
    color: var(--chat-panel-text);
    -webkit-text-size-adjust: 100%;
}
.chat-lobby-form textarea::placeholder {
    color: var(--chat-panel-muted);
}
.chat-lobby-send {
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    min-width: 64px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
}
.chat-admin-thumb {
    display: block;
    max-width: 120px;
    max-height: 80px;
    border-radius: 6px;
    margin-bottom: 6px;
}
.chat-lobby-upload {
    padding: 8px 12px;
    border-top: 1px solid var(--chat-status-border, #e2e8f0);
    background: var(--chat-panel-bg, #fff);
    flex-shrink: 0;
}
.chat-lobby-upload[hidden] { display: none !important; }
.chat-lobby-upload-label {
    font-size: .78rem;
    color: var(--chat-panel-muted, #64748b);
    margin-bottom: 6px;
}
.chat-lobby-upload-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .35);
    overflow: hidden;
}
.chat-lobby-upload-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
    transition: width .12s linear;
}
.chat-admin-message-table {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 0 !important;
}
.chat-admin-message-table th,
.chat-admin-message-table td {
    vertical-align: top;
}
.chat-admin-message-table th:nth-child(1),
.chat-admin-message-table td:nth-child(1) { width: 64px; }
.chat-admin-message-table th:nth-child(2),
.chat-admin-message-table td:nth-child(2) { width: 110px; white-space: normal; word-break: break-word; }
.chat-admin-message-table th:nth-child(3),
.chat-admin-message-table td:nth-child(3) { width: 70px; }
.chat-admin-message-table th:nth-child(5),
.chat-admin-message-table td:nth-child(5) { width: 160px; white-space: nowrap; }
.chat-admin-message-table th:nth-child(6),
.chat-admin-message-table td:nth-child(6) { width: 80px; }
.chat-admin-content-cell,
.table.chat-admin-message-table td.chat-admin-content-cell {
    max-width: 0 !important;
    width: auto !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    vertical-align: top;
}
.chat-admin-content-text {
    display: block;
    max-width: 100%;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.45;
}
.chat-admin-time-cell,
.table.chat-admin-message-table td.chat-admin-time-cell {
    white-space: nowrap !important;
    vertical-align: top;
}
.chat-guest-nickname {
    display: inline-block;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px dashed transparent;
}
.chat-guest-nickname:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}
.chat-rename-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.chat-rename-form[hidden] { display: none !important; }
.chat-rename-input {
    min-width: 120px;
    max-width: 220px;
    padding: 4px 8px;
}

@media (max-width: 768px) {
    .chat-lobby-modal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        /* 避免键盘顶起时 fixed+inset 把弹窗顶出可视区 */
        right: auto;
        bottom: auto;
    }
    .chat-lobby-backdrop {
        display: none;
    }
    .chat-lobby-panel {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .chat-lobby-header {
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
    }
    .chat-lobby-close {
        width: 40px;
        height: 40px;
        font-size: 1.7rem;
        color: #0f172a;
        background: #e2e8f0;
    }
    html[data-theme="dark"] .chat-lobby-close {
        color: #e8eaed;
        background: #243044;
    }
    .chat-lobby-messages {
        flex: 1 1 auto;
        min-height: 0;
    }
    .chat-lobby-toolbar,
    .chat-lobby-emoji,
    .chat-lobby-status {
        flex-shrink: 0;
    }
    .chat-lobby-form {
        padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--chat-status-border);
        position: relative;
        z-index: 2;
    }
    .chat-lobby-form textarea {
        font-size: 16px !important;
    }
    .chat-lobby-send {
        height: 44px;
        font-size: 16px;
    }
    .chat-lobby-media-image,
    .chat-lobby-media-video {
        max-width: min(100%, 280px);
    }
}
