/* ========================================
   Modern Client Interface - 2026 Edition
   Clean, Minimal, and Elegant Design
   ======================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Screen Reader Only - for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    /* 首屏使用中性色，避免 F5 刷新时先闪紫色；JS applyTheme() 执行后再应用真实主题色 */
    --theme-color: #64748b;
    --theme-color-dark: #475569;
    --theme-color-light: #94a3b8;
    --theme-color-alpha: rgba(100, 116, 139, 0.1);
    
    --primary-color: var(--theme-color);
    --primary-dark: var(--theme-color-dark);
    --primary-light: var(--theme-color-light);
    
    /* Neutral Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius - Unified */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 10px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
}

/* 移动端铺满屏幕并居中 */
@media (max-width: 768px) {
    body {
        max-width: 100%;
        margin: 0 auto;
    }
}

/* ========================================
   Site Header - Modern Glass Design
   ======================================== */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 12px;
    border-radius: var(--radius-lg);
}

.site-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 15s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(25%, 25%); }
}

.header-time {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.header-date {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.header-lunar {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.lunar-info {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.lunar-clash {
    background: rgba(255,193,7,0.2);
    color: #ffd54f;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ========================================
   News Bar - Modern Pill Style
   ======================================== */
.news-bar {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.news-label {
    background: var(--primary-color);
    color: #fff;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    border-radius: 8px 0 0 8px;
}

.news-content {
    flex: 1;
    padding: 8px 12px;
    overflow: hidden;
    position: relative;
}

/* CSS-based scrolling animation to replace deprecated marquee */
.news-scroll {
    display: flex;
    animation: news-scroll-animation 20s linear infinite;
    white-space: nowrap;
}

.news-scroll:hover {
    animation-play-state: paused;
}

.news-text {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    padding-right: 50px;
}

@keyframes news-scroll-animation {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Legacy marquee support (for older browsers) */
.news-content marquee {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ========================================
   Logo Area（页面最顶部）
   ======================================== */
.logo-area {
    width: 100%;
    overflow: hidden;
    text-align: center;
    /* 默认隐藏，JS 会在有图片时设置为 block */
}

.logo-area img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.logo-area .logo-link {
    display: block;
    width: 100%;
}

/* ========================================
   Banner Area
   ======================================== */
.banner-area {
    width: 100%;
    overflow: hidden;
    margin: 8px 0;
}

.banner-area img {
    width: calc(100% - 24px);
    margin: 0 12px;
    height: auto;
    display: block;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.banner-area img:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Article Position Images
   Images linked to specific article titles
   ======================================== */
.article-position-images {
    width: 100%;
    padding: 8px 12px;
    margin: 8px 0;
}

.article-position-image-link {
    display: block;
    width: 100%;
    margin: 8px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.article-position-image-link:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

.article-position-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Lottery Section - Modern Card Design
   ======================================== */
.lottery-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    margin: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

/* Lottery Tabs - Modern Pill Tabs */
.lottery-tabs {
    display: flex;
    background: var(--bg-tertiary);
    padding: 8px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lottery-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'STHeiti', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
    border-radius: var(--radius-md);
}

.lottery-tab:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.lottery-tab.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.lottery-container {
    max-width: 100%;
}

/* Header Row */
.lottery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(to right, var(--bg-tertiary), var(--bg-secondary));
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.lottery-issue {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.lottery-countdown {
    color: #f97316;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(249, 115, 22, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.lottery-links {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.lottery-history {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'STHeiti', sans-serif;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    font-weight: 600;
}

.lottery-history:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Lottery Body */
.lottery-body {
    padding: 12px 4px;
    background: var(--bg-secondary);
}

.lottery-numbers {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
}

.ball-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 0 1 auto;
}

.ball-item.special-item {
    position: relative;
}

/* Plus sign between 6th ball and special ball */
.ball-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-muted);
    margin: 0 4px;
    padding-top: 5px;
}

/* Number Ball - Modern Style */
.number-ball {
    display: block;
    width: 25px;
    height: 27px;
    background: url('../../assets/img/ball_hk6.png') no-repeat;
    font-size: 0;
    text-indent: -9999px;
    margin: 0 auto;
    transform: scale(1.3);
    transform-origin: center center;
}

/* Gray placeholder ball */
.number-ball.gray {
    background: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 50%;
    font-size: 11px;
    text-indent: 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Sprite positions (keeping original positions) */
.number-ball.b1, .number-ball.b01 { background-position: 0 0; }
.number-ball.b2, .number-ball.b02 { background-position: 0 -27px; }
.number-ball.b3, .number-ball.b03 { background-position: 0 -54px; }
.number-ball.b4, .number-ball.b04 { background-position: 0 -81px; }
.number-ball.b5, .number-ball.b05 { background-position: 0 -108px; }
.number-ball.b6, .number-ball.b06 { background-position: 0 -135px; }
.number-ball.b7, .number-ball.b07 { background-position: 0 -162px; }
.number-ball.b8, .number-ball.b08 { background-position: 0 -189px; }
.number-ball.b9, .number-ball.b09 { background-position: 0 -216px; }
.number-ball.b10 { background-position: 0 -243px; }
.number-ball.b11 { background-position: 0 -270px; }
.number-ball.b12 { background-position: 0 -297px; }
.number-ball.b13 { background-position: 0 -324px; }
.number-ball.b14 { background-position: 0 -351px; }
.number-ball.b15 { background-position: 0 -378px; }
.number-ball.b16 { background-position: 0 -405px; }
.number-ball.b17 { background-position: 0 -432px; }
.number-ball.b18 { background-position: 0 -459px; }
.number-ball.b19 { background-position: 0 -486px; }
.number-ball.b20 { background-position: 0 -513px; }
.number-ball.b21 { background-position: 0 -540px; }
.number-ball.b22 { background-position: 0 -567px; }
.number-ball.b23 { background-position: 0 -594px; }
.number-ball.b24 { background-position: 0 -621px; }
.number-ball.b25 { background-position: 0 -648px; }
.number-ball.b26 { background-position: 0 -675px; }
.number-ball.b27 { background-position: 0 -701px; }
.number-ball.b28 { background-position: 0 -728px; }
.number-ball.b29 { background-position: 0 -755px; }
.number-ball.b30 { background-position: 0 -782px; }
.number-ball.b31 { background-position: 0 -809px; }
.number-ball.b32 { background-position: 0 -836px; }
.number-ball.b33 { background-position: 0 -863px; }
.number-ball.b34 { background-position: 0 -890px; }
.number-ball.b35 { background-position: 0 -917px; }
.number-ball.b36 { background-position: 0 -944px; }
.number-ball.b37 { background-position: 0 -971px; }
.number-ball.b38 { background-position: 0 -998px; }
.number-ball.b39 { background-position: 0 -1025px; }
.number-ball.b40 { background-position: 0 -1052px; }
.number-ball.b41 { background-position: 0 -1079px; }
.number-ball.b42 { background-position: 0 -1106px; }
.number-ball.b43 { background-position: 0 -1133px; }
.number-ball.b44 { background-position: 0 -1160px; }
.number-ball.b45 { background-position: 0 -1187px; }
.number-ball.b46 { background-position: 0 -1214px; }
.number-ball.b47 { background-position: 0 -1242px; }
.number-ball.b48 { background-position: 0 -1269px; }
.number-ball.b49 { background-position: 0 -1296px; }

/* Zodiac Badge - 支持字体放大不溢出 */
.ball-zodiac {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'STHeiti', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    text-align: center;
    min-width: 0;
    max-width: 100%;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-all;
    overflow: hidden;
    box-sizing: border-box;
}

/* Individual Ball Image */
.number-ball-ball {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 27px;
}

.ball-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Next Draw Info - 期数与开奖时间容器 */
.lottery-next {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 4px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    box-shadow: var(--shadow-sm);
}
.lottery-next .next-issue {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
}
.lottery-next .next-datetime {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.next-issue {
    font-weight: 700;
    color: var(--primary-color);
}

.next-datetime {
    color: var(--text-muted);
}

.lottery-loading {
    padding: 60px 20px;
    font-size: 1rem;
    text-align: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.lottery-loading i {
    color: var(--primary-color);
}

.lottery-loading.hidden,
.lottery-body.hidden {
    display: none;
}

/* ========================================
   Navigation Bar - Modern Floating Style
   ======================================== */
/* 导航栏宽度与页面内容一致（max-width 800px 居中），不占满整屏 */
.navigation-bar {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin: 12px auto;
    max-width: 800px;
    width: calc(100% - 24px);
    position: sticky;
    top: 8px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
}

/* 不固定：随页面正常滚动 */
.navigation-bar.nav-static {
    position: static;
    top: auto;
}

/* 随滚动后固定（默认） */
.navigation-bar.nav-sticky {
    position: sticky;
    top: 8px;
}

/* 一直固定在视口顶部（宽度与页面内容一致，居中不占满整屏） */
.navigation-bar.nav-fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: calc(100% - 24px);
    max-width: 800px;
    border-radius: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    padding-top: env(safe-area-inset-top, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* 固定在自选位置：导航栏放在用户选择的DOM位置，随页面正常滚动（与不固定相同，只是位置可选） */
.navigation-bar.nav-fixed-custom {
    position: static;
    top: auto;
}

.navigation-bar.hidden {
    display: none;
}

/* 导航栏固定时给 body 预留顶部空间，避免内容被遮挡（--nav-fixed-height 在 JS 中按导航实际高度设置） */
body.nav-has-fixed-nav {
    padding-top: var(--nav-fixed-height, 56px);
}

.nav-container {
    padding: 12px;
    overflow-x: auto;
}

.nav-list {
    --nav-columns: 5;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 8px;
    justify-content: center;
}

.nav-list.fixed-columns {
    display: grid;
    grid-template-columns: repeat(var(--nav-columns), 1fr);
    gap: 8px;
    /* 确保列数固定，不自动调整 */
    width: 100%;
}

.nav-list.fixed-columns li {
    text-align: center;
    min-width: 0; /* 允许内容收缩 */
}

.nav-list li a {
    display: block;
    padding: 10px 16px;
    color: white;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    white-space: nowrap;
    transition: var(--transition-fast);
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--primary-color);
    text-align: center;
}

.nav-list.fixed-columns li a {
    white-space: normal;
    word-break: break-word;
}

.nav-list li a:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.nav-list li a.active {
    background: var(--theme-color-dark);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-md);
}

/* 导航栏显示图标时的样式 */
.nav-list.nav-with-icons li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
}

.nav-list.nav-with-icons .nav-item-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.nav-list.nav-with-icons .nav-item-icon-img {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 50%;
}

.nav-list.nav-with-icons .nav-item-icon-img img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

.nav-list.nav-with-icons .nav-item-text {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'STHeiti', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    color: inherit;
}

/* ========================================
   Recommend Header - Modern Banner
   ======================================== */
.recommend-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    text-align: center;
    padding: 20px;
    margin: 16px 12px 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-size: 1rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.recommend-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
}

.recommend-header strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* ========================================
   Main Content Area
   ======================================== */
.main-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 50vh;
}

.content-loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.content-loading i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 12px;
    display: block;
}

.content-loading.hidden {
    display: none;
}

/* ========================================
   Article Card - Modern Glass Card
   ======================================== */
.article-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 15px;
    margin: 0 12px 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    height: 68px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 15px 15px 0 0;
    box-sizing: border-box;
}

.article-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
}

.article-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

.article-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.article-content p {
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Content from backend - match backend preview styles */
.article-content table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.article-content figure.table {
    width: 100% !important;
    margin: 0;
}

.article-content figure.table table {
    width: 100% !important;
    border-collapse: collapse !important;
}

/* Default table borders for visibility */
.article-content table td,
.article-content table th,
.article-content figure.table td,
.article-content figure.table th {
    border: solid 1px #555;
    padding: 5px 10px;
}

/* Period card styles (from preview settings); gap from .article-content */
.period-card {
    padding: 8px 12px;
    margin-bottom: 0;
    border-radius: var(--radius-md);
    box-sizing: border-box;
}

.period-card-row {
    width: 100%;
}

.period-card-content {
    word-break: break-word;
}

.period-card-content p {
    margin: 0;
}

/* Override content inline styles for alignment */
.period-card-content.align-center,
.period-card-content.align-center * {
    text-align: center !important;
}

.period-card-content.align-left,
.period-card-content.align-left * {
    text-align: left !important;
}

.period-card-content.align-right,
.period-card-content.align-right * {
    text-align: right !important;
}

.period-card-content.align-center-left {
    text-align: left !important;
}

/* Fixed content card styles - independent blocks outside card */
.fixed-content-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--radius-lg);
    padding: 10px 15px;
    margin: 0 12px 8px;
}

/* Fixed content inside card - full width after header */
.fixed-content-inner {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.fixed-content-inner .fixed-content-card {
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.fixed-content-card p {
    margin: 0;
}

.period-card-content table,
.period-card-content figure.table > table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.period-card-content table td,
.period-card-content table th {
    border: solid 1px #555;
    padding: 5px 10px;
}

/* Period content tables (for period articles) */
.period-content table,
.period-content figure.table > table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.period-content table td,
.period-content table th {
    border: solid 1px #555;
    padding: 5px 10px;
}

/* Fixed content tables */
.fixed-content table,
.fixed-content figure.table > table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.fixed-content table td,
.fixed-content table th {
    border: solid 1px #555;
    padding: 5px 10px;
}

/* ========================================
   Image Carousel - Modern Slider
   ======================================== */
.image-carousel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.carousel-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 14px 20px;
}

.carousel-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    min-width: 100%;
    padding: 24px;
    text-align: center;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.carousel-nav:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.carousel-nav.prev { left: 16px; }
.carousel-nav.next { right: 16px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: var(--bg-secondary);
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.carousel-dot:hover {
    background: var(--primary-light);
}

.carousel-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* ========================================
   Image Viewer - Exact Style as Reference (gcttl83.com)
   ======================================== */

/* Container with border */
.bor {
    border: 1px solid #ddd;
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
    margin: 0 12px;
}

.mgb {
    margin-bottom: 10px;
}

/* Main box */
.box {
    width: 100%;
}

/* Title bar - green gradient */
.box-tit {
    background: linear-gradient(to bottom, #4a9f4a 0%, #2d7d2d 100%);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    height: 35px;
    padding: 12px 10px 8px 10px;
    line-height: 1;
    border-radius: 15px 15px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Content container */
.box-con {
    padding: 0;
}

/* Tab Navigation - 与图片外链期数栏一致：标题色背景、耳角、期数尺寸 */
.swiper-container.tabNav {
    padding: 10px 15px 78px 15px;
    overflow: visible;
    position: relative;
    z-index: 1;
    /* background 由 JS 按 previewSettings.title 设置 */
}

.swiper-container.tabNav::before,
.swiper-container.tabNav::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 15px;
    height: 15px;
    background: var(--nav-bg-color, #e8e8e8);
}

.swiper-container.tabNav::before {
    left: 0;
    border-radius: 0 0 15px 0;
}

.swiper-container.tabNav::after {
    right: 0;
    border-radius: 0 0 0 15px;
}

.tabNav .swiper-wrapper {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabNav .swiper-wrapper::-webkit-scrollbar {
    display: none;
}

/* Tab buttons - 与图片外链期数尺寸一致：120px/28px，选中 140px，圆角白边 */
.tabNav .swiper-slide {
    width: 120px !important;
    height: 28px;
    flex-shrink: 0;
    padding: 0;
    margin: 0 15px;
    border: 1px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    font-size: 15px;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 3px;
}

.tabNav .swiper-slide span {
    display: block;
    color: #fff;
    font-weight: normal;
}

/* Active tab - 与图片外链一致：标题色背景、白边、略宽 */
.tabNav .swiper-slide.swiper-slide-active {
    width: 140px !important;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 255, 255, 0.5);
}

.tabNav .swiper-slide.swiper-slide-active span {
    color: #fff;
}

/* Tab Content Area - 与图片外链一致：左右滑动，支持拖动 */
.swiper-container.tabBox {
    width: 100%;
    overflow: hidden;
    background: transparent;
    border-radius: 0;
    margin-top: -65px;
    position: relative;
    z-index: 100;
}

.tabBox .swiper-wrapper {
    display: flex;
    width: 100%;
}

.tabBox .swiper-slide {
    width: 100% !important;
    flex-shrink: 0;
    overflow: visible;
}

/* Image container - higher layer to cover content ears */
.tabImg {
    text-align: center;
    background: transparent;
    padding: 0;
    overflow: visible;
    position: relative;
    z-index: 100;
}

.tabImg img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 15px;
    position: relative;
    z-index: 100;
}

/* Text content container - lower layer with ear effect */
.tabTxt {
    position: relative;
    padding: 78px 15px 15px 15px;
    margin-top: -63px;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 15px;
    z-index: 1;
}

/* Fixed Content areas */
.fixed-content-above,
.fixed-content-below {
    margin-bottom: 10px;
}

.fixed-content-below {
    margin-top: 10px;
    margin-bottom: 0;
}

/* ========================================
   Title Group - Modern Grid Cards
   ======================================== */
.title-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 15px;
    margin: 0 12px 16px 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.title-group-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    height: 68px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.title-group-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.title-group-items {
    padding: 20px;
    display: grid;
    gap: 12px;
    background: var(--bg-secondary);
}

.title-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 39.6px;
    height: auto;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    gap: 8px;
    box-sizing: border-box;
    line-height: 1.4;
}

.title-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
}

.title-item-icon {
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.title-item-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.title-item-icon i {
    font-size: 1.4rem;
}

.title-item:hover .title-item-icon {
    opacity: 0.9;
}

.title-item-name {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.4;
    min-width: 0; /* 允许 flex 子项正确收缩以显示文本 */
}

/* 确保子页面标题始终可见 */
.title-item-name--always-visible {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========================================
   Disclaimer Section
   ======================================== */
.disclaimer {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin: 16px 12px;
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ========================================
   Footer - Modern Minimal
   ======================================== */
.footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: rgba(255,255,255,0.9);
    text-align: center;
    padding: 24px 20px;
    margin: 16px 12px 12px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
}

.footer .site-url {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 8px;
}

/* ========================================
   Site Footer Content（生肖/五行/波色/属性/声明 单独项）
   ======================================== */
.site-footer-content {
    margin: 20px auto;
    padding: 0 12px 20px;
    max-width: min(800px, 100%);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px; /* 项目之间间距统一 */
}

.site-footer-content:empty,
.site-footer-content[style*="display: none"] {
    display: none !important;
    margin: 0;
    padding: 0;
}

/* Table styling for footer content */
.site-footer-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.site-footer-content table td,
.site-footer-content table th {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
}

.site-footer-content table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.site-footer-content table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Typography for footer content */
.site-footer-content p {
    margin: 10px 0;
    line-height: 1.6;
}

.site-footer-content h1,
.site-footer-content h2,
.site-footer-content h3,
.site-footer-content h4 {
    margin: 15px 0 10px;
    color: #333;
}

/* Footer blocks (when saved as multiple editors) */
.site-footer-block + .site-footer-block {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(0, 0, 0, 0.15);
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1rem;
}

/* ========================================
   Sub Page Container (历史记录、走势图等)
   ======================================== */
.sub-page-container,
.history-page,
.trend-page {
    max-width: 800px;
    margin: 12px auto;
    padding: 12px;
}

.sub-page-header,
.history-header,
.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-page-header h1,
.history-header h1,
.trend-header h1 {
    font-size: 1.25rem;
    color: var(--text-primary, #1e293b);
    margin: 0;
    text-align: center;
    flex: 1;
}

.back-btn {
    color: var(--primary-color, #6366f1);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Empty State */
.history-empty,
.trend-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #64748b);
}

.history-empty-hint,
.trend-empty-hint {
    font-size: 0.85rem;
    margin-top: 8px;
    color: var(--text-muted, #94a3b8);
}

/* ========================================
   Announcement Modal
   ======================================== */
.announcement-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.announcement-modal.active {
    display: flex;
}

.announcement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
}

.announcement-box {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.announcement-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.announcement-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.announcement-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.announcement-body {
    padding: 28px 24px;
    max-height: 50vh;
    overflow-y: auto;
    line-height: 1.9;
    color: var(--text-primary);
    white-space: pre-wrap;
    font-size: 0.95rem;
}

.announcement-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.announcement-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 48px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.announcement-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Content Highlighting（标注、占位符替换后的高亮）
   ======================================== */
mark.highlight,
.highlight-tagged,
.period-card-content mark.highlight,
.period-card-content .highlight-tagged,
.ck-content mark.highlight,
.ck-content .highlight-tagged {
    background: #ffff00 !important;
    color: #ff0000 !important;
    font-weight: bold !important;
}

/* 占位符替换后的特码/生肖文字（与后台预览一致） */
.period-card-content .ck-content mark.highlight-tail,
.ck-content mark.highlight-tail {
    background: #ffeb3b !important;
    color: #c62828 !important;
    font-weight: bold !important;
    padding: 0 2px;
}

/* 占位符样式 - 前台显示 */
[data-placeholder] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.4);
    display: inline-block;
    margin: 0 2px;
}

.tema-number {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: white;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 4px rgba(244, 63, 94, 0.3);
}

.pingma-number {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 4px rgba(20, 184, 166, 0.3);
}

.prediction-correct {
    color: #16a34a;
    font-weight: 700;
}

.prediction-wrong {
    color: #dc2626;
    font-weight: 700;
}

/* ========================================
   Footer Reference Tables (生肖/五行/波色/属性/声明)
   ======================================== */

/* 每项单独一张白卡片，圆角、阴影、间距统一 */
.footer-section {
    width: 100%;
    max-width: min(800px, 100%);
    margin: 0 auto;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.footer-section-title {
    text-align: center;
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: bold;
}

.footer-disclaimer-line {
    text-align: center;
    margin: 4px 0;
    font-size: 14px;
    color: #555;
}

.footer-zodiac-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 列 4 行 */
    gap: 8px 16px;
    width: 100%;
}

.footer-zodiac-row {
    border: 1px solid #e0e7ff;
    border-radius: 6px;
    padding: 10px 12px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

/* 上排：左半「鼠[冲 马]」居中，右半图片居中 */
.footer-zodiac-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    min-height: 60px;
}

.footer-zodiac-left {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 15px;
}

.footer-zodiac-right {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 55px; /* 默认右框高度 */
}

/* 统一生肖图尺寸：默认高度 55px，宽度自适应 */
.footer-zodiac .footer-zodiac-right img,
.footer-zodiac .footer-zodiac-right .footer-zodiac-img {
    display: block !important;
    height: 55px !important;
    min-height: 55px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain;
    vertical-align: middle;
}

.footer-zodiac-name {
    font-size: 16px;
    line-height: 1.3;
}

.footer-zodiac-conflict {
    font-size: 13px;
    color: #f97316;
}

/* 下排：左1空、中2-5数字球居中、右6空 */
.footer-zodiac-numbers-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    min-width: 0;
}

.footer-zodiac-slot--empty {
    flex: 1;
    min-width: 0;
}

/* 每个生肖的号码球一行整体显示（使用独立球图），小窗口自动等比缩小，不被截断 */
.footer-zodiac-slot--balls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 3px;
    flex: 2;
    min-width: 0;
}

/* 独立球图：flex 等分空间，保证全部显示不被截断 */
.footer-zodiac-slot--balls .footer-ball-img {
    display: block;
    width: 25px;
    height: 27px;
    object-fit: contain;
    flex: 1 1 0;
    min-width: 0;
    max-width: 28px;
}



.footer-zodiac-numbers .number-ball {
    display: inline-block;
    width: 25px;
    height: 27px;
    transform: scale(1.08);       /* 适当放大一点 */
    margin: 0 4px 4px 0;
}

.footer-zodiac-numbers {
    text-align: center; /* 数字居中显示 */
}

/* 五行、波色：标签固定宽度 + 数字区占满剩余，右边界对齐 */
.footer-five-row,
.footer-wave-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    gap: 12px;
}

.footer-five-label,
.footer-wave-label {
    width: 52px;
    flex-shrink: 0;
    font-weight: 600;
}

.footer-five-numbers,
.footer-wave-numbers {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px; /* 数字球间距调大 */
}

.footer-five-numbers .number-ball,
.footer-wave-numbers .number-ball {
    display: inline-block;
    flex-shrink: 0;
    width: 25px;
    height: 27px;
    transform: scale(1.05);
    margin: 0;
}

.footer-attr-table td {
    font-size: 13px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    /* 移动端铺满屏幕 */
    body {
        font-size: 14px;
        max-width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    .site-header {
        padding: 8px 12px;
    }
    
    .header-time {
        font-size: 1.5rem;
    }
    
    .header-date {
        font-size: 0.8rem;
    }
    
    /* 广告区域 */
    .media-above,
    .media-below {
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
    }
    
    /* 彩票区域 - 移动端保留圆角 */
    .lottery-section {
        margin: 8px 10px !important;
        border-radius: 12px !important;
        overflow: hidden;
    }
    
    .lottery-header {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 12px;
    }
    
    .lottery-issue,
    .lottery-countdown {
        font-size: 0.75rem;
    }
    
    /* 彩票号码球 - 移动端缩小 */
    .lottery-numbers {
        gap: 4px;
    }
    
    .ball-item {
        gap: 4px;
    }
    
    .lottery-body .number-ball {
        transform: scale(1);
    }
    
    .ball-zodiac {
        font-size: 0.7rem;
        padding: 2px 4px;
        min-width: 22px;
    }
    
    /* 导航栏 - 移动端保留圆角 */
    .navigation-bar {
        margin: 8px 10px !important;
        border-radius: 12px !important;
        overflow: hidden;
    }
    
    .nav-list {
        gap: 6px;
        padding: 12px;
    }
    
    .nav-list.fixed-columns {
        grid-template-columns: repeat(var(--nav-columns), 1fr);
        gap: 8px;
    }
    
    .nav-list li {
        width: 100%;
    }
    
    .nav-list li a {
        padding: 8px 6px;
        font-size: clamp(0.55rem, 2.2vw, 0.75rem);
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        line-height: 1.3;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* 文章卡片 - 移动端保留圆角 */
    .article-card {
        margin: 8px 10px !important;
        border-radius: 12px !important;
    }
    
    .article-header,
    .carousel-header,
    .title-group-header {
        padding: 12px 16px;
        height: auto;
        min-height: 50px;
        border-radius: 12px 12px 0 0;
    }
    
    .article-title {
        font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    }
    
    .article-content {
        padding: 12px;
        font-size: clamp(0.75rem, 2.5vw, 0.9rem);
        line-height: 1.6;
    }
    
    .article-content p {
        margin-bottom: 8px;
        font-size: inherit;
    }
    
    .article-content table,
    .article-content figure.table table {
        font-size: clamp(0.7rem, 2.2vw, 0.85rem);
        width: 100%;
        table-layout: auto;
    }
    
    .article-content table td,
    .article-content table th,
    .article-content figure.table td,
    .article-content figure.table th {
        padding: 3px 6px;
        font-size: inherit;
        word-wrap: break-word;
        max-width: 100%;
    }
    
    .article-content img,
    .article-content figure.image img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    .article-content figure {
        margin: 10px 0;
        font-size: inherit;
    }
    
    /* 标题组 - 移动端保留圆角 */
    .title-group {
        margin: 8px 10px !important;
        border-radius: 12px !important;
    }
    
    .title-group-items {
        gap: 8px;
        padding: 12px;
    }
    
    .title-item {
        padding: 8px 10px;
        min-height: auto;
        border-radius: 6px;
        width: 100%;
        box-sizing: border-box;
        font-size: 0.8rem;
    }
    
    .title-item-name {
        font-size: clamp(0.6rem, 2.2vw, 0.8rem);
        line-height: 1.4;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .ball-zodiac {
        font-size: 0.6rem;
        padding: 1px 3px;
        min-width: 20px;
    }
    
    .lottery-next {
        flex-direction: row;
        gap: 8px;
        padding: 10px 12px;
        font-size: 0.7rem;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
    
    /* 轮播图 - 移动端保留圆角 */
    .carousel-container,
    .swiper {
        border-radius: 12px !important;
        margin: 8px 10px !important;
        overflow: hidden;
    }
    
    /* Logo 区域 */
    .logo-area,
    .banner-area {
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
    }
    
    /* 底部生肖号码表 - 移动端缩小 */
    .footer-zodiac-grid {
        gap: 2px 3px;
    }
    
    .footer-zodiac-row {
        padding: 6px 4px;
    }
    
    .footer-zodiac-header {
        gap: 3px;
        margin-bottom: 3px;
        min-height: 40px;
    }
    
    .footer-zodiac-left {
        font-size: clamp(0.65rem, 2vw, 0.8rem);
    }
    
    .footer-zodiac-right {
        height: 35px;
    }
    
    .footer-zodiac .footer-zodiac-right img,
    .footer-zodiac .footer-zodiac-right .footer-zodiac-img {
        height: 35px !important;
        min-height: 35px !important;
    }
    
    .footer-zodiac-name {
        font-size: clamp(0.65rem, 2.1vw, 0.8rem);
    }
    
    .footer-zodiac-conflict {
        font-size: clamp(0.55rem, 1.8vw, 0.7rem);
    }
    
    .footer-zodiac-slot--balls {
        gap: 2px;
        flex-wrap: nowrap;
    }
    
    .footer-zodiac-slot--balls .footer-ball-img,
    .footer-zodiac-slot--balls .number-ball,
    .footer-zodiac-numbers .number-ball {
        max-width: 22px !important;
        height: 24px !important;
        min-width: 0 !important;
    }
    
    .footer-five-row,
    .footer-wave-row {
        gap: 6px;
        padding: 3px 0;
    }
    
    .footer-five-label,
    .footer-wave-label {
        width: 35px;
        font-size: clamp(0.65rem, 2vw, 0.8rem);
    }
    
    .footer-five-numbers .number-ball,
    .footer-wave-numbers .number-ball {
        margin: 0 1px 1px 0;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .site-header {
        padding: 6px 10px;
    }
    
    .header-time {
        font-size: 1.3rem;
    }
    
    .header-date {
        font-size: 0.75rem;
    }
    
    .lottery-section {
        margin: 6px 10px !important;
        border-radius: 10px !important;
    }
    
    .lottery-header {
        justify-content: space-between;
        padding: 8px 10px;
    }
    
    .lottery-issue,
    .lottery-countdown,
    .lottery-history {
        font-size: 0.65rem;
    }
    
    .lottery-countdown {
        padding: 2px 5px;
    }
    
    /* 彩票号码球 - 小屏幕进一步缩小 */
    .lottery-numbers {
        gap: 2px;
    }
    
    .ball-item {
        gap: 2px;
    }
    
    .lottery-body .number-ball {
        transform: scale(1);
    }
    
    .ball-zodiac {
        font-size: 0.55rem;
        padding: 1px 2px;
        min-width: 18px;
    }
    
    .lottery-body {
        padding: 6px 0;
    }
    
    .lottery-next {
        font-size: 0.65rem;
        padding: 6px 10px;
        gap: 5px;
    }
    
    .lunar-info,
    .lunar-clash {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
    
    .navigation-bar {
        margin: 6px 10px !important;
        border-radius: 10px !important;
    }
    
    .nav-list {
        gap: 6px;
        padding: 8px;
    }
    
    .nav-list.fixed-columns {
        gap: 6px;
    }
    
    .nav-list li {
        width: 100%;
    }
    
    .nav-list li a {
        padding: 6px 8px;
        font-size: 0.75rem;
        border-radius: 5px;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        line-height: 1.2;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .article-card {
        margin: 6px 10px !important;
        border-radius: 10px !important;
    }
    
    .article-header,
    .carousel-header,
    .title-group-header {
        padding: 8px 10px;
        min-height: 40px;
        border-radius: 10px 10px 0 0;
    }
    
    .article-title {
        font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    }
    
    .article-content {
        padding: 10px;
        font-size: clamp(0.7rem, 2.5vw, 0.85rem);
        line-height: 1.5;
    }
    
    .article-content p {
        margin-bottom: 6px;
        font-size: inherit;
    }
    
    .article-content table,
    .article-content figure.table table {
        font-size: clamp(0.65rem, 2.2vw, 0.8rem);
        width: 100%;
        table-layout: auto;
    }
    
    .article-content table td,
    .article-content table th,
    .article-content figure.table td,
    .article-content figure.table th {
        padding: 2px 4px;
        font-size: inherit;
        word-wrap: break-word;
        max-width: 100%;
    }
    
    .article-content img,
    .article-content figure.image img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    .article-content figure {
        margin: 8px 0;
        font-size: inherit;
    }
    
    .title-group {
        margin: 6px 10px !important;
        border-radius: 10px !important;
    }
    
    .title-group-items {
        gap: 6px;
        padding: 10px;
    }
    
    .title-item {
        padding: 6px 8px;
        min-height: auto;
        border-radius: 5px;
        width: 100%;
        box-sizing: border-box;
        font-size: 0.75rem;
    }
    
    .title-item-name {
        font-size: clamp(0.55rem, 2vw, 0.75rem);
        line-height: 1.4;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* 确保所有区域全宽 */
    .media-above,
    .media-below,
    .logo-area,
    .banner-area {
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
    }
    
    .news-bar {
        margin: 2px 0;
    }
    
    .main-content {
        padding: 0;
    }
    
    .recommend-header {
        margin: 4px 0 0;
        padding: 12px;
        font-size: 0.85rem;
    }
    
    /* 底部生肖号码表 - 小屏幕进一步缩小 */
    .footer-zodiac-grid {
        gap: 1px 2px;
    }
    
    .footer-zodiac-row {
        padding: 4px 3px;
    }
    
    .footer-zodiac-header {
        gap: 2px;
        margin-bottom: 2px;
        min-height: 34px;
    }
    
    .footer-zodiac-left {
        font-size: clamp(0.55rem, 1.8vw, 0.7rem);
    }
    
    .footer-zodiac-right {
        height: 28px;
    }
    
    .footer-zodiac .footer-zodiac-right img,
    .footer-zodiac .footer-zodiac-right .footer-zodiac-img {
        height: 28px !important;
        min-height: 28px !important;
    }
    
    .footer-zodiac-name {
        font-size: clamp(0.55rem, 1.8vw, 0.7rem);
    }
    
    .footer-zodiac-conflict {
        font-size: clamp(0.5rem, 1.6vw, 0.65rem);
    }
    
    .footer-zodiac-slot--balls {
        gap: 1px;
        flex-wrap: nowrap;
    }
    
    .footer-zodiac-slot--balls .footer-ball-img,
    .footer-zodiac-slot--balls .number-ball,
    .footer-zodiac-numbers .number-ball {
        max-width: 18px !important;
        height: 20px !important;
        min-width: 0 !important;
    }
    
    .footer-five-row,
    .footer-wave-row {
        gap: 4px;
        padding: 2px 0;
    }
    
    .footer-five-label,
    .footer-wave-label {
        width: 28px;
        font-size: clamp(0.55rem, 1.8vw, 0.7rem);
    }
    
    .footer-five-numbers .number-ball,
    .footer-wave-numbers .number-ball {
        margin: 0 1px 1px 0;
    }
}

/* ========================================
   Separator Line (if still needed)
   ======================================== */
.separator-line {
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    margin: 20px 12px;
    border-radius: var(--radius-full);
    opacity: 0.6;
}

.separator-line.thin {
    height: 2px;
}

/* ========================================
   Nav Tool Modals (挑码助手 & 波肖转盘)
   ======================================== */
.tool-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-modal.hidden { display: none; }

.tool-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}
.tool-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 92%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: toolSlideUp 0.3s ease;
}
@keyframes toolSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.tool-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 2px solid var(--primary-color);
}
.tool-modal-header h3 {
    margin: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
}
.tool-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.tool-modal-close:hover { background: #f5f5f5; color: #333; }
.tool-modal-body { padding: 14px 18px 18px; }

/* ---- 挑码助手 ---- */
.picker-dialog { max-width: 440px; }

.pk-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}
.pk-view-tabs {
    display: flex;
    gap: 4px;
    background: #f0f0f0;
    padding: 3px;
    border-radius: 8px;
}
.pk-tab {
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    color: #666;
    font-weight: 600;
    transition: all 0.2s;
}
.pk-tab.active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 600;
}
.pk-actions {
    display: flex;
    gap: 6px;
}
.pk-act-btn {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    color: #555;
    font-weight: 600;
    transition: all 0.15s;
}
.pk-act-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pk-act-danger:hover { border-color: var(--primary-dark); color: var(--primary-dark); }

.pk-year-info {
    text-align: center;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}
.pk-year-info strong { color: var(--primary-color); font-size: 0.95rem; }

.pk-filters { margin-bottom: 10px; }
.pf-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
.pf-sep { color: #ddd; font-size: 0.9rem; }
.pf-btn {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 14px;
    background: #fff;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: #555;
}
.pf-btn:hover { border-color: #aaa; }
.pf-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.pf-wave-red.active { background: #e74c3c; border-color: #e74c3c; }
.pf-wave-blue.active { background: #3498db; border-color: #3498db; }
.pf-wave-green.active { background: #27ae60; border-color: #27ae60; }

/* 号码球网格视图 */
.pk-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}
.pk-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px 2px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}
.pk-item:hover { background: rgba(0,0,0,0.03); }
.pk-item.pk-dim { opacity: 0.15; pointer-events: none; }
.pk-item.pk-sel {
    border-color: var(--primary-color);
    background: var(--theme-color-alpha);
    box-shadow: 0 0 0 1px var(--primary-color);
}
.pk-item:active { transform: scale(0.92); }
.pk-ball-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}
.pk-ball-wrap .ball-img { display: block; }
.pk-zodiac-label {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    margin-top: 2px;
    font-weight: 600;
}
.pk-item.pk-sel .pk-zodiac-label { color: var(--primary-color); font-weight: 700; }

/* 生肖分组视图 */
.pk-zodiac-list {
    max-height: 340px;
    overflow-y: auto;
    margin-bottom: 12px;
}
.pk-zgroup {
    margin-bottom: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}
.pk-zgroup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f8f9fa, #eef1f5);
    font-size: 0.8rem;
}
.pk-zgroup-name {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-weight: 700;
    color: #333;
    font-size: 0.95rem;
}
.pk-zgroup-count {
    color: #999;
    font-size: 0.82rem;
    font-weight: 600;
}
.pk-zgroup-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
}
.pk-item-sm {
    padding: 3px;
    border-radius: 6px;
}

/* 已选号码栏 */
.pk-selected-bar {
    padding: 10px 12px;
    background: linear-gradient(135deg, #fafbfc, #f0f2f5);
    border-radius: 10px;
    border: 1px solid var(--theme-color-alpha, #e8e8e8);
    min-height: 48px;
}
.pk-sel-empty {
    text-align: center;
    font-size: 0.8rem;
    color: #bbb;
    padding: 6px 0;
}
.pk-sel-info {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 6px;
}
.pk-sel-info strong { color: var(--primary-color); font-size: 0.95rem; }
.pk-sel-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.pk-sel-ball {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.pk-sel-ball .ball-img { display: block; }
.pk-sel-zodiac {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    font-weight: 600;
}

/* ---- 波肖转盘 ---- */
.wheel-dialog { max-width: 400px; }

.wl-year-info {
    text-align: center;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 12px;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}
.wl-year-info strong { color: var(--primary-color); font-size: 0.95rem; }

.wl-container { text-align: center; }

.wl-wheel-area {
    position: relative;
    width: 300px;
    height: 320px;
    margin: 0 auto;
}
.wl-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 0;
    height: 0;
}
.wl-pointer-arrow {
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 22px solid var(--primary-color);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
#wheelCanvas {
    display: block;
    margin: 12px auto 0;
}

.wl-spin-btn {
    display: inline-block;
    margin: 10px auto 16px;
    padding: 10px 40px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px var(--theme-color-alpha, rgba(231,76,60,0.4));
}
.wl-spin-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px var(--theme-color-alpha, rgba(231,76,60,0.5)); }
.wl-spin-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* 转盘结果 */
.wl-result {
    padding: 14px;
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    border-radius: 12px;
    margin-bottom: 14px;
    animation: toolSlideUp 0.3s ease;
}
.wl-result.hidden { display: none; }
.wl-res-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.wl-res-zodiac {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}
.wl-res-count {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}
.wl-res-balls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.wl-res-ball {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.wl-res-ball .ball-img { display: block; }
.wl-res-info {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* 生肖号码对照 */
.wl-zodiac-ref {
    margin-top: 14px;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
}
.wl-ref-title {
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa, #eef1f5);
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
    border-bottom: 1px solid #eee;
}
.wl-ref-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}
.wl-ref-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.78rem;
}
.wl-ref-item:nth-child(odd) { border-right: 1px solid #f5f5f5; }
.wl-ref-zodiac {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-color);
    min-width: 20px;
    text-align: center;
}
.wl-ref-nums {
    color: #666;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
}

@media (max-width: 420px) {
    .picker-dialog { max-width: 100%; }
    .pk-grid { grid-template-columns: repeat(7, 1fr); gap: 3px; }
    .pk-item { padding: 2px 1px; }
    .pk-ball-wrap .ball-img { width: 24px !important; }
    .pk-zodiac-label { font-size: 0.75rem; }
    .pk-toolbar { flex-direction: column; gap: 6px; }
    .pk-sel-balls { gap: 4px; }
    .pk-actions { flex-wrap: wrap; justify-content: center; }
    
    .wheel-dialog { max-width: 100%; }
    .wl-wheel-area { width: 260px; height: 280px; }
    #wheelCanvas { width: 260px; height: 260px; }
    .wl-ref-grid { grid-template-columns: 1fr; }
    .wl-ref-item:nth-child(odd) { border-right: none; }
}

/* ========================================
   移动端适配修复
   ======================================== */

/* 1. CKEditor 表格内容防溢出 */
.article-content,
.period-content,
.period-card-content,
.fixed-content-card,
.fixed-content-area,
.content-display-area,
.site-footer-content,
.ck-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content table,
.period-content table,
.period-card-content table,
.fixed-content-card table,
.ck-content table {
    max-width: 100%;
}

.article-content img,
.period-content img,
.period-card-content img,
.fixed-content-card img,
.ck-content img {
    max-width: 100%;
    height: auto;
}

/* 2. 开奖倒计时小屏防重叠 */
@media (max-width: 420px) {
    .lottery-header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .lottery-countdown {
        position: static;
        transform: none;
        width: 100%;
        text-align: center;
        order: -1;
        font-size: 0.7rem;
    }

    .lottery-issue {
        flex: 1;
        text-align: left;
    }

    .lottery-links {
        flex: 0 0 auto;
    }
}

/* 3. 极小字体修复 — 手机最低不低于 11px */
@media (max-width: 480px) {
    .ball-zodiac {
        font-size: 0.7rem !important;
    }

    .lottery-issue,
    .lottery-history {
        font-size: 0.72rem !important;
    }

    .title-item-name {
        font-size: clamp(0.7rem, 2.5vw, 0.85rem) !important;
    }

    .footer-zodiac-left,
    .footer-zodiac-name {
        font-size: clamp(0.68rem, 2vw, 0.78rem) !important;
    }

    .footer-zodiac-conflict {
        font-size: clamp(0.6rem, 1.8vw, 0.72rem) !important;
    }

    .footer-five-label,
    .footer-wave-label {
        font-size: clamp(0.68rem, 2vw, 0.78rem) !important;
    }
}

/* 4. 触摸目标尺寸优化 — 最低 44px */
@media (max-width: 768px) {
    .lottery-history {
        padding: 8px 14px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    .announcement-close {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tool-modal-close {
        padding: 10px 14px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .carousel-dot {
        width: 12px;
        height: 12px;
        margin: 0 4px;
    }
}

/* 5. 底部生肖表极窄屏优化 */
@media (max-width: 360px) {
    .footer-zodiac-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .footer-zodiac-slot--balls {
        flex-wrap: nowrap !important;
    }

    .footer-zodiac-slot--balls .footer-ball-img,
    .footer-zodiac-slot--balls .number-ball,
    .footer-zodiac-numbers .number-ball {
        max-width: 16px !important;
        height: 18px !important;
        min-width: 0 !important;
    }

    .footer-zodiac-header {
        min-height: 30px;
    }
}

/* 6. banner图片移动端全宽 */
@media (max-width: 768px) {
    .banner-area img {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
}

/* 7. Swiper tab 小屏缩小 */
@media (max-width: 420px) {
    .tabNav .swiper-slide {
        width: 90px !important;
        margin: 0 6px !important;
        font-size: 13px !important;
    }

    .tabNav .swiper-slide.swiper-slide-active {
        width: 108px !important;
    }
}

/* 8. 移动端圆角和间距统一 */
@media (max-width: 768px) {
    .fixed-content-card {
        margin: 6px 10px 8px !important;
        border-radius: 12px !important;
    }

    .fixed-content-inner .fixed-content-card {
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .fixed-title-above,
    .fixed-above-periods,
    .fixed-below-periods,
    .fixed-content-area {
        padding: 0 10px;
    }

    .site-footer-content {
        margin: 0 10px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .fixed-content-card {
        margin: 4px 10px 6px !important;
        border-radius: 10px !important;
    }

    .fixed-content-inner .fixed-content-card {
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .site-footer-content {
        margin: 0 10px;
        border-radius: 10px;
    }
}
