/* 全局样式 */
:root {
    --primary: #4CAF7D;
    --primary-light: #81C784;
    --primary-dark: #388E3C;
    --primary-bg: #F1F8E9;
    --surname-bg: #E8F3E1;
    --surname-border: #D7E9CC;
    --accent: #66BB6A;
    --text: #37474F;
    --text-light: #607D8B;
    --text-lighter: #90A4AE;
    --border: #E0E0E0;
    --bg: #FAFFFE;
    --white: #FFFFFF;
    --shadow: 0 2px 12px rgba(var(--brand-rgb), 0.08);
    --shadow-hover: 0 4px 20px rgba(var(--brand-rgb), 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    /* 品牌辅助色（随主题切换；吉凶红绿、状态提示、五行木色、后台样式不在此列） */
    --primary-ink: #2E7D32;
    --primary-200: #E8F5E9;
    --primary-300: #C8E6C9;
    --brand-rgb: 76, 175, 125;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
    padding-top: 96px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

/* 头部导航 */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 96px;
}

.logo a,.logo-link {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.logo-img{
    width:64px;height:64px;border-radius:50%;
    box-shadow:0 0 16px rgba(var(--brand-rgb),.35);
    flex-shrink:0;
    animation:logoSpin 20s linear infinite;
}
@keyframes logoSpin{
    from{transform:rotate(0)}to{transform:rotate(360deg)}
}
.logo-text-wrap{
    display:flex;flex-direction:column;line-height:1.2;
}
.logo-main{
    font-family: "STKaiti", "KaiTi", "Kaiti SC", "楷体", "Noto Serif SC", "Songti SC", serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.15;
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 52%, #4CAF7D 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #2E7D32;
}
.logo-sub{
    font-size:13px;
    color:var(--text-lighter);
    font-weight:400;
    letter-spacing:1.5px;
    margin-top:3px;
    font-family: "Helvetica Neue", Arial, "PingFang SC", sans-serif;
}
.logo-icon {
    font-size: 28px;
}

.main-nav ul {
    display: flex;
    gap: 8px;
}

.main-nav a {
    display: block;
    padding: 8px 18px;
    color: var(--text);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

/* 导航 HOT 热度徽章：透明底、无框无填充，绝对浮在标签正上方靠右，不占行内高度、不挤低文字 */
.nav-label { position: relative; display: inline-block; }
.nav-hot {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: -4px;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 0;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
    background: transparent;
    border: none;
    border-radius: 0;
}
.nav-hot svg { width: 8px; height: 8px; flex-shrink: 0; }
.nav-hot-low { color: #E8890C; animation: hotPulse 2.6s ease-in-out infinite; }
.nav-hot-high { color: #C62828; animation: hotPulse 1.5s ease-in-out infinite, hotFlicker 1.1s ease-in-out infinite; }
@keyframes hotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }
@keyframes hotFlicker { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.3); } }
@media (prefers-reduced-motion: reduce) {
    .nav-hot-low, .nav-hot-high { animation: none; }
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary);
}

.mobile-menu {
    display: none;
    background: var(--white);
    border-top: 1px solid var(--border);
}

.mobile-menu.active {
    display: block;
}

.mobile-menu ul {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
}

.mobile-menu li a {
    display: block;
    text-align: center;
    padding: 11px 4px;
    color: var(--text);
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    font-size: 14px;
}

.mobile-menu li a:hover,
.mobile-menu li a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* 主体内容 */
.site-main {
    min-height: calc(100vh - 380px);
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Hero 区域 */
.hero {
    background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 50%, #C8E6C9 100%);
    border-radius: var(--radius);
    padding: 50px 40px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--brand-rgb), 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(var(--brand-rgb), 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.hero h1 {
    font-size: 32px;
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-weight: 700;
}

.hero p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.4);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary-bg);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 14px 40px;
    font-size: 17px;
}

/* 卡片样式 */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h1.card-title { margin: 0; }
/* 用户输入的姓 / 姓名高亮胶囊（标题与正文通用，随主题主色） */
.hl-input {
    color: var(--primary);
    background: var(--primary-200);
    padding: 1px 10px;
    border-radius: 8px;
    font-weight: 700;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

/* 卡片标题下分隔线（与首页卡片头一致） */
.line-head {
    border-bottom: 1px solid #D5D5D5 !important;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* 功能卡片网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.feature-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--white);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--white);
    cursor: pointer;
}

/* 三列布局 */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 16px;
}
.grid-3 .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.grid-3 .article-list {
    flex: 1;
}
@media (max-width: 1200px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
    .grid-3 { grid-template-columns: 1fr; }
}

/* 精选吉字卡片 */
.card-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; }
.grid-3 .card-header .card-title { white-space: nowrap; }
.zi-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    margin-right: 6px;
}
.zi-pick-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-content: start;
}
.zi-pick {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 13px 6px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    border: 1px solid #e8f3e4;
    text-decoration: none;
    animation: surnameIn .4s ease both;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
}
.zi-pick::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary-light);
    transform: translateX(-50%) scaleX(0);
    transition: transform .25s ease;
}
.zi-pick:hover {
    transform: translateY(-4px);
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 10px 20px rgba(var(--brand-rgb), .22);
}
.zi-pick:hover::after { transform: translateX(-50%) scaleX(1); }
.zi-pick:active { transform: translateY(-1px) scale(.98); }
.zi-pick-zi {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    transition: color .2s ease;
}
.zi-pick:hover .zi-pick-zi { color: var(--primary-dark); }
.zi-pick-py { font-size: 11px; color: var(--text-lighter); letter-spacing: .5px; }

/* 首页热门姓氏轻量入口 */
.surname-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}
.surname-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 14px 6px;
    border-radius: var(--radius-sm);
    background: var(--surname-bg);
    border: 1px solid var(--surname-border);
    text-decoration: none;
    animation: surnameIn .4s ease both;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
}
.surname-chip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary-light);
    transform: translateX(-50%) scaleX(0);
    transition: transform .25s ease;
}
.surname-chip:hover {
    transform: translateY(-4px);
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 10px 20px rgba(var(--brand-rgb), .22);
}
.surname-chip:hover::after { transform: translateX(-50%) scaleX(1); }
.surname-chip:active { transform: translateY(-1px) scale(.98); }
.surname-chip-name { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.15; transition: color .2s ease; }
.surname-chip:hover .surname-chip-name { color: var(--primary-dark); }
.surname-chip-py { font-size: 11px; color: var(--text-lighter); letter-spacing: .5px; }
.surname-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--primary);
    background: var(--primary-bg);
    border: 1px dashed var(--primary-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}
.surname-refresh:hover { background: #fff; border-color: var(--primary); }
.surname-refresh .refresh-icon { display: inline-block; transition: transform .5s ease; }
.surname-refresh.loading .refresh-icon { animation: surnameSpin .6s linear infinite; }
@keyframes surnameIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes surnameSpin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .surname-strip { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .surname-strip { grid-template-columns: repeat(3, 1fr); } }
.zi-pick-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: background .2s ease;
}
.zi-pick-refresh:hover { background: var(--primary-bg); }
.zi-pick-refresh .refresh-icon { display: inline-block; transition: transform .5s ease; }
.zi-pick-refresh.loading .refresh-icon { animation: refresh-spin .6s linear infinite; }
.zi-pick-refresh-bottom {
    width: 100%;
    height: auto;
    margin-top: auto;
    padding: 10px 12px;
    gap: 6px;
    justify-content: center;
    border: 1px dashed var(--primary-light);
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 13px;
    border-radius: var(--radius-sm);
}
.zi-pick-refresh-bottom:hover { background: #fff; border-color: var(--primary); }

/* 布局 */
.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.know-skill-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero {
        padding: 30px 20px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
}

/* 起名结果 */
.name-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.name-item {
    background: linear-gradient(135deg, var(--white) 0%, var(--primary-bg) 100%);
    border: 1px solid var(--primary-300);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.name-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.name-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    letter-spacing: 2px;
}
.name-text .nt-surname { color: var(--primary-dark); }
.name-text .nt-given { color: var(--text); }
.name-text .nt-given.boy { color: #5C9FD6; }
.name-text .nt-given.girl { color: #E87A9E; }

.name-score {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 10px;
}
.name-score .ns-num {
    color: #FFD54F;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.name-wuxing {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.name-meaning {
    font-size: 13px;
    color: var(--text-lighter);
    line-height: 1.5;
}

/* 测名结果 */
.score-display {
    text-align: center;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.score-avatar-mini {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(var(--brand-rgb),.18);
    flex-shrink: 0;
}
.score-avatar-mini svg { width: 100%; height: 100%; display: block; }

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) var(--score-percent, 85%), #E0E0E0 0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
}

.score-number {
    position: relative;
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-dark);
}

.wuge-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
}

