/* ==========================================================================
   基础样式（结构与布局）—— 移动优先
   --------------------------------------------------------------------------
   设计基准：390 x 844（6.1 英寸手机）；最小适配 360px。
   与风格无关：颜色、字体全部走 CSS 变量，由 /themes/<风格>/style.css 提供。
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

h1, h2, h3, h4, p {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ==========================================================================
   应用骨架
   ========================================================================== */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 520px;
    margin: 0 auto;
    position: relative;
}

/* ==========================================================================
   顶栏：品牌 + 操作 / 信息条
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: calc(10px + env(safe-area-inset-top)) 12px 4px;
}

.topbar-row {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: none;
}

.brand-seal {
    /* 罗盘标志：圆形，尺寸略放大以看清地支 */
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    object-fit: contain;
    /* 深色底上给一点暖光晕，避免边缘发灰 */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.brand-name {
    font-size: 15px;
    white-space: nowrap;
    letter-spacing: 0.12em;
}

.topbar-spacer {
    flex: 1;
    min-width: 4px;
}

/* =============================================================================
 * 顶栏按钮（文字版）
 *   .tb-btn   管理员 / 风格
 *   .tb-user  当前用户道号（带朱色边，点击弹菜单）
 * ============================================================================= */
.tb-btn,
.tb-user {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1;
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* --- 管理员 / 风格：无框，纯文字 --- */
.tb-btn {
    padding: 5px 4px;
    border: 0;
    background: transparent;
    color: inherit;
}

.tb-btn:active {
    opacity: 0.55;
}

/* --- 当前用户：带边框的小牌，显示完整道号 --- */
.tb-user {
    max-width: 30vw;
    padding: 4px 9px;
    border: 1px solid currentColor;
    border-radius: 2px;
    background: transparent;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.14s ease, opacity 0.14s ease;
}

.tb-user:active {
    opacity: 0.6;
}

/* --- 退出：朱红小印章 --- */
.tb-logout {
    flex: none;
    display: grid;
    place-items: center;
    padding: 0 7px;
    height: 24px;
    border: 0;
    cursor: pointer;
    border-radius: 2px;
    background: linear-gradient(178deg, var(--red-strong), var(--red-darker));
    color: var(--paper-warm);
    font-family: var(--font-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(107, 26, 24, 0.3);
    -webkit-tap-highlight-color: transparent;
}

.tb-logout:active {
    opacity: 0.8;
}

/* 旧类名保留（其它模块可能仍在使用） */
.icon-btn {
    width: 28px;
    height: 28px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    letter-spacing: 0;
    -webkit-tap-highlight-color: transparent;
}

.mini-user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: none;
    max-width: 40vw;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font: inherit;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.mini-seal {
    width: auto;
    height: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    font-size: 13px;
    line-height: 1;
}

.mini-name {
    font-size: 12.5px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* 顶栏信息条 */
.topbar-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}

.meta-item {
    flex: none;
    opacity: 0.85;
}

.meta-label {
    opacity: 0.55;
    margin-right: 2px;
}

.meta-dot {
    flex: none;
    opacity: 0.35;
}

.progress-track {
    flex: 1;
    height: 3px;
    min-width: 20px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.progress-value {
    flex: none;
    font-variant-numeric: tabular-nums;
}

.ganzhi-mini {
    flex: none;
}

/* ==========================================================================
   内容区
   ========================================================================== */
.main {
    flex: 1;
    padding: 0 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================================================
   今日黄历大栏
   ========================================================================== */
.almanac {
    position: relative;
    padding: 12px 13px 11px;
    border-radius: var(--radius);
    overflow: hidden;
}

.almanac-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: -4px;
}

.eve-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    flex: none;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: var(--radius);
    line-height: 1.1;
}

.eve-count__label {
    font-size: 14px;
    letter-spacing: 0.08em;
    opacity: 0.9;
    color: var(--text-brown);
}

.eve-count__days {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--red);
}

.eve-count__days small {
    font-size: 14px;
    font-weight: 400;
    margin-left: 1px;
    opacity: 0.85;
}

.eve-count__date {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
    color: var(--text-brown);
}

.lunar-size {
    font-size: 10px;
    opacity: 0.6;
    margin: 0 1px;
}

.jieqi-row {
    display: flex;
    gap: 0;
    margin-top: 10px;
    border: 1px solid rgba(140, 35, 33, .3);
    border-radius: 3px;
    overflow: hidden;
}

.jieqi-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    min-width: 0;
    text-align: center;
}

.jieqi-tag {
    font-size: 13px;
    opacity: 0.5;
}

.jieqi-name {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-deep);
}

.jieqi-time {
    font-size: 15px;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

.jieqi-days {
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
}

.jieqi-col.is-now .jieqi-name {
    color: var(--red);
}

.changelog {
    margin-top: 12px;
    padding: 10px 12px 11px;
    border-radius: 3px;
    border: 1px solid rgba(176, 141, 79, .3);
    border-left: 3px solid var(--gold);
    background: rgba(235, 227, 210, .5);
}

.cl-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
    padding-bottom: 7px;
    border-bottom: 1px dashed rgba(176, 141, 79, .32);
}

.cl-badge {
    flex: none;
    padding: 1px 7px;
    border-radius: 2px;
    background: var(--red);
    color: var(--gold-soft);
    font-family: var(--font-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1.65;
}

.cl-title {
    flex: 1 1 auto;
    font-family: var(--font-serif);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-3);
}

.cl-date {
    font-size: 11px;
    color: var(--text-warm-2);
}

.cl-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-warm);
}

.almanac-date {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.al-day {
    font-size: 34px;
    line-height: 1;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--red);
}

.al-date {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    line-height: 1.3;
}

.al-day-num {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--red);
}

.al-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 2px;
    background: var(--red);
    color: var(--gold-soft);
    font-family: var(--font-serif);
    font-weight: 700;
    letter-spacing: .05em;
}

.al-badge--sm {
    font-size: 12px;
    padding: 1px 6px;
}

.al-badge--lg {
    font-size: 28px;
    padding: 4px 16px;
}

.al-lunar-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.al-lunar-month {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-deep);
}

.al-lunar-day {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-deep);
}

.al-weekday {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-deep);
}

.al-lunar-month .lunar-size {
    font-size: 11px;
    opacity: 0.7;
    margin: 0 2px;
}

.demo-tag {
    flex: none;
    font-size: 9px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 2px;
    letter-spacing: 0.1em;
}

/* 干支 */
.ganzhi-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.gz-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12.5px;
    letter-spacing: 0.1em;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 2px;
}

.gz-label {
    font-size: 9px;
    opacity: 0.6;
    letter-spacing: 0;
}

.gz-zodiac {
    font-size: 10px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 2px;
    opacity: 0.85;
}

/* 宜忌 */
.yj-block {
    display: grid;
    gap: 6px;
    margin-top: 11px;
}

.yj-row {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    font-size: 11.5px;
    line-height: 1.5;
}

.yj-mark {
    flex: none;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    border-radius: 2px;
}

.yj-text {
    flex: 1;
    min-width: 0;
}

/* 黄历信息表：固定三列，15 项，单元格左对齐 */
.god-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 11px;
    border-radius: 2px;
    overflow: hidden;
}

.god-item {
    padding: 6px 7px;
    min-width: 0;
}

.god-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    line-height: 1.25;
    min-width: 0;
}

.god-name {
    flex: none;
    font-size: 10.5px;
}

.god-val {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* 罗盘指针：外圈定盘 + 内针指方位 */
.compass {
    position: relative;
    flex: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0.9;
}

.needle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    margin: -5px 0 0 -2.5px;
    border-left: 2.5px solid transparent;
    border-right: 2.5px solid transparent;
    border-bottom: 5px solid currentColor;
    transform-origin: 50% 100%;
}

/* 针尖方向 */
.dir-N  .needle { transform: rotate(0deg); }
.dir-NE .needle { transform: rotate(45deg); }
.dir-E  .needle { transform: rotate(90deg); }
.dir-SE .needle { transform: rotate(135deg); }
.dir-S  .needle { transform: rotate(180deg); }
.dir-SW .needle { transform: rotate(225deg); }
.dir-W  .needle { transform: rotate(270deg); }
.dir-NW .needle { transform: rotate(315deg); }

/* ==========================================================================
   区块标题
   ========================================================================== */
.block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.block-title {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.16em;
}