@media (max-width: 500px) {
    .wuge-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.wuge-item {
    text-align: center;
    padding: 15px 10px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
}

.wuge-name {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.wuge-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.wuge-ji {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.wuge-ji.ji {
    background: #E8F5E9;
    color: #2E7D32;
}

.wuge-ji.xiong {
    background: #FFEBEE;
    color: #C62828;
}

.wuge-ji.ban {
    background: #FFF3E0;
    color: #E65100;
}

/* 文章列表 */
.article-list {
    display: grid;
    gap: 10px;
}

/* 三列文章列表（用于测名页底部知识卡片 / 测名知识栏目页） */
.article-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 12px;
    row-gap: 6px;
}
.article-cols-3 .article-item {
    border-bottom: none;
    border-left: 1px solid #ececec;
    border-radius: 0;
    padding: 7px 18px;
}
.article-cols-3 .article-item:nth-child(3n+1) {
    border-left: none;
    padding-left: 0;
}
.article-cols-3 .article-item:hover {
    background: none;
    border-radius: 0;
    padding-left: 18px;
}
.article-cols-3 .article-item:nth-child(3n+1):hover {
    padding-left: 0;
}
.article-cols-3 .article-item a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.article-cols-3 .article-item a::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary, #2E7D32);
    margin-right: 8px;
    vertical-align: middle;
}
@media (max-width: 768px) {
    .article-cols-3 { grid-template-columns: 1fr; }
    .article-cols-3 .article-item,
    .article-cols-3 .article-item:nth-child(3n+1),
    .article-cols-3 .article-item:hover,
    .article-cols-3 .article-item:nth-child(3n+1):hover {
        border-left: none;
        padding-left: 15px;
        padding-right: 0;
    }
}

.article-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item:hover {
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    padding-left: 20px;
}

.article-item a {
    color: var(--text);
    font-size: 15px;
    display: block;
    margin-bottom: 5px;
}

.article-item a:hover {
    color: var(--primary);
}

.article-meta {
    font-size: 12px;
    color: var(--text-lighter);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 五行字分类 */
.wuxing-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wuxing-tab {
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    background: #f5f5f5;
    color: var(--text-light);
    border: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wuxing-tab.active,
.wuxing-tab:hover {
    background: var(--primary);
    color: white;
}

.wuxing-jin { color: #FFD700; }
.wuxing-mu { color: #4CAF50; }
.wuxing-shui { color: #2196F3; }
.wuxing-huo { color: #F44336; }
.wuxing-tu { color: #795548; }

.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.char-item {
    text-align: center;
    padding: 10px 5px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.char-item:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.char-item-link {
    color: inherit;
    text-decoration: none;
    display: block;
}
.char-item-link:hover {
    color: #fff;
    text-decoration: none;
}

/* 底部 */
.site-footer {
    background: #2E3B36;
    color: #B0BEC5;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: #81C784;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #90A4AE;
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: #81C784;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #3E4F48;
    font-size: 13px;
    color: #78909C;
}

/* 结果区域样式 */
.result-section {
    margin: 25px 0;
}

.result-section h3 {
    font-size: 17px;
    color: var(--primary-dark);
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

.desc-block {
    background: #FAFAFA;
    padding: 15px;
    border-radius: var(--radius-sm);
    line-height: 1.8;
    color: var(--text);
}

.desc-block p {
    margin-bottom: 10px;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid #4CAF50;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid #2196F3;
}

.alert-warning {
    background: #FFF8E1;
    color: #F57F17;
    border-left: 4px solid #FFC107;
}

.alert-danger {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid #F44336;
}

/* 后台样式 */
.admin-body {
    background: #f5f7f5;
    padding-top: 0;
}

.admin-header {
    background: #2E7D32;
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.admin-logo {
    font-size: 20px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.admin-header-right a {
    color: white;
    opacity: 0.9;
}

.admin-header-right a:hover {
    opacity: 1;
}

.admin-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.admin-sidebar {
    width: 220px;
    background: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    padding: 20px 0;
}

.admin-sidebar ul li a {
    display: block;
    padding: 12px 25px;
    color: var(--text);
    border-left: 3px solid transparent;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-left-color: var(--primary);
}

.admin-content {
    flex: 1;
    padding: 25px;
}

.admin-page-title {
    font-size: 22px;
    margin-bottom: 25px;
    color: var(--text);
}

.admin-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th {
    background: var(--primary-bg);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 14px;
}

.admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.admin-table tr:hover td {
    background: #FAFAFA;
}

.admin-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-right: 5px;
    display: inline-block;
}

.admin-btn-edit {
    background: #E3F2FD;
    color: #1976D2;
}

.admin-btn-del {
    background: #FFEBEE;
    color: #D32F2F;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.status-1 {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-0 {
    background: #FFEBEE;
    color: #C62828;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    padding-top: 0;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(var(--brand-rgb), 0.2);
    width: 400px;
    max-width: 90%;
}

.login-box h2 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 30px;
}

/* ============================================================
   名字详情页
   ============================================================ */
/* 面包屑增加左侧内边距，不要太靠边 */
.breadcrumb {
    padding-left: 8px;
    margin-top: 4px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { color: var(--primary-dark); }

.detail-hero {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.detail-name {
    font-size: 44px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 6px;
    margin-bottom: 10px;
}
.detail-wuxing-row { display: flex; gap: 8px; margin-bottom: 10px; }
.wx-tag {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #fff;
    background: var(--primary);
}
.wx-金 { background: #C9A227; }
.wx-木 { background: #4CAF7D; }
.wx-水 { background: #2196F3; }
.wx-火 { background: #E53935; }
.wx-土 { background: #8D6E63; }
.detail-sub { color: var(--text-light); font-size: 14px; }
.detail-hero-right { text-align: center; }
.detail-score-circle {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 4px 16px rgba(var(--brand-rgb),0.25);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px;
}
.detail-score-num { font-size: 40px; font-weight: 700; color: var(--primary-dark); }
.detail-score-unit { font-size: 14px; color: var(--primary); margin-left: 2px; }
.detail-score-label { color: var(--primary-dark); font-size: 14px; font-weight: 600; }

/* 评分条 */
.score-bars { display: grid; gap: 14px; }
.score-bar-row { display: flex; align-items: center; gap: 12px; }
.score-bar-name { width: 80px; font-size: 14px; color: var(--text-light); flex-shrink: 0; }
.score-bar-track { flex: 1; height: 10px; background: #EEF5EE; border-radius: 6px; overflow: hidden; }
.score-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--primary)); border-radius: 6px; transition: width 0.6s ease; }
.score-bar-val { width: 52px; text-align: right; font-size: 13px; color: var(--primary-dark); font-weight: 600; flex-shrink: 0; }

/* 五行强度条 */
.wuxing-bars { display: grid; gap: 10px; }
.wuxing-bar-row { display: flex; align-items: center; gap: 10px; }
.wx-label { width: 24px; text-align: center; font-size: 14px; font-weight: 600; color: var(--text); flex-shrink: 0; }
.wx-track { flex: 1; height: 14px; background: #F0F0F0; border-radius: 8px; overflow: hidden; }
.wx-fill { height: 100%; border-radius: 8px; transition: width 0.6s ease; }
.wx-pct { width: 48px; text-align: right; font-size: 13px; color: var(--text-light); flex-shrink: 0; }

/* 通用段落与高亮 */
.detail-p { color: var(--text); line-height: 1.9; font-size: 15px; }
.hl-name { color: var(--primary-dark); }
.hl-金 { color: #C9A227; }
.hl-木 { color: #4CAF7D; }
.hl-水 { color: #2196F3; }
.hl-火 { color: #E53935; }
.hl-土 { color: #8D6E63; }
.hl-ji { color: #2E7D32; }
.hl-ban { color: #E65100; }
.hl-xiong { color: #C62828; }
.kw-tag {
    display: inline-block; padding: 2px 10px; margin: 2px 4px 2px 0;
    background: var(--primary-bg); color: var(--primary-dark);
    border-radius: 12px; font-size: 13px;
}

/* 出生信息表 */
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table th, .detail-table td {
    border: 1px solid #EAF3EA; padding: 10px; text-align: center;
}
.detail-table th { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
.detail-table .td-label { background: #F7FBF7; color: var(--text-light); }

/* 五格小卡补充 */
.wuge-wx { font-size: 12px; color: var(--text-lighter); margin-top: 3px; }

/* 用字详解 */
.char-detail-block {
    padding: 16px; margin-bottom: 14px;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--primary-bg) 100%);
    border: 1px solid var(--primary-300); border-radius: var(--radius);
}
.char-detail-block:last-child { margin-bottom: 0; }
.char-detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.char-detail-zi {
    width: 60px; height: 60px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; font-weight: 700; color: var(--primary-dark);
    background: #fff; border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(var(--brand-rgb),0.15);
}
.char-detail-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-light); }
.char-detail-line { font-size: 14px; color: var(--text); line-height: 1.8; margin-top: 6px; }
.char-detail-line b { color: var(--primary-dark); }

/* 五格数理详解 */
.wuge-detail-row { padding: 14px 0; border-bottom: 1px dashed #EAF3EA; }
.wuge-detail-row:last-child { border-bottom: none; }
.wuge-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wuge-detail-name { font-weight: 600; color: var(--primary-dark); font-size: 15px; }
.wuge-detail-desc { font-size: 14px; color: var(--text); line-height: 1.7; }
.wuge-detail-tip { font-size: 12px; color: var(--text-lighter); margin-top: 4px; }

@media (max-width: 768px) {
    .detail-name { font-size: 32px; letter-spacing: 3px; }
    .detail-hero { padding: 20px; }
    .score-bar-name { width: 64px; font-size: 13px; }
}

/* 姓氏溯源 */
.surname-zh { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.surname-zh-zi {
    width: 64px; height: 64px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb),0.3);
}
.surname-zh-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-light); }
.surname-zh-meta b { color: var(--primary-dark); }
.surname-block {
    padding: 12px 14px; margin-top: 10px;
    background: var(--primary-bg); border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px; color: var(--text); line-height: 1.9;
}
.surname-block b { color: var(--primary-dark); }

/* ==================== 名字详情页样式（nd-* 前缀） ==================== */
.nd-hero {
    background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
}
.nd-name {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 8px;
    margin: 10px 0 14px;
}
.nd-score-ring {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 14px;
    padding: 16px 28px;
    box-shadow: 0 4px 16px rgba(var(--brand-rgb),0.15);
    margin: 10px 0;
}
.nd-score-num {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.nd-score-label {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}
.nd-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 24px;
    margin-top: 16px;
    font-size: 14px;
    color: #555;
}
.nd-hero-meta b { color: var(--primary-dark); }

.nd-section {
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid #F0F4F0;
}
.nd-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}
.nd-p { font-size: 14px; color: #444; line-height: 1.9; margin: 8px 0; }

/* 评分条（音形义/五行等横向条） */
.nd-score-bars {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.nd-score-row {
    display: grid;
    grid-template-columns: 80px 1fr 50px;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.nd-score-row .lb { color: var(--text); font-weight: 500; }
.nd-score-row .tk {
    height: 10px;
    background: #F0F4F0;
    border-radius: 5px;
    overflow: hidden;
}
.nd-score-row .fl {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 5px;
    transition: width 0.6s ease;
}
.nd-score-row .vl { text-align: right; color: var(--primary); font-weight: 600; }

/* 音形义三栏卡片 */
.nd-yxy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 14px;
}
.nd-yxy-card { }
.nd-yxy-card > div:first-child { font-size: 15px; margin-bottom: 8px; }

/* 出生信息/八字表 —— 使用 CSS Grid 实现，避免打印时 table 收缩问题 */
/* 出生基本信息表格：用CSS Grid替代table，强制撑满父容器100%宽度，列宽比例锁定、不留白 */
.nd-bz-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overflow-y:hidden;border-radius:8px;box-sizing:border-box;}
.nd-bz-grid{
    display:grid !important;
    grid-template-columns:14% 1fr 1fr 1fr 1fr !important;
    width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
    margin:0 !important;
    padding:0 !important;
    border-collapse:collapse;
}
.nd-bz-grid .bz-row { display: contents; }
.nd-bz-grid .bz-cell {
    padding: 10px 8px;
    border: 1px solid var(--primary-300);
    text-align: center;
    box-sizing: border-box;
    font-size: 14px;
    background: #fff;
    color: #333;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}
.nd-bz-grid .bz-th-corner { background: var(--primary-bg); }
.nd-bz-grid .bz-th {
    background: var(--primary-200);
    color: var(--primary-ink);
    font-weight: 600;
}
.nd-bz-grid .bz-th-label {
    background: var(--bg);
    color: var(--primary-ink);
    font-weight: 600;
}

/* 姓氏溯源 */
.nd-sur { display: flex; gap: 18px; align-items: flex-start; }
.nd-sur-badge {
    width: auto; min-width: 88px; min-height: 88px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    text-align: center; line-height: 1.25; padding: 10px 12px;
    font-size: 38px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(var(--brand-rgb),0.25);
}
.nd-sur-badge.len2 { font-size: 30px; letter-spacing: 2px; }
.nd-sur-badge.len3 { font-size: 24px; letter-spacing: 1px; }
.nd-sur-badge.len4, .nd-sur-badge.len5 { font-size: 18px; letter-spacing: 1px; }
.nd-sur-badge.len6 { font-size: 16px; letter-spacing: 1px; }
.nd-sur-badge.len7 { font-size: 15px; letter-spacing: 0; }
.nd-sur-badge.len8 { font-size: 14px; letter-spacing: 0; }
.nd-sur-badge.len9 { font-size: 13px; letter-spacing: 0; }
.nd-sur-meta {
    display: flex; flex-wrap: wrap; gap: 4px 20px;
    font-size: 14px; color: #555; margin-bottom: 8px;
}
.nd-sur-meta b { color: var(--primary-dark); }
.nd-sur-text { font-size: 14px; color: #444; line-height: 1.9; margin: 4px 0; }
.nd-sur-text .label { color: #888; margin-right: 4px; }

/* 五行条 */
.nd-bars-h { display: grid; gap: 10px; margin-top: 12px; }
.nd-bars-h .row {
    display: grid;
    grid-template-columns: 36px 1fr 110px;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.nd-bars-h .lb { font-weight: 600; color: var(--primary-dark); }
.nd-bars-h .tk { height: 10px; background: #F0F4F0; border-radius: 5px; overflow: hidden; }
.nd-bars-h .fl { height: 100%; border-radius: 5px; }
.nd-bars-h .vl { color: #666; font-size: 13px; }

/* 五格总览卡片 */
.nd-wuge-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.nd-wuge-card {
    background: var(--bg);
    border: 1px solid var(--primary-200);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    position: relative;
}
.nd-wuge-card .l { font-size: 13px; color: #888; }
.nd-wuge-card .n { font-size: 28px; font-weight: 700; color: var(--primary-dark); margin: 4px 0; }
.nd-wuge-card .w { font-size: 12px; color: #666; margin-bottom: 6px; }
.nd-wuge-card .j {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.nd-wuge-card .d { font-size: 12px; color: #999; margin-top: 6px; line-height: 1.6; }

/* 五格详解项 */
.nd-wuge-detail { display: grid; gap: 12px; }
.nd-wuge-item {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--primary-200);
    border-radius: 10px;
}
.nd-wuge-item .jl {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    height: fit-content;
}
.nd-wuge-item .body { flex: 1; }
.nd-wuge-item .title { font-size: 15px; font-weight: 600; color: var(--primary-dark); }
.nd-wuge-item .title small { font-weight: 400; color: #888; font-size: 13px; margin-left: 6px; }
.nd-wuge-item .desc { font-size: 14px; color: #444; line-height: 1.8; margin-top: 4px; }
.nd-wuge-item .poem { }
.nd-wuge-item .note { }

/* 单字详解卡片 */
.nd-char-grid { display: grid; gap: 14px; }
.nd-char-card {
    background: var(--bg);
    border: 1px solid var(--primary-200);
    border-radius: 12px;
    padding: 18px;
}
.nd-char-row { display: flex; gap: 16px; align-items: flex-start; }
.nd-char-zi {
    width: 72px; height: 72px;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(var(--brand-rgb),0.25);
}
.nd-char-zi.len2 { font-size: 28px; letter-spacing: 1px; }
.nd-char-zi.len3 { font-size: 22px; letter-spacing: 1px; }
.nd-char-body .py { color: #555; }
.nd-char-body .py b { color: #555; }

/* 底部操作按钮 */
.nd-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0 20px;
}
.nd-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s;
    cursor: pointer;
    border: none;
}
.nd-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--brand-rgb),0.3);
}
.nd-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(var(--brand-rgb),0.4); }
.nd-btn-ghost {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.nd-btn-ghost:hover { background: var(--primary-bg); }

/* 吉凶标签通用色 */
.j-daji  { background: #E8F5E9; color: #2E7D32; }
.j-ji    { background: #E8F5E9; color: #388E3C; }
.j-banji { background: #FFF8E1; color: #F57F17; }
.j-xiong { background: #FFEBEE; color: #C62828; }
.j-daxiong{background: #FFEBEE; color: #B71C1C; }

/* 姓名测试结果页五格详解卡片样式 */
.wuge-detail-list { margin-top: 8px; }
.wuge-detail-item {
    display: flex; gap: 14px; padding: 12px 0;
    border-bottom: 1px dashed var(--primary-200); align-items: flex-start;
}
.wuge-detail-item:last-child { border-bottom: none; }
.wuge-detail-item .wd-tag {
    flex-shrink: 0; min-width: 56px; padding: 5px 10px;
    text-align: center; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.wuge-detail-item .wd-tag.daji { background: #E8F5E9; color: #2E7D32; }
.wuge-detail-item .wd-tag.ji   { background: #F1F8E9; color: #558B2F; }
.wuge-detail-item .wd-tag.ban  { background: #FFF8E1; color: #E65100; }
.wuge-detail-item .wd-tag.xiong,.wuge-detail-item .wd-tag.daxiong
    { background: #FFEBEE; color: #C62828; }
.wuge-detail-item .wd-body { flex: 1; font-size: 14px; line-height: 1.8; color: #444; }
.wuge-detail-item .wd-title { font-weight: 600; color: var(--primary-dark); margin-bottom: 4px; font-size: 15px; }
.wuge-detail-item .wd-title small { color: #999; font-weight: 400; margin-left: 6px; font-size: 13px; }
.wuge-detail-item .wd-meta { font-size: 12px; color: #888; margin-top: 4px; }

/* 平板 & 手机 */
@media (max-width: 768px) {
    .wuge-detail-item { flex-direction: column; gap: 6px; }
    .wuge-detail-item .wd-tag { width: auto; align-self: flex-start; padding: 4px 12px; }
}
@media (max-width: 480px) {
}
@media (min-width: 1200px) {
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
    .nd-hero { padding: 22px 16px; }
    .nd-name { font-size: 36px; letter-spacing: 4px; }
    .nd-score-num { font-size: 40px; }
    .nd-section { padding: 18px 16px; }
    .nd-yxy-grid { grid-template-columns: 1fr; }
    .nd-wuge-grid { grid-template-columns: repeat(2, 1fr); }
    .nd-wuge-item { flex-direction: column; gap: 8px; }
    /* 移动端：徽章置顶居中，解释整行排在徽章下方 */
    .nd-sur { flex-direction: column; align-items: stretch; text-align: left; gap:12px; }
    .nd-sur-badge { margin: 0 auto; width:auto; min-width:68px; min-height:68px; text-align:center; line-height:1.25; font-size:30px; }
    .nd-char-row { flex-direction: column; align-items: center; gap:10px; }
    .nd-char-body { width:100%; text-align:left; }
    .nd-sur-badge.len2 { font-size:24px; }
    .nd-sur-badge.len3 { font-size:19px; }
    .nd-sur-badge.len4, .nd-sur-badge.len5 { font-size:15px; }
    .nd-sur-badge.len6 { font-size:14px; }
    .nd-sur-badge.len7 { font-size:13px; }
    .nd-sur-badge.len8, .nd-sur-badge.len9 { font-size:12px; }
    .nd-sur-meta { justify-content: flex-start; }
    .nd-score-row { grid-template-columns: 70px 1fr 44px; font-size: 13px; }
    .nd-bars-h .row { grid-template-columns: 32px 1fr 96px; font-size: 13px; }
    .form-row[style*="1fr 1fr"] { grid-template-columns: 1fr !important; gap: 14px; }
}
@media (max-width: 480px) {
    .nd-name { font-size: 30px; letter-spacing: 3px; }
    .nd-score-num { font-size: 36px; }
    .nd-wuge-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .nd-wuge-card .n { font-size: 24px; }
    .nd-char-zi { width: 58px; height: 58px; font-size: 32px; }
    .nd-actions .nd-btn { padding: 9px 18px; font-size: 13px; }
}

/* ==================== 打印样式：只打印名字详情 ==================== */
@media print {
    body * { visibility: hidden !important; }
    .site-header, .site-footer, .mobile-menu, .nd-actions,
    .hero, .breadcrumb, .sidebar, .ad, .float-btns, .toast, .nd-tip,
    .form-section, .list-section, .tool-bar, .pagination, .back-top,
    .btn-row, .nav-wrap,
    script, style, noscript { display: none !important; }
    main.site-main, main.site-main * { visibility: visible !important; }
    main.site-main {
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }
    .container { max-width: 100% !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: none !important; }
    /* 详情页 hero 区：去大叶子、淡化背景，打印靠左 */
    .nd-hero {
        background: #FAFDFA !important;
        padding: 14px 18px !important;
        border: 1px solid #E0E8E0 !important;
        border-radius: 8px !important;
        margin-bottom: 12px !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 18px !important;
        text-align: left !important;
    }
    .nd-hero-body { text-align: left !important; }
    .nd-name { text-align: left !important; font-size: 34px !important; letter-spacing:4px !important; }
    .nd-hero-meta { justify-content: flex-start !important; }
    .nd-score { flex-shrink: 0; }
    .nd-avatar { width: 90px !important; height: 90px !important; }
    .nd-hero::before, .nd-hero::after { display: none !important; content: none !important; }
    /* 测试结果页 score-circle：圆环淡化、去掉装饰 */
    .score-display {
        padding: 14px 0 !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 18px !important;
        flex-wrap: wrap !important;
    }
    .score-display h3 {
        width: 100% !important;
        text-align: left !important;
        margin: 4px 0 0 !important;
        font-size: 16px !important;
        order: 3 !important;
    }
    .score-avatar-mini { width: 86px !important; height: 86px !important; order: 1 !important; }
    .score-circle { order: 2 !important; width: 96px !important; height: 96px !important; }
    .score-circle {
        background: #f0f0f0 !important;
        width: 110px !important; height: 110px !important;
    }
    .score-circle::before {
        width: 86px !important; height: 86px !important;
        border: 1px solid #ddd !important;
    }
    .score-circle::after, .score-display::before, .score-display::after {
        display: none !important; content: none !important;
    }
    .score-number { font-size: 30px !important; }
    /* 结果页五格卡片 */
    .nd-section, .result-section {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid; page-break-inside: avoid;
        margin-bottom: 10px !important; padding: 12px 14px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    /* 所有打印内容强制撑满打印宽度，防止卡片父容器收缩 */
    .site-main, .container, .nd-detail-wrap, .content-wrap {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .nd-name { font-size: 32px !important; letter-spacing: 4px !important; margin: 4px 0 8px !important; }
    .nd-wuge-grid { grid-template-columns: repeat(5, 1fr) !important; gap: 6px !important; }
    .nd-wuge-card { box-shadow: none !important; border: 1px solid #ddd !important; padding: 8px 4px !important; }
    .nd-wuge-card .n { font-size: 22px !important; }
    .nd-yxy-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
    .wuge-grid { gap: 6px !important; }
    .wuge-item { padding: 10px 6px !important; background: #FAFDFA !important; border: 1px solid #E0E8E0 !important; }
    .wuge-detail-item { padding: 8px 0 !important; }
    a { text-decoration: none !important; color: #000 !important; }
    .nd-btn, .btn { display: none !important; }
    /* 姓氏溯源打印时左对齐，避免徽章居中造成混乱 */
    .nd-sur { display:flex !important; flex-direction:row !important; align-items:flex-start !important; text-align:left !important; gap:14px !important; flex-wrap:wrap !important; }
    .nd-sur-meta { justify-content:flex-start !important; text-align:left !important; }
    .nd-sur-badge { width:auto !important; min-width:68px !important; min-height:68px !important; height:auto !important; text-align:center !important; line-height:1.25 !important; }
    /* 出生基本信息表格（CSS Grid版）：强制撑满，列宽比例锁定，绝不收缩留白 */
    .nd-bz-grid {
        display: grid !important;
        grid-template-columns: 14% 1fr 1fr 1fr 1fr !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .nd-bz-grid .bz-row { display: contents !important; }
    .nd-bz-grid .bz-cell {
        display: block !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        border: 1px solid var(--primary-300) !important;
        padding: 9px 4px !important;
        text-align: center !important;
        vertical-align: middle !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
        background: #fff !important;
        color: #000 !important;
        white-space: nowrap !important;
        word-break: keep-all;
        margin: 0 !important;
        flex: none !important;
    }
    .nd-bz-grid .bz-th-corner { background: var(--primary-bg) !important; }
    .nd-bz-grid .bz-th { background: var(--primary-200) !important; color: var(--primary-ink) !important; font-weight:600 !important; }
    .nd-bz-grid .bz-th-label { background: var(--bg) !important; color: var(--primary-ink) !important; font-weight:600 !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; color-adjust: exact; }
    @page { margin: 12mm; size: A4; }
}


/* ========== 出生日期：年/月/日三个美化下拉 + 时辰下拉，统一绿色主题 ========== */
.mingli-datetime-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    margin-bottom: 6px;
}
.mingli-datetime-row .md-date,
.mingli-datetime-row .md-hour {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.mingli-datetime-row .md-date { flex: 1.6; }
.mingli-datetime-row .md-hour { flex: 1; }
/* ===== 出生日期 / 出生时辰：两侧标签栏强制等高，下拉框顶端严格水平对齐 ===== */
.mingli-datetime-row {
    align-items: flex-start !important;
}
.mingli-datetime-row .md-date,
.mingli-datetime-row .md-hour {
    display: flex !important;
    flex-direction: column !important;
}
/* 两侧标签统一固定高度（左侧含"公历/农历"切换按钮，右侧只有文字），
   高度一致后，下方 select 的边框顶端就必然处在同一条水平线上 */
.mingli-datetime-row > .md-date > .form-label,
.mingli-datetime-row > .md-hour > .form-label {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: 1.2 !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}
.cal-toggle {
    height: 30px !important;
    max-height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

.md-date-three {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
}
.mingli-datetime-row select.md-ymd,
.mingli-datetime-row select.md-hour-select,
.mingli-datetime-row select.form-hour {
    flex: 1;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    line-height: 46px !important;
    padding: 0 32px 0 14px !important;
    font-size: 15px;
    color: #333 !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2390A4AE' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px 12px !important;
    border: 1.5px solid #E0E5E0 !important;
    border-radius: 10px !important;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
    box-sizing: border-box;
    margin: 0 !important;
    text-align: center;
}
.mingli-datetime-row select:hover {
    border-color: var(--primary) !important;
}
.mingli-datetime-row select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.12) !important;
}

/* === 响应式断点 === */
/* 大屏 */
@media (min-width: 1200px) {
    .mingli-datetime-row select.md-ymd,
    .mingli-datetime-row select.md-hour-select { height: 50px; line-height: 50px; font-size: 15px; }
}
/* 平板及以下：堆叠一列 */
@media (max-width: 768px) {
    .mingli-datetime-row {
        flex-direction: column !important;
        gap: 12px !important;
    }
    .mingli-datetime-row .md-date,
    .mingli-datetime-row .md-hour {
        width: 100% !important;
        flex: 1 1 auto !important;
    }
    .mingli-datetime-row select.md-ymd,
    .mingli-datetime-row select.md-hour-select {
        height: 46px;
        line-height: 46px;
        font-size: 16px; /* 防止iOS自动放大 */
    }
    .md-date-three { gap: 6px; }
}
/* 手机 */
@media (max-width: 480px) {
    .mingli-datetime-row select.md-ymd,
    .mingli-datetime-row select.md-hour-select {
        height: 44px;
        line-height: 44px;
        font-size: 15px;
        border-radius: 8px !important;
    }
    .md-date-three { gap: 5px; }
    .mingli-datetime-row select.md-ymd { padding: 0 22px 0 6px !important; }
}

/* ========== 移动端响应式补强：全站各页面合理显示 ========== */
@media (max-width: 768px) {
    /* 容器收紧内边距 */
    .container { padding: 0 12px; }
    .card { padding: 18px 14px; border-radius: 12px; }
    .card-header { padding-bottom: 10px; margin-bottom: 14px; }
    .card-title { font-size: 18px; }

    /* 首页Hero */
    .hero { padding: 24px 16px; border-radius: 14px; }
    .hero h1 { font-size: 22px; line-height: 1.4; letter-spacing: 1px; }
    .hero p { font-size: 14px; line-height: 1.7; }
    .hero-actions { flex-direction: column; gap: 10px; }
    .hero-actions .btn { width: 100%; }

    /* 起名推荐名字网格 */
    .name-result-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .name-item { padding: 14px 10px; }
    .name-text { font-size: 24px; letter-spacing: 2px; margin-bottom: 6px; }
    .name-score { font-size: 12px; padding: 2px 10px; }
    .name-wuxing { margin: 6px 0; }
    .name-wuxing .wx-tag { font-size: 11px !important; padding: 0 6px !important; }
    .name-meaning { font-size: 12px; line-height: 1.5; }
    /* 红字淡绿按钮：小屏适配 */
    .btn-detail-redgreen { font-size: 13px !important; padding: 9px 0 !important; }

    /* 测名结果评分区 */
    .score-display { padding: 16px 6px; gap: 14px; flex-wrap: wrap; }
    .score-avatar-mini { width: 86px; height: 86px; }
    .score-circle { width: 120px; height: 120px; }
    .score-circle::before { width: 96px; height: 96px; }
    .score-number { font-size: 34px; }
    .score-display h3 { font-size: 16px; width: 100%; margin: 6px 0 0 !important; text-align:center; }

    /* 五格网格 */
    .wuge-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .wuge-item { padding: 10px 6px; border-radius: 10px; }
    .wuge-item .wuge-num { font-size: 22px; }

    /* 详情页hero */
    .nd-hero { flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 18px 14px; }
    .nd-avatar { width: 96px; height: 96px; margin: 0 auto; flex-shrink: 0; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(var(--brand-rgb),.22); }
    .nd-avatar svg { width: 100%; height: 100%; display: block; }
    .nd-hero-body { width: 100%; text-align: center; }
    .nd-name { text-align: center; }
    .nd-hero-meta { justify-content: center; }

    /* 五格详解卡 */
    .nd-wuge-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
    .nd-wuge-card { padding: 10px 8px; }
    .nd-wuge-card .n { font-size: 22px; }
    .nd-wuge-card .d { font-size: 12px; line-height: 1.5; }

    /* 五行进度条 */
    .nd-bars-h .row { grid-template-columns: 28px 1fr 80px !important; font-size: 12px !important; gap: 6px !important; }
    .nd-bars-h .vl { font-size: 11px !important; }

    /* 音形义三栏改单列 */
    .nd-yxy-grid { grid-template-columns: 1fr !important; gap: 10px !important; }

    /* 汉字详解卡 */
    .nd-char-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .nd-char-zi { width: 54px; height: 54px; font-size: 28px; }

    /* 表单控件 */
    .form-control, .form-select { font-size: 16px !important; height: 46px; }
    .btn-lg { height: 48px !important; font-size: 16px !important; min-width: 180px !important; }
    .gender-radio-row { gap: 8px !important; }
    .gender-opt { font-size: 14px !important; padding: 9px 0 !important; }

    /* 面包屑 */
    .breadcrumb { font-size: 13px; }

    /* 防止横向溢出 */
    body { overflow-x: hidden; }
    table { width: 100%; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    img { max-width: 100%; height: auto; }
}

@media (max-width: 400px) {
    /* 极小屏下名字卡改为单列，避免挤压 */
    .name-result-grid { grid-template-columns: 1fr; }
    .name-text { font-size: 26px; }
    .score-circle { width: 110px; height: 110px; }
    .score-circle::before { width: 88px; height: 88px; }
    .score-number { font-size: 30px; }
    .score-avatar-mini { width: 78px; height: 78px; }
    .nd-wuge-grid { grid-template-columns: 1fr 1fr !important; }
    .nd-char-grid { grid-template-columns: 1fr; }
}

/* ========== 太极命盘加载层 ========== */
.ml-loading {
    position: fixed; left:0; top:0; right:0; bottom:0; z-index:99999;
    display:none; align-items:center; justify-content:center;
    opacity:0; transition: opacity .25s ease-out;
    pointer-events:none;
}
.ml-loading.show {
    display:flex; opacity:1; pointer-events:auto;
}
.ml-loading-mask {
    position:absolute; inset:0;
    background: rgba(10, 30, 20, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.ml-loading-box {
    position:relative; z-index:2;
    display:flex; align-items:center; gap:30px;
    padding:32px 40px;
    background: linear-gradient(135deg, rgba(255,255,255,.96) 0%, rgba(245,252,246,.96) 100%);
    border-radius:22px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 0 0 1px rgba(var(--brand-rgb),.15);
    max-width: 92vw;
}
.ml-loading-disk {
    width:180px; height:180px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    position:relative;
}
.ml-taiji {
    width:100%; height:100%;
    border-radius:50%;
    filter: drop-shadow(0 6px 18px rgba(var(--brand-rgb),.35));
    animation: mlSpin 1.8s linear infinite;
}
@keyframes mlSpin { from{ transform: rotate(0deg); } to{ transform: rotate(360deg); } }
.ml-loading-disk::after {
    content:''; position:absolute; inset:-6px;
    border-radius:50%;
    background: conic-gradient(from 0deg, rgba(var(--brand-rgb),0) 0deg, rgba(var(--brand-rgb),.6) 90deg, rgba(var(--brand-rgb),0) 180deg, rgba(var(--brand-rgb),.5) 270deg, rgba(var(--brand-rgb),0) 360deg);
    animation: mlRingSpin 1.2s linear infinite reverse;
    z-index:-1; filter: blur(3px);
}
@keyframes mlRingSpin { to { transform: rotate(-360deg); } }
.ml-loading-info { min-width: 280px; }
.ml-loading-title {
    font-size:22px; font-weight:700; color:var(--primary-ink);
    margin-bottom:14px; letter-spacing:2px; text-align:center;
    background: linear-gradient(90deg,var(--primary),var(--primary-light));
    -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.ml-loading-row { display:flex; align-items:center; gap:8px; font-size:15px; color:#555; line-height:1.9; }
.ml-ic { font-size:16px; width:22px; display:inline-block; text-align:center; }
.ml-loading-row b { color:var(--primary-ink); font-weight:600; }
.ml-zodiac { margin-left:auto; font-size:14px; color:#8D6E63; font-weight:500; }
.ml-loading-steps {
    margin-top:14px; padding:10px 14px;
    background: linear-gradient(90deg,var(--primary-bg),var(--primary-200));
    border-radius:10px; border-left:3px solid var(--primary);
    font-size:14px; color:var(--primary-dark); text-align:center; font-weight:500;
}
@media (max-width: 600px) {
    .ml-loading-box { flex-direction:column; gap:18px; padding:26px 24px; }
    .ml-loading-disk { width:140px; height:140px; }
    .ml-loading-info { min-width: 0; width:100%; }
    .ml-loading-title { font-size:20px; }
    .ml-loading-row { font-size:14px; }
}
.bazi-top-bar{animation:fadeInUp .5s ease .2s both;} @keyframes fadeInUp{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}

/* ===== 提交加载遮罩层（两阶段：小圆盘 → 扩大结果展示） ===== */
.ml-loading{position:fixed;inset:0;z-index:999999;display:none;}
.ml-loading.show{display:flex;}
.ml-loading-mask{position:absolute;inset:0;background:rgba(30,60,45,.58);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);}

/* 阶段1：小盒子（中心动画，命盘旋转+信息） */
.ml-box-phase1{position:relative;z-index:2;margin:auto;display:flex;align-items:center;gap:36px;padding:32px 40px;background:#fff;border-radius:24px;box-shadow:0 20px 60px rgba(0,0,0,.25);max-width:720px;animation:mlPopIn .35s cubic-bezier(.34,1.56,.64,1);}
@keyframes mlPopIn{from{opacity:0;transform:scale(.7);}to{opacity:1;transform:scale(1);}}
.ml-disk-wrap{position:relative;width:150px;height:150px;flex-shrink:0;}
.ml-disk-ring{position:absolute;inset:-10px;border-radius:50%;border:3px dashed rgba(var(--brand-rgb),.55);animation:mlRotateCW 4s linear infinite;}
.ml-disk-ring::before{content:'';position:absolute;inset:8px;border-radius:50%;border:2px solid rgba(var(--brand-rgb),.4);animation:mlRotateCCW 6s linear infinite;}
.ml-taiji-center{position:absolute;inset:20px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#fff 0%,var(--primary-bg) 40%,var(--primary-300) 100%);display:flex;align-items:center;justify-content:center;box-shadow:0 6px 18px rgba(var(--brand-rgb),.3);animation:mlRotateCCW 8s linear infinite;}
.ml-taiji-center img{width:100%;height:100%;border-radius:50%;object-fit:cover;}
@keyframes mlRotateCW{to{transform:rotate(360deg);}}
@keyframes mlRotateCCW{to{transform:rotate(-360deg);}}
.ml-info-col{flex:1;min-width:0;}
.ml-info-title{font-size:22px;font-weight:700;color:var(--primary-ink);margin-bottom:14px;display:flex;align-items:center;gap:8px;}
.ml-info-title .ml-spin-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--primary);animation:mlPulse 1s ease-in-out infinite;}
@keyframes mlPulse{0%,100%{opacity:.4;transform:scale(.8);}50%{opacity:1;transform:scale(1.2);}}
.ml-info-row{font-size:14px;color:#555;margin:6px 0;line-height:1.7;}
.ml-info-row b{color:var(--primary-ink);font-weight:600;}
.ml-info-row .ml-sx{color:#C62828;font-weight:700;}
.ml-step-text{margin-top:12px;font-size:13px;color:var(--primary);font-style:italic;}
.ml-progress{height:4px;background:var(--primary-200);border-radius:2px;margin-top:10px;overflow:hidden;}
.ml-progress-bar{height:100%;width:0%;background:linear-gradient(90deg,var(--primary),var(--primary-light),var(--primary));background-size:200% 100%;animation:mlProgressBar 1.6s ease-out forwards, mlShimmer 1s linear infinite;}
@keyframes mlProgressBar{to{width:100%;}}
@keyframes mlShimmer{0%{background-position:200% 0;}100%{background-position:-200% 0;}}

/* 阶段2：扩大为全屏内容层 */
.ml-box-phase2{position:relative;z-index:2;width:92vw;max-width:1200px;max-height:92vh;margin:auto;background:#fff;border-radius:18px;box-shadow:0 20px 60px rgba(0,0,0,.3);display:none;flex-direction:column;overflow:hidden;animation:mlExpand .55s cubic-bezier(.2,.8,.2,1);}
@keyframes mlExpand{from{opacity:0;transform:scale(.3);border-radius:80px;}to{opacity:1;transform:scale(1);border-radius:18px;}}
.ml-box-phase2.active{display:flex;}
.ml-box-phase1.hide{display:none;}
.ml-phase2-header{display:flex;align-items:center;justify-content:space-between;padding:14px 22px;border-bottom:1px solid var(--primary-200);background:linear-gradient(135deg,var(--primary-bg),var(--primary-200));flex-shrink:0;}
.ml-phase2-title{font-size:17px;font-weight:700;color:var(--primary-ink);display:flex;align-items:center;gap:8px;}
.ml-phase2-close{width:34px;height:34px;border-radius:50%;border:none;background:#fff;color:#666;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.1);transition:all .2s;}
.ml-phase2-close:hover{background:var(--primary);color:#fff;transform:rotate(90deg);}
.ml-phase2-body{flex:1;overflow-y:auto;padding:24px;overscroll-behavior:contain;}
.ml-phase2-body .card{margin-bottom:20px;box-shadow:none;border:1px solid var(--primary-200);}
.ml-phase2-body .card:first-child{margin-top:0;}
.ml-phase2-body .bazi-top-bar{display:block!important;}
/* 字库查字弹层：紧凑尺寸，全端自适应，不再撑满宽屏 */
.ml-loading.cz-compact .ml-box-phase2{max-width:520px;width:92vw;}
.ml-loading.cz-compact .char-grid{grid-template-columns:repeat(auto-fill,minmax(62px,1fr));gap:8px;}
/* 查字结果详情卡片：左侧大字，右侧拼音/部首/笔画/五行/字义，填充留白 */
.cz-result-list{display:flex;flex-direction:column;gap:12px;}
.cz-result-card{display:flex;gap:14px;align-items:flex-start;background:var(--primary-bg);border:1px solid var(--primary-200);border-radius:14px;padding:14px 16px;text-decoration:none;color:inherit;}
.cz-result-card:hover{border-color:var(--primary);}
.cz-rc-zi{font-size:30px;font-weight:700;color:var(--primary-ink);line-height:1.2;min-width:44px;text-align:center;}
.cz-rc-info{flex:1;min-width:0;}
.cz-rc-meta{font-size:13px;color:#555;display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
.cz-rc-meta em{font-style:normal;}
.cz-rc-meaning{font-size:13px;color:#666;margin-top:6px;line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.cz-rc-link{display:inline-block;margin-top:8px;font-size:13px;color:var(--primary);}
.cz-rc-dot{color:#bbb;}
@media (max-width:640px){
    .ml-loading.cz-compact .ml-box-phase2{width:94vw;max-height:90vh;}
    .ml-box-phase1{flex-direction:column;gap:20px;padding:24px 22px;max-width:92vw;}
    .ml-disk-wrap{width:120px;height:120px;}
    .ml-info-title{font-size:18px;}
    .ml-box-phase2{width:96vw;max-height:94vh;}
    .ml-phase2-body{padding:16px;}
}

/* 出生基本信息表格移动端横向滚动 */
.nd-bz-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overflow-y:hidden;border-radius:8px;}
.nd-bz-grid{min-width:480px;}
.bz-th-label{white-space:nowrap;}
@media (max-width:640px){
    .nd-bz-grid{font-size:13px !important;}
    .nd-bz-grid .bz-cell{padding:8px 4px !important;font-size:13px;}
    .logo-main{font-size:17px;}
    .logo-img{width:36px;height:36px;}
    .logo-sub{font-size:10px;}
}

/* ==============================================================
   提交加载遮罩层 + 结果展开弹层
   ============================================================== */
.ml-loading {
    position: fixed; inset: 0; z-index: 999999;
    display: none; align-items: center; justify-content: center;
}
.ml-loading.show { display: flex; }
.ml-mask {
    position: absolute; inset: 0;
    background: rgba(25, 55, 40, 0.55);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ml-panel {
    position: relative;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,.28), 0 0 60px rgba(var(--brand-rgb),.25);
    width: 420px; max-width: 92vw;
    padding: 38px 32px 32px;
    display: flex; flex-direction: column; align-items: center;
    transition: all .5s cubic-bezier(.2,.8,.2,1);
    overflow: hidden;
}
.ml-loading.expanded .ml-panel {
    width: min(1180px, 96vw);
    max-height: 92vh;
    padding: 28px 28px 24px;
    align-items: stretch;
}
.ml-close {
    position: absolute; top: 14px; right: 14px;
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: rgba(0,0,0,.05);
    color: #666; font-size: 18px; cursor: pointer;
    display: none;
    transition: all .2s;
}
.ml-close:hover { background: rgba(0,0,0,.1); color: #333; transform: rotate(90deg); }
.ml-loading.expanded .ml-close { display: block; }

/* 太极旋转区 */
.ml-spin-stage {
    position: relative; width: 140px; height: 140px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 22px;
    transition: all .5s ease;
}
.ml-loading.expanded .ml-spin-stage {
    width: 70px; height: 70px; margin-bottom: 14px;
}
.ml-taiji-halo {
    position: absolute; inset: -14px; border-radius: 50%;
    border: 2px dashed var(--primary); opacity: .5;
    animation: mlHaloSpin 8s linear infinite;
}
.ml-taiji-halo::before {
    content:''; position:absolute; inset:-8px; border-radius:50%;
    border:1px solid rgba(var(--brand-rgb),.25);
}
.ml-taiji {
    width: 100%; height: 100%; object-fit: contain;
    border-radius: 50%;
    animation: mlTaijiSpin 4s linear infinite;
    box-shadow: 0 0 30px rgba(var(--brand-rgb),.35);
}
@keyframes mlHaloSpin { to { transform: rotate(360deg); } }
@keyframes mlTaijiSpin { to { transform: rotate(-360deg); } }

/* 信息区 */
.ml-info {
    width: 100%; text-align: center;
    transition: all .5s ease;
}
.ml-loading.expanded .ml-info {
    text-align: left; display: flex; align-items: center;
    gap: 18px; padding: 6px 0 14px;
    border-bottom: 1px solid var(--primary-200); margin-bottom: 14px;
}
.ml-loading.expanded .ml-spin-stage { margin:0; flex-shrink:0; }
.ml-title {
    font-size: 20px; font-weight: 700; color: var(--primary-ink);
    margin-bottom: 12px; letter-spacing: 2px;
}
.ml-loading.expanded .ml-title { font-size: 18px; margin-bottom:0; }
.ml-steps {
    display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
    font-size: 12px; color: #999; margin-bottom: 14px;
}
.ml-loading.expanded .ml-steps { display: none; }
.ml-step { padding: 3px 8px; border-radius: 10px; background: #f5f5f5; transition: all .3s; }
.ml-step.active { background: var(--primary-200); color: var(--primary-ink); }
.ml-lines { font-size: 14px; color: #555; margin-bottom: 14px; }
.ml-loading.expanded .ml-lines { display:none; }
.ml-line { display: flex; justify-content: center; gap: 8px; padding: 4px 0; }
.ml-label { color: #888; }
.ml-val { color: #333; font-weight: 500; }
.ml-val.ml-red { color: #C62828; font-weight: 700; }
.ml-progress {
    width: 100%; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden;
}
.ml-loading.expanded .ml-progress { display:none; }
.ml-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--primary-light), var(--primary), var(--primary-dark));
    border-radius: 3px;
    transition: width .4s ease;
}

/* 结果区包裹（占满剩余空间） */
.ml-result-wrap {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.ml-result {
    display: none;
    width: 100%;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    min-height: 0;
}
.ml-loading.expanded .ml-result { display: block; }
.ml-result::-webkit-scrollbar { width: 6px; }
.ml-result::-webkit-scrollbar-thumb { background: var(--primary-300); border-radius: 3px; }

@media (max-width: 640px) {
    .ml-panel { padding: 30px 20px 24px; border-radius: 18px; }
    .ml-spin-stage { width: 110px; height: 110px; margin-bottom: 16px; }
    .ml-loading.expanded .ml-spin-stage { width: 56px; height: 56px; }
    .ml-title { font-size: 18px; }
    .ml-line { font-size: 13px; }
}

/* ========== 弹层结果展开：完全隐藏命盘和推演信息，只留结果 ========== */
.ml-loading.expanded .ml-spin-stage,
.ml-loading.expanded .ml-info { display:none !important; }
.ml-loading.expanded .ml-panel {
    width:94vw; max-width:1400px;
    /* 自适应内容高度，但不超过 92vh：内容少时紧贴内容不留下方空白，内容多时内部滚动 */
    height:auto; max-height:92vh; min-height:240px;
    border-radius:14px; padding:24px 22px 18px;
    display:flex; flex-direction:column; overflow:hidden;
    animation:mlExpand .45s cubic-bezier(.2,.8,.3,1) forwards;
    align-items:stretch;
}
.ml-loading.expanded .ml-result-wrap {
    flex:1 1 auto; min-height:0; display:flex; flex-direction:column;
}
.ml-loading.expanded .ml-result {
    display:block !important; flex:1 1 auto; overflow-y:auto; overflow-x:hidden;
    padding:8px 4px 4px; min-height:0;
}
.ml-loading.expanded .ml-result > *:last-child { margin-bottom:0 !important; padding-bottom:0 !important; }
/* 去掉卡片默认 margin-bottom 造成的多余底部留白 */
.ml-loading.expanded .ml-result .card:last-child { margin-bottom:0; }
.ml-loading.expanded .ml-close { display:flex !important; align-items:center; justify-content:center; top:10px; right:14px; }
@keyframes mlExpand {
    0%{transform:scale(.7);opacity:.3;}
    100%{transform:scale(1);opacity:1;}
}
.ml-mask { background:rgba(20,45,35,.6); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }

/* 结果区内部恢复正常布局（避免被flex干扰） */
.ml-result .bazi-top-bar,
.ml-result .name-result-title,
.ml-result .names-grid,
.ml-result .section-title,
.ml-result .wuge-grid-card,
.ml-result .wuge-desc,
.ml-result .sancai-card,
.ml-result .advice-box,
.ml-result .result-actions { width:100%; box-sizing:border-box; }
.ml-result .names-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:18px; }
@media(max-width:768px){
    .ml-loading.expanded .ml-panel{width:96vw;height:94vh;padding:10px 12px 14px;border-radius:10px;}
    .ml-result .names-grid{grid-template-columns:repeat(2,1fr);gap:10px;}
}

/* ========== 友情链接模块 ========== */
/* 友情链接卡片：整块高度收紧，与上方"起名知识/起名技巧"和下方页脚间距协调 */
.friend-links-card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 14px 20px 12px !important;
}
.friend-links-card .card-header {
    margin-bottom: 6px !important;
    padding-bottom: 8px !important;
}
/* 首页"起名知识/起名技巧"两栏卡片与友情链接之间的间距收紧（原 32px 过大） */
.grid-2[style*="margin-bottom:32px"] {
    margin-bottom: 16px !important;
}
.grid-2[style*="margin-bottom:32px"][style*="gap:24px"] {
    margin-bottom: 16px !important;
}
/* 文章模块底部收紧间距 */
.articles-grid {
    margin-bottom: 0 !important;
}
/* 页脚顶部间距收紧（友情链接卡片之下不再留大片空白） */
.site-footer {
    margin-top: 14px !important;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
}
.friend-links-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    align-items: center;
    padding: 0;
}
.friend-link-item {
    color: #C3D1CB; /* 接近背景、仅略深的浅灰绿，若隐若现 */
    text-decoration: none;
    font-size: 14px;
    padding: 2px 2px;
    transition: all .2s;
    line-height: 1.8;
}
.friend-link-item:hover {
    color: #7FA893;
    text-decoration: underline;
}

/* ========== 移动端加强适配 ========== */
/* 针对手机端（≤768px）全面优化 */
@media (max-width: 768px) {
    body { padding-top: 60px; }
    .mobile-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        z-index: 999;
        box-shadow: var(--shadow);
    }
    /* ===== 全局容器 ===== */
    .container {
        padding: 0 12px;
    }
    .site-main {
        padding: 16px 10px;
    }

    /* ===== 头部导航 ===== */
    .header-inner {
        height: 60px;
    }
    .logo a, .logo-link {
        gap: 8px;
    }
    .logo-img {
        width: 36px;
        height: 36px;
        box-shadow: 0 0 8px rgba(var(--brand-rgb),.35);
    }
    .logo-main {
        font-size: 20px;
        letter-spacing: 0;
    }
    .logo-sub {
        font-size: 11px;
        margin-top: 2px;
        letter-spacing: 0;
    }
    .mobile-menu-btn {
        font-size: 26px;
        padding: 6px 10px;
        margin-right: -4px;
    }
    .mobile-menu li a {
        padding: 11px 4px;
        font-size: 14px;
    }

    /* ===== Hero区域 ===== */
    .hero {
        padding: 24px 16px;
        margin-bottom: 16px;
        border-radius: 10px;
    }
    .hero h1 {
        font-size: 22px;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    .hero p {
        font-size: 14px;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    .hero-actions {
        gap: 10px;
    }

    /* ===== 按钮 ===== */
    .btn {
        padding: 10px 20px;
        font-size: 15px;
    }
    .btn-lg {
        padding: 12px 28px;
        font-size: 16px;
    }
    /* 增大移动端最小点击区域 */
    .btn, .feature-card span.btn, .hot-names-refresh, .mobile-menu-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* ===== 功能卡片网格 ===== */
    .feature-grid {
        gap: 12px;
        margin-bottom: 16px;
        grid-template-columns: 1fr;
    }
    .feature-card {
        padding: 20px 16px;
        border-radius: 10px;
    }
    .feature-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }
    .feature-card h3 {
        font-size: 18px;
        margin-bottom: 6px;
    }
    .feature-card p {
        font-size: 13px;
        margin-bottom: 14px;
    }

    /* ===== 通用卡片 ===== */
    .card {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 10px;
    }
    .card-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    .card-title {
        font-size: 16px;
        gap: 6px;
    }
    .card-title::before {
        height: 16px;
        width: 3px;
    }

    /* ===== 三列布局：移动端单列 ===== */
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

    /* ===== 文章列表：标题与日期换行避免挤压 ===== */
    .grid-3 .article-list .article-item {
        padding: 10px 8px;
        flex-wrap: wrap;
        row-gap: 2px;
    }
    .grid-3 .article-list .article-item:hover {
        padding-left: 12px;
        padding-right: 12px;
    }
    .grid-3 .article-list .article-item a {
        font-size: 14px;
        margin-right: 8px;
        line-height: 1.4;
    }
    .grid-3 .article-list .article-date {
        font-size: 11px;
    }
    .article-item {
        padding: 12px 8px;
    }
    .article-item a {
        font-size: 14px;
    }

    /* ===== 热门名字标签云 ===== */
    .hot-names-wrap {
        gap: 8px;
        padding: 2px 2px 10px 2px;
    }
    .hot-names-refresh {
        padding: 5px 12px;
        font-size: 13px;
        border-radius: 18px;
        min-height: 36px;
    }
    .hot-name-tag {
        padding: 7px 13px !important;
    }
    .hot-name-tag.size-l { font-size: 16px !important; padding: 9px 16px !important; border-radius: 22px !important; }
    .hot-name-tag.size-m { font-size: 14px !important; padding: 7px 13px !important; border-radius: 20px !important; }
    .hot-name-tag.size-s { font-size: 13px !important; padding: 6px 11px !important; border-radius: 18px !important; }
    .hot-name-tag .score-badge {
        min-width: 24px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        font-size: 10px;
        top: -5px;
        right: -5px;
    }
    /* 移动端关闭浮动动画，提升性能并减少抖动 */
    .hot-name-tag:nth-child(3n+1),
    .hot-name-tag:nth-child(3n+2),
    .hot-name-tag:nth-child(3n) {
        animation: hot-fade-in 0.4s ease forwards !important;
    }
    .hot-name-tag:hover {
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    }

    /* ===== 友情链接 ===== */
    .friend-links-card {
        padding: 12px 14px 10px !important;
        border-radius: 10px;
    }
    .friend-links-card .card-header {
        margin-bottom: 6px !important;
        padding-bottom: 6px !important;
    }
    .friend-links-wrap {
        gap: 2px 12px;
    }
    .friend-link-item {
        font-size: 13px;
        line-height: 1.7;
    }

    /* ===== 页脚 ===== */
    .site-footer {
        margin-top: 12px !important;
        padding: 24px 0 16px !important;
    }
    .footer-grid {
        gap: 18px;
        margin-bottom: 18px;
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-col h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    .footer-col ul li {
        margin-bottom: 6px;
    }
    .footer-col ul li a {
        font-size: 13px;
    }
    .footer-bottom {
        font-size: 12px;
        padding-top: 14px;
    }

    /* ===== 表单适配 ===== */
    .form-group {
        margin-bottom: 14px;
    }
    .form-control, .form-select {
        padding: 10px 12px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    .form-row {
        gap: 10px;
    }
}

/* 超小屏手机（≤380px）进一步收紧 */
@media (max-width: 380px) {
    .mobile-menu ul { grid-template-columns: repeat(3, 1fr); }
    .hero h1 { font-size: 20px; }
    .hero p { font-size: 13px; }
    .btn-lg { padding: 11px 20px; font-size: 15px; }
    .feature-card { padding: 16px 12px; }
    .card { padding: 14px 12px; }
    .logo-main { font-size: 18px; }
    .logo-sub { display: none; }
    .hot-name-tag.size-l { font-size: 15px !important; padding: 8px 14px !important; }
}

/* 横屏手机适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .header-inner { height: 50px; }
    .hero { padding: 16px 20px; margin-bottom: 12px; }
    .hero h1 { font-size: 20px; margin-bottom: 6px; }
    .hero p { margin-bottom: 12px; }
    .site-main { padding: 10px; }
}

/* 触摸设备优化：移除hover上浮，避免点击后粘滞 */
@media (hover: none) and (pointer: coarse) {
    .feature-card:hover {
        transform: none;
        box-shadow: var(--shadow);
        border-color: transparent;
    }
    .hot-name-tag:hover {
        transform: none;
        box-shadow: none;
        z-index: auto;
    }
    .hot-name-tag .score-badge {
        opacity: 1;
        transform: scale(1);
    }
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    .article-item:hover,
    .grid-3 .article-list .article-item:hover {
        background: transparent;
        padding-left: 8px;
        padding-right: 8px;
    }
    .card:hover {
        box-shadow: var(--shadow);
    }
    .name-item:hover {
        transform: none;
    }
}

/* ===== 全站移动端兜底适配 ===== */
@media (max-width: 992px) {
    /* 首页横幅在平板/手机上收为单列 */
    .hero-split { grid-template-columns: 1fr !important; }
}
@media (max-width: 768px) {
    /* 内联多栏表单行在手机上堆叠为单列 */
    .form-row[style] { grid-template-columns: 1fr !important; gap: 12px; }
    /* 表单控件与按钮不超出屏幕 */
    input, select, textarea, .form-control, .form-select, .btn { max-width: 100%; }
    /* 长标题 / 长文本自动换行，避免撑破容器 */
    .card-title, .article-item a, .nd-name, h1, h2, h3, p, li {
        overflow-wrap: break-word;
        word-break: break-word;
    }
    /* 单字详情文字块取消最小宽度，小屏不横向溢出 */
    .char-detail-info { min-width: 0 !important; }

    /* 首页横幅：子项允许收缩，标签云与标题不被右侧裁切 */
    .hero-copy, .hero-hot { min-width: 0; width: 100%; }
    .hero-hot { flex-direction: column; align-items: center; }
    .hero-split h1 { white-space: normal !important; }
    .hero-split p { white-space: normal !important; }
    .hero-hot .hot-names-wrap { padding-right: 0 !important; flex-wrap: wrap; }
}
html, body { overflow-x: hidden; max-width: 100%; }

/* ===== 百家姓 / 字库 共享卡片网格 ===== */
.ziku-wx-tabs .ziku-tab,
.ziku-tab {
    padding: 6px 16px; border: 1px solid #E0E0E0; border-radius: 999px;
    font-size: 14px; color: var(--text-light); text-decoration: none; background: #fff; transition: all .2s ease;
    display: inline-flex; align-items: center;
}
.ziku-wx-tabs .ziku-tab:hover,
.ziku-tab:hover { border-color: var(--primary); color: var(--primary-dark); }
.ziku-wx-tabs .ziku-tab.active,
.ziku-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ziku-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.ziku-card {
    display: block; padding: 14px 12px; background: var(--primary-bg); border-radius: 14px;
    text-decoration: none; color: inherit; transition: all .22s ease; border: 1px solid transparent;
}
.ziku-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(var(--brand-rgb),.14); }
.zk-zi { font-size: 28px; line-height: 1.2; color: var(--primary-ink); font-family: 'STKaiti','KaiTi','Kaiti SC',serif; text-align: center; }
.zk-py { text-align: center; font-size: 13px; color: var(--text-lighter); margin: 4px 0 8px; }
.zk-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.zk-mean { font-size: 12.5px; color: var(--text-light); line-height: 1.6; text-align: center; }
@media (max-width: 640px) {
    .ziku-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
}

/* ===== 回到顶部按钮：滚动超过一屏后渐变出现，固定右下角 ===== */
.back-top {
    position: fixed;
    right: 20px;
    bottom: 30px;
    z-index: 1200;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(var(--brand-rgb), 0.35);
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease, background .3s ease;
}
.back-top.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}
.back-top:hover { background: var(--primary-dark); }
.back-top svg { width: 18px; height: 18px; }
@media (max-width: 768px) {
    .back-top { right: 14px; bottom: 20px; width: 38px; height: 38px; }
    .back-top svg { width: 16px; height: 16px; }
}

/* ============================================================
   配色主题皮肤
   后台「网站设置」选择，<html data-theme="..."> 作用于整站。
   green=清新浅绿(默认，沿用上方 :root)；gu=古色古香；gua=易卦玄青。
   注意：吉凶红绿、状态提示、五行木色、后台工具样式不随主题变化。
   ============================================================ */

/* ---- 古色古香：宣纸米黄 + 赭石棕 + 墨褐 + 描金 ---- */
html[data-theme="gu"] {
    --primary: #8C6A43;
    --primary-light: #BC9B78;
    --primary-dark: #5D4037;
    --primary-bg: #F3EBDD;
    --surname-bg: #EFE6D2;
    --surname-border: #E0D0B2;
    --accent: #A67C2E;
    --text: #3B2E24;
    --text-light: #6B584A;
    --text-lighter: #9A8676;
    --border: #D8C7A8;
    --bg: #FAF5EC;
    --shadow: 0 2px 12px rgba(93, 64, 55, 0.10);
    --shadow-hover: 0 4px 20px rgba(93, 64, 55, 0.16);
    --primary-ink: #5D4037;
    --primary-200: #F3EBDD;
    --primary-300: #E0D0B2;
    --brand-rgb: 140, 106, 67;
}
/* 古主题正文沿用默认无衬线字体，与绿/青两套一致，不再使用宋体 */
html[data-theme="gu"] .hero::before { background: radial-gradient(circle, rgba(140, 106, 67, 0.18) 0%, transparent 70%); }
html[data-theme="gu"] .hero::after  { background: radial-gradient(circle, rgba(140, 106, 67, 0.14) 0%, transparent 70%); }

/* ---- 易卦玄青：靛蓝青 + 描金 ---- */
html[data-theme="gua"] {
    --primary: #2F5D7C;
    --primary-light: #608DAB;
    --primary-dark: #1E4258;
    --primary-bg: #E9F1F5;
    --surname-bg: #DCE9F0;
    --surname-border: #C4D7E0;
    --accent: #C9A227;
    --text: #24323A;
    --text-light: #536A73;
    --text-lighter: #8CA3AB;
    --border: #CBD7DC;
    --bg: #F6FAFB;
    --shadow: 0 2px 12px rgba(30, 66, 88, 0.10);
    --shadow-hover: 0 4px 20px rgba(30, 66, 88, 0.16);
    --primary-ink: #1E4258;
    --primary-200: #E9F1F5;
    --primary-300: #CBD7DC;
    --brand-rgb: 47, 93, 124;
}
html[data-theme="gua"] .hero::before { background: radial-gradient(circle, rgba(47, 93, 124, 0.18) 0%, transparent 70%); }
html[data-theme="gua"] .hero::after  { background: radial-gradient(circle, rgba(47, 93, 124, 0.14) 0%, transparent 70%); }

/* ---- 两主题共用：品牌主视觉覆盖 ---- */
html[data-theme="gu"] .logo-main,
html[data-theme="gua"] .logo-main {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 52%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary-dark);
}
html[data-theme="gu"] .hero,
html[data-theme="gua"] .hero {
    background: linear-gradient(135deg, var(--primary-200) 0%, var(--primary-bg) 50%, var(--primary-300) 100%);
}
html[data-theme="gu"] .detail-hero,
html[data-theme="gua"] .detail-hero,
html[data-theme="gu"] .nd-hero,
html[data-theme="gua"] .nd-hero {
    background: linear-gradient(135deg, var(--primary-200) 0%, var(--primary-300) 100%);
}
html[data-theme="gu"] .nd-score-row .fl,
html[data-theme="gua"] .nd-score-row .fl,
html[data-theme="gu"] .nd-sur-badge,
html[data-theme="gua"] .nd-sur-badge,
html[data-theme="gu"] .nd-char-zi,
html[data-theme="gua"] .nd-char-zi {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}
html[data-theme="gu"] .btn-primary,
html[data-theme="gua"] .btn-primary { box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.28); }
html[data-theme="gu"] .btn-primary:hover,
html[data-theme="gua"] .btn-primary:hover { box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.36); }

/* ---- 两主题共用：测算/查字浮层品牌色 ---- */
html[data-theme="gu"] .ml-loading-title,
html[data-theme="gua"] .ml-loading-title {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
html[data-theme="gu"] .ml-loading-row b,
html[data-theme="gua"] .ml-loading-row b,
html[data-theme="gu"] .ml-info-title,
html[data-theme="gua"] .ml-info-title,
html[data-theme="gu"] .ml-info-row b,
html[data-theme="gua"] .ml-info-row b,
html[data-theme="gu"] .ml-phase2-title,
html[data-theme="gua"] .ml-phase2-title,
html[data-theme="gu"] .cz-rc-zi,
html[data-theme="gua"] .cz-rc-zi { color: var(--primary-ink); }
html[data-theme="gu"] .ml-loading-steps,
html[data-theme="gua"] .ml-loading-steps {
    background: linear-gradient(90deg, var(--primary-bg), var(--primary-200));
    border-left-color: var(--primary);
    color: var(--primary-dark);
}
html[data-theme="gu"] .ml-spin-dot,
html[data-theme="gua"] .ml-spin-dot,
html[data-theme="gu"] .ml-step-text,
html[data-theme="gua"] .ml-step-text,
html[data-theme="gu"] .cz-rc-link,
html[data-theme="gua"] .cz-rc-link { color: var(--primary); }
html[data-theme="gu"] .ml-progress-bar,
html[data-theme="gua"] .ml-progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
}
html[data-theme="gu"] .ml-phase2-close:hover,
html[data-theme="gua"] .ml-phase2-close:hover { background: var(--primary); color: #fff; }
html[data-theme="gu"] .cz-result-card:hover,
html[data-theme="gua"] .cz-result-card:hover { border-color: var(--primary); }
html[data-theme="gu"] .ml-disk-ring,
html[data-theme="gua"] .ml-disk-ring { border-color: rgba(var(--brand-rgb), 0.55); }