.block-sub {
    font-size: 10.5px;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   功能模块：固定三列 + 浅色术语衬底
   ========================================================================== */
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.module-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 5px 8px;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-card:active {
    transform: scale(0.958);
}

.module-icon {
    width: 32px;
    height: 32px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    border-radius: 50%;
}

.module-name {
    font-size: 13.5px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 浅色术语衬底：两行小字，底部渐隐 */
.module-terms {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 2px 5px;
    width: 100%;
    height: 2.4em;
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.2;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
    pointer-events: none;
}

.module-terms span {
    white-space: nowrap;
}

.module-card.is-off {
    opacity: 0.5;
}

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    white-space: nowrap;
    transition: transform 0.12s ease, opacity 0.2s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.module-card:focus-visible,
.sheet-close:focus-visible,
.style-option:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================================================
   底部抽屉
   ========================================================================== */
.sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--mask);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.sheet-mask.is-open {
    opacity: 1;
    visibility: visible;
}

.sheet {
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(100%);
    transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

.sheet-mask.is-open .sheet {
    transform: translateY(0);
}

.sheet-handle {
    width: 34px;
    height: 3px;
    border-radius: 2px;
    margin: 8px auto 2px;
    flex: none;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 16px 8px;
    flex: none;
}

.sheet-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.14em;
}

.sheet-close {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
    padding: 0;
    flex: none;
}

.sheet-body {
    padding: 4px 16px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sheet-footer {
    display: flex;
    gap: 9px;
    padding: 10px 16px 12px;
    flex: none;
}

.sheet-footer .btn {
    flex: 1;
    min-height: 40px;
}

/* ==========================================================================
   表单
   ========================================================================== */
.form-row {
    margin-bottom: 11px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.form-label .opt {
    font-size: 10px;
    opacity: 0.55;
    margin-left: 3px;
}

.form-control {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 16px;
    line-height: 1.4;
    border-radius: var(--radius);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-hint {
    margin-top: 3px;
    font-size: 10.5px;
    line-height: 1.45;
}

.form-error {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.4;
}

.form-control.is-invalid {
    border-color: var(--red-alert);
}

/* ==========================================================================
   风格选择
   ========================================================================== */
.style-list {
    display: grid;
    gap: 8px;
}

.style-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border-radius: var(--radius);
    text-align: left;
    width: 100%;
    border: 1px solid transparent;
    transition: border-color 0.18s ease;
}

.style-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.style-swatch {
    display: flex;
    gap: 2px;
    flex: none;
}

.style-swatch span {
    display: block;
    width: 10px;
    height: 22px;
    border-radius: 1px;
}

.style-info {
    flex: 1;
    min-width: 0;
}

.style-name {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}

.style-desc {
    display: block;
    font-size: 10.5px;
    line-height: 1.4;
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.style-status {
    font-size: 10.5px;
    flex: none;
}

/* ==========================================================================
   提示条
   ========================================================================== */
.toast-stack {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: min(88vw, 400px);
    pointer-events: none;
}

.toast {
    max-width: 100%;
    padding: 8px 14px;
    font-size: 12.5px;
    line-height: 1.5;
    border-radius: 999px;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer {
    padding: 8px 14px calc(10px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 10.5px;
    line-height: 1.6;
    letter-spacing: 0.08em;
}

.site-footer .footer-sep {
    margin: 0 5px;
    opacity: 0.5;
}

/* ==========================================================================
   极窄屏
   ========================================================================== */
@media (max-width: 360px) {
    .main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .module-grid {
        gap: 6px;
    }

    .module-card {
        padding: 10px 4px 7px;
    }

    .module-name {
        font-size: 12.5px;
    }

    .god-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ganzhi-mini {
        display: none;
    }
}

/* 桌面预览：保持手机尺度居中 */
@media (min-width: 560px) and (min-height: 560px) {
    .app {
        box-shadow: 0 0 0 1px var(--hairline), 0 20px 60px rgba(26, 25, 21, 0.10);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ==========================================================================
   黄历头部：时钟 + 状态
   ========================================================================== */
.almanac-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: none;
}

.almanac-clock__state {
    font-size: 9px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 2px;
    border: 1px solid currentColor;
    letter-spacing: 0.1em;
    color: var(--text-3);
    opacity: 0.8;
}

.almanac-clock__state.is-live {
    color: var(--green);
}

/* ==========================================================================
   节气：上节 / 本节 / 下节（一行三列）
   ========================================================================== */
.jieqi-row {
    display: flex;
    gap: 0;
    margin-top: 10px;
    border: 1px solid rgba(140, 35, 33, .3);
    border-radius: 3px;
    overflow: hidden;
}

.jieqi-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    min-width: 0;
    text-align: center;
}

.jieqi-col__tag {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 0.06em;
    margin-bottom: 1px;
}

.jieqi-col__name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.jieqi-col__time {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.82;
}

.jieqi-col__days {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0.6;
    white-space: nowrap;
}

/* ==========================================================================
   顶栏风格按钮：标签样式（与道号同款边框）
   ========================================================================== */
.tb-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 9px;
    border: 1px solid currentColor;
    border-radius: 2px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1;
    letter-spacing: 0.06em;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.tb-chip__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 11px;
    height: 11px;
    flex: none;
}

.tb-chip__ico svg {
    display: block;
    animation: chip-spin 24s linear infinite;
}

@keyframes chip-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .tb-chip__ico svg { animation: none; }
}

.tb-chip__txt {
    display: inline-block;
}

.tb-chip:active {
    opacity: 0.6;
}
/* ==========================================================================
   四柱干支：吊牌（纳音在左 · 干支居中 · 二十八宿在右）
   --------------------------------------------------------------------------
   每个吊牌：
     吊绳 → 列标（年/月/日/时）
          纳音（竖排小字，左）│ 干支（按五行着色，中）│ 二十八宿（右，占位）
   吊牌整体背景按「纳音五行」着色，由行内 --tag-bg 变量控制
   ========================================================================== */
.ganzhi-hang {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 7px;
    margin-top: 8px;
    padding-top: 12px;
}

.gz-tag {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 9px 5px 8px;
    border-radius: 2px;
    background: linear-gradient(160deg, var(--tag-bg, var(--paper-bright)), var(--tag-bg2, var(--paper-warm-2)));
    border: 1px solid var(--tag-line, rgba(34, 31, 25, 0.2));
    border-top: 2px solid var(--tag-line, rgba(34, 31, 25, 0.2));
}

/* 吊绳 */
.gz-tag::before {
    content: "";
    position: absolute;
    top: -11px;
    left: 50%;
    width: 1px;
    height: 11px;
    background: var(--tag-line, rgba(34, 31, 25, 0.3));
    opacity: 0.8;
}

/* 吊孔 */
.gz-tag::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 3px;
    height: 3px;
    margin-left: -1.5px;
    border-radius: 50%;
    background: var(--tag-line, rgba(34, 31, 25, 0.3));
    opacity: 0.6;
}

.gz-tag__pillarlb {
    font-size: 9.5px;
    line-height: 1;
    letter-spacing: 0.1em;
    opacity: 0.65;
}

/* 三栏：纳音 | 干支 | 二十八宿（类名与择日首页一致） */
.gz-tag__mid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-width: 0;
}

/* 左：纳音（竖排，按纳音五行着色） */
.gz-tag__nayin {
    flex: none;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 9px;
    line-height: 1.05;
    letter-spacing: 0.02em;
    opacity: 0.85;
    color: var(--ny-color, currentColor);
    max-height: 52px;
    overflow: hidden;
}

/* 中：干支（竖排，按五行着色） */
.gz-tag__chars {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.gz-tag__char {
    font-family: var(--font-serif);
    font-size: 23px;
    line-height: 1.06;
    font-weight: 700;
    letter-spacing: 0;
    /* 加重：细描边 + 微阴影，让单字更厚重、与底牌拉开层次 */
    -webkit-text-stroke: 0.4px currentColor;
    text-shadow:
        0 0.5px 0 rgba(255, 255, 255, 0.75),
        0 1px 1.5px rgba(26, 25, 21, 0.10);
}

/* 右：二十八宿（竖排，吉凶用颜色区分） */
.gz-tag__xiu {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 9.5px;
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--xiu-color, currentColor);
    max-height: 52px;
    overflow: hidden;
}

.gz-tag__xiu .xiu-ch {
    display: block;
}

.gz-tag__xiu.is-ji {
    opacity: 0.92;
}

.gz-tag__xiu.is-bad {
    opacity: 0.8;
}

/* 极窄屏 */
@media (max-width: 360px) {
    .ganzhi-hang {
        gap: 5px;
    }

    .gz-tag__char {
        font-size: 20px;
    }

    .gz-tag__nayin {
        font-size: 8px;
    }

    .gz-tag__xiu {
        font-size: 8.5px;
    }
}
/* ==========================================================================
   年度进度：农历年已过天数 / 立春 / 春节（一行三列）
   ========================================================================== */
.year-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 8px;
    border-radius: 2px;
    overflow: hidden;
}

.year-info__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 3px;
    min-width: 0;
    text-align: center;
}

.year-info__label {
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

.year-info__value {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.year-info__value small {
    font-size: 10px;
    font-weight: 400;
    margin-left: 1px;
    opacity: 0.7;
}

.year-info__sub {
    font-size: 9.5px;
    line-height: 1.2;
    opacity: 0.62;
    white-space: nowrap;
}

@media (max-width: 360px) {
    .year-info__value {
        font-size: 15px;
    }
}
/

/

/* ==========================================================================
   年度信息三格（右侧，横向排列，样式同节气三列）
   ========================================================================== */
.year-cells {
    display: flex;
    flex-direction: row;
    flex: none;
    gap: 0;
    margin-left: auto;
    border-radius: 2px;
    overflow: hidden;
}

.year-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 56px;
    padding: 4px 2px 5px;
    text-align: center;
    border-left: 1px solid rgba(140, 35, 33, 0.14);
}

.year-cell:first-child {
    border-left: 0;
}

.year-cell__label {
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.08em;
    opacity: 0.62;
}

.year-cell__value {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.year-cell__value small {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.7;
}

.year-cell__sub {
    font-size: 8.5px;
    line-height: 1.15;
    opacity: 0.6;
    white-space: nowrap;
}

@media (max-width: 400px) {
    .year-cell {
        width: 48px;
    }

    .year-cell__value {
        font-size: 12.5px;
    }

    .year-cell__sub {
        font-size: 8px;
    }
}
/* ==========================================================================
   距除夕倒计时（黄历头部右侧）
   ========================================================================== */
.eve-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    flex: none;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: var(--radius);
    line-height: 1.1;
}

.eve-count__label {
    font-size: 14px;
    letter-spacing: 0.08em;
    opacity: 0.9;
    color: var(--text-brown);
}

.eve-count__days {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--red);
}

.eve-count__days small {
    font-size: 14px;
    font-weight: 400;
    margin-left: 1px;
    opacity: 0.85;
}

.eve-count__date {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
    color: var(--text-brown);
}
/* =============================================================================
 * 顶栏体验期标签（普通用户）
 * ============================================================================= */
.tb-trial {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 2px;
    border: 1px solid currentColor;
    background: transparent;
    font-family: inherit;
    font-size: 11.5px;
    line-height: 1;
    letter-spacing: 0.02em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* 极窄屏收紧 */
@media (max-width: 400px) {
    .tb-trial {
        padding: 3px 6px;
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .tb-trial {
        padding: 3px 5px;
        font-size: 10.5px;
        letter-spacing: 0;
    }
}

@media (max-width: 330px) {
    .tb-trial {
        padding: 3px 4px;
        font-size: 10px;
    }
}
/* 模块卡片角标（开发中/规划中/关闭/受限） */
.module-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 1px 5px;
    border-radius: 2px;
    background: rgba(120, 120, 120, .16);
    color: var(--text-3);
    font-family: var(--font-serif);
    font-size: 9px;
    line-height: 1.5;
    letter-spacing: .02em;
    z-index: 2;
    pointer-events: none;
}

.module-card.is-off {
    cursor: not-allowed;
    opacity: .62;
}

.module-card.is-off .module-badge {
    background: rgba(140, 35, 33, .12);
    color: var(--red);
}

/* =============================================================================
 * 顶栏管理入口（仅管理员可见）
 * -----------------------------------------------------------------------------
 * 朱砂底 + 泥金边，比「风格」按钮更醒目
 * ========================================================================== */
.tb-admin {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 9px 4px 7px;
    border-radius: 999px;
    border: 1px solid rgba(212, 180, 106, .85);
    background: linear-gradient(180deg, var(--red-grad-strong) 0%, var(--red-grad-darker) 100%);
    color: var(--gold-soft);
    font-family: var(--font-serif);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .06em;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .13);
    transition: filter .14s ease, transform .14s ease;
    -webkit-tap-highlight-color: transparent;
}

.tb-admin:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.tb-admin:active {
    transform: translateY(0);
    filter: brightness(.94);
}

.tb-admin__ico {
    flex: none;
    width: 11px;
    height: 11px;
}

.tb-admin__txt {
    flex: none;
}

/* 极窄屏：只留图标 */
@media (max-width: 360px) {
    .tb-admin {
        padding: 4px 7px;
    }

    .tb-admin__txt {
        display: none;
    }
}

@media (max-width: 330px) {
    .tb-admin {
        padding: 3px 6px;
    }

    .tb-admin__ico {
        width: 12px;
        height: 12px;
    }
}

/* =============================================================================
 * 用户菜单：新增「数据管理」（管理员）和「切换风格」（按钮形态）
 * ========================================================================== */

/* 按钮形态的菜单项（和 <a> 视觉一致） */
.user-menu__item--btn {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.user-menu__item--btn:hover {
    background: rgba(176, 141, 79, .12);
}

/* 管理员项：金色小盾牌标记 */






/* =============================================================================
 * 道号菜单：内嵌风格选择
 * ========================================================================== */

/* 去掉「数据管理」前的小「管」字标记 */
.user-menu__item--admin {
    padding-left: 14px;
    font-weight: 700;
    color: var(--gold-pale, var(--gold-sand));
}

.user-menu__item--admin::before {
    content: none;
    display: none;
}



/* =============================================================================
 * 首页全局公告条
 * ========================================================================== */

.notice-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: -16px 0 4px;
    padding: 14px 11px;
    border-radius: var(--radius, 3px);
    border: 1px solid rgba(176, 141, 79, .42);
    border-left: 3px solid var(--gold);
    background: linear-gradient(180deg, rgba(253, 246, 227, .82) 0%, rgba(246, 230, 191, .62) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.notice-bar__mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border-radius: 2px;
    background: var(--gold);
    color: var(--paper-bright);
    font-family: var(--font-serif);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.notice-bar__text {
    flex: 1 1 auto;
    margin: 0;
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.4;
    color: var(--red);
    font-weight: 700;
    letter-spacing: .01em;
    word-break: break-word;
}

/* 深色主题适配 */
.theme-tang .notice-bar,
.theme-mingqing .notice-bar {
    border-color: rgba(176, 141, 79, .35);
    background: linear-gradient(180deg, rgba(253, 246, 227, .1) 0%, rgba(246, 230, 191, .06) 100%);
}

.theme-tang .notice-bar__text,
.theme-mingqing .notice-bar__text {
    color: var(--gold-pale, var(--gold-sand));
}

/* 窄屏 */
@media (max-width: 400px) {
    .notice-bar {
        padding: 7px 9px;
        gap: 6px;
    }

    .notice-bar__text {
        font-size: 12px;
    }
}

/* =============================================================================
 * 首页「本次更新」卡片
 *   位置：功能入口下方
 * ========================================================================== */

.changelog {
    margin-top: 12px;
    padding: 10px 12px 11px;
    border-radius: var(--radius, 3px);
    border: 1px solid var(--hairline, rgba(0, 0, 0, .12));
    border-left: 3px solid var(--gold);
    background: var(--paper-2);
}

/* 头部：版本号 + 标题 + 日期 */
.cl-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
    padding-bottom: 7px;
    border-bottom: 1px dashed rgba(176, 141, 79, .32);
}

.cl-badge {
    flex: none;
    padding: 1px 7px;
    border-radius: 2px;
    background: var(--red);
    color: var(--gold-soft);
    font-family: var(--font-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1.65;
    font-variant-numeric: tabular-nums;
}

.cl-title {
    flex: 1 1 auto;
    font-family: var(--font-serif);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-2, var(--ink-3));
    letter-spacing: .02em;
}

.cl-date {
    flex: none;
    font-size: 10.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

/* 更新条目 */
.cl-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cl-list li {
    position: relative;
    padding-left: 12px;
    margin-bottom: 3px;
    font-family: var(--font-serif);
    font-size: 11.5px;
    line-height: 1.65;
    color: var(--text-2, var(--ink-3));
    word-break: break-word;
}

.cl-list li:last-child {
    margin-bottom: 0;
}

.cl-list li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: .62em;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold);
}

/* 后台版本页的标题小字 */
.cl-title {
    font-size: 12px;
    color: var(--text-3);
}

/* 当前版本卡片高亮 */
.ab-mod.is-cur {
    border-color: rgba(176, 141, 79, .55);
    box-shadow: 0 0 0 1px rgba(176, 141, 79, .22);
}

.ab-mod.is-cur .ab-mod__head {
    background: linear-gradient(180deg, rgba(176, 141, 79, .16) 0%, rgba(176, 141, 79, .06) 100%);
}

/* 深色主题适配 */
.theme-tang .changelog,
.theme-mingqing .changelog {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(212, 180, 106, .25);
}

.theme-tang .cl-list li,
.theme-mingqing .cl-list li,
.theme-tang .cl-title,
.theme-mingqing .cl-title {
    color: var(--gold-pale, var(--gold-sand));
}

/* 窄屏 */
@media (max-width: 400px) {
    .changelog {
        padding: 9px 10px 10px;
        margin-top: 10px;
    }

    .cl-badge {
        font-size: 10.5px;
        padding: 1px 6px;
    }

    .cl-title {
        font-size: 12px;
    }

    .cl-list li {
        font-size: 11px;
        padding-left: 11px;
    }
}

/* ---------- 道号菜单：界面风格入口 ---------- */
.user-menu__item--style {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu__style-sw {
    flex: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    width: 16px;
    height: 16px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}

.user-menu__style-sw i {
    display: block;
}

.user-menu__style-t {
    flex: none;
}

.user-menu__style-n {
    flex: 1 1 auto;
    text-align: right;
    font-size: 10.5px;
    opacity: .62;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =============================================================================
 * 事项提醒 · 弹窗（首页 / 择日页复用，全站基础样式）
 * ========================================================================== */
.remind-mask {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 18, 14, .62);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.remind-mask.is-open {
    opacity: 1;
    visibility: visible;
}

.remind-modal {
    width: 100%;
    max-width: 420px;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    background: var(--paper-bright, var(--paper-2));
    box-shadow: 0 10px 34px rgba(0, 0, 0, .4);
    overflow: hidden;
}

.remind-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
}

.remind-modal__title {
    font-family: var(--font-kai);
    font-size: 16px;
    color: var(--text);
    letter-spacing: .05em;
}

.remind-modal__close {
    border: none;
    background: none;
    font-size: 20px;
    line-height: 1;
    color: var(--text-2);
    cursor: pointer;
    padding: 2px 6px;
}

.remind-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.remind-item {
    border: 1px solid var(--hairline-strong);
    border-radius: 5px;
    padding: 10px 12px;
    background: var(--paper-2);
}

.remind-item.is-expired {
    opacity: .82;
}

.remind-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.remind-item__name {
    font-family: var(--font-kai);
    font-size: 14.5px;
    color: var(--text);
    font-weight: 600;
}

.remind-item__tag {
    flex: none;
    padding: 1px 8px;
    border-radius: 3px;
    font-family: var(--font-kai);
    font-size: 11.5px;
}

.remind-item__tag.is-tag-normal {
    background: rgba(47, 107, 69, .12);
    color: #2f6b45;
}

.remind-item__tag.is-tag-expired {
    background: rgba(140, 35, 33, .12);
    color: var(--red-deep, var(--red));
}

.remind-item__date {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-family: var(--font-kai);
    font-size: 12.5px;
    color: var(--text-2);
}

.remind-item__meta {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px 12px;
    font-family: var(--font-kai);
    font-size: 12px;
    color: var(--text-2);
}

.remind-item__remark {
    flex-basis: 100%;
}

.remind-modal__foot {
    padding: 12px 16px 14px;
}

.remind-modal__btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--red-grad-strong, var(--red)) 0%, var(--red-grad-darker, var(--red)) 100%);
    color: var(--gold-soft, #f5e3b4);
    font-family: var(--font-kai);
    font-size: 15px;
    letter-spacing: .08em;
    cursor: pointer;
}
