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

.toast { position: fixed; top: 24px; right: 24px; background: rgba(0,0,0,0.82); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 9999; display: none; max-width: 320px; }

/* 广告栏 */
.ad-banner {
    display: none; height: 50px; margin: 8px 0 12px 10px;
    border-radius: 6px;
    overflow: hidden;
}
.ad-banner.is-visible { display: block; }
.ad-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 768px) {
    .ad-banner { max-width: 550px; width: calc(100% - 20px); margin: 8px auto 12px; }
}


.nav-item { display: flex; flex-direction: row; align-items: center; gap: 4px; cursor: pointer; height: 100%; transition: all 0.3s; position: relative; text-decoration: none; }


/* 页面标题 */
.page-hero { text-align: center; padding: 32px 0 20px; }
.page-hero h1 { font-size: 26px; font-weight: 700; color: var(--color-dark); margin-bottom: 6px; font-family:"ZhankuWenyi",sans-serif; }
.page-hero p  { font-size: 14px; color: var(--color-text-muted); font-family:"MiSans",sans-serif; font-weight:300; }

/* ===== 左右分栏布局（定义在 base.css，此处仅补左栏宽度覆盖）===== */
/* 左栏 */
.left-panel { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }

/* 左栏简介（原 .reverse-instructions 的独立版） */
.left-instructions {
    background: #fff; border-radius: 10px; padding: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    font-size: 13px; color: var(--color-text-sec); line-height: 1.7;
}
.left-instructions h4 { font-size: 14px; font-weight: 700; color: var(--color-dark); margin-bottom: 8px; }
.left-instructions ol { padding-left: 18px; }
.left-instructions li { margin-bottom: 4px; }
.left-instructions .rev-note { margin-top: 10px; font-size: 12px; color: var(--color-text-muted); line-height: 1.65; }
.left-instructions .text-gold { color: var(--color-gold); }
.left-instructions .text-dark  { color: var(--color-dark); }

/* 用户卡片 — 紧凑 */
.user-card { background: #fff; border-radius: 10px; padding: 12px 16px; box-shadow: 0 1px 6px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 12px; }
.user-card .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--color-border-light); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.user-card .info { flex: 1; min-width: 0; }
.user-card .info .name { font-size: 14px; font-weight: 700; color: var(--color-dark); }
.user-card .info .level { font-size: 11px; color: var(--color-gold); margin-top: 1px; }
.user-card .status-tags { flex-shrink: 0; }
.tag { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tag-free { background: var(--color-subtle); color: var(--color-star-sub); }
.tag-vip  { background: var(--color-parchment); color: var(--color-gold); }
.tag-pro  { background: var(--color-subtle); color: #2D8A2D; }

/* 右栏 */
.right-panel { flex: 1; min-width: 0; }

/* 标签栏 */
.tab-bar { display: flex; gap: 0; margin-bottom: 12px; background: #fff; border-radius: 10px; padding: 4px; box-shadow: 0 1px 6px rgba(0,0,0,0.05); }
.tab-item { flex: 1; text-align: center; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 8px; color: var(--color-star-sub); transition: all 0.2s; }
.tab-item.active { background: var(--color-dark); color: #fff; }
.tab-item:hover:not(.active) { color: var(--color-text); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 登录弹窗 */
#auth-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 10000; align-items: center; justify-content: center; }
#auth-modal.show { display: flex; }
.auth-box { background: #fff; border-radius: 12px; width: 400px; max-width: calc(100vw - 32px); padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.auth-close { float: right; background: none; border: none; font-size: 20px; color: var(--color-text-faint); cursor: pointer; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--color-border-light); }
.auth-tab { flex: 1; text-align: center; padding: 10px 0; font-size: 14px; cursor: pointer; color: var(--color-star-sub); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tab.active { color: var(--color-dark); font-weight: 700; border-bottom-color: #4a6cf7; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-form-group { margin-bottom: 12px; }
.auth-form-group input { width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 14px; outline: none; }
.auth-form-group input:focus { border-color: #4a6cf7; }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; }
.auth-btn-code { white-space: nowrap; padding: 8px 12px; border: 1px solid #4a6cf7; border-radius: 6px; background: #fff; color: #4a6cf7; font-size: 12px; cursor: pointer; }
.auth-btn-submit { width: 100%; padding: 10px; border: none; border-radius: 6px; background: #4a6cf7; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.auth-divider { text-align: center; color: var(--color-text-faint); margin: 12px 0; font-size: 12px; }
.auth-btn-wechat { width: 100%; padding: 10px; border: 1px solid var(--color-border-light); border-radius: 6px; background: var(--color-subtle); font-size: 12px; color: var(--color-star-sub); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.auth-sub-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.auth-sub-tab { padding: 4px 12px; border: 1px solid var(--color-border); border-radius: 4px; background: #fff; font-size: 12px; color: var(--color-star-sub); cursor: pointer; }
.auth-sub-tab.active { background: #4a6cf7; color: #fff; border-color: #4a6cf7; }

/* 日历模块（四柱反查） */
.calendar-module {
    background: #fff; border-radius: 8px; padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
    min-width: 280px; max-width: 480px; margin: 0 auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.calendar-header {
    display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
    padding: 0 4px;
}
.calendar-header input {
    width: 46px; padding: 7px 4px; text-align: center;
    border: 1px solid var(--color-border); border-radius: 6px; font-size: 15px;
}
.calendar-header .btn-turn {
    padding: 7px 14px; background: var(--color-gold); color: #fff;
    border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.calendar-header .btn-turn:hover { background: #c9a029; }

.calendar-nav {
    display: flex; justify-content: center; align-items: center; gap: 3px; margin-bottom: 4px;
}
.calendar-nav button {
    padding: 2px 6px; font-size: 11px; border: 1px solid var(--color-border);
    border-radius: 3px; background: #fff; cursor: pointer; color: var(--color-text-sec);
    font-family: "MiSans", sans-serif; transition: all .15s;
}
.calendar-nav button:hover { background: #e8e0d0; border-color: var(--color-gold); }
.calendar-nav .btn-today {
    width: 20px; height: 20px;
    border: 1.5px solid var(--color-fire); border-radius: 50%;
    background: transparent; color: var(--color-fire);
    font-size: 10px; padding: 0; line-height: 1;
}
.calendar-nav .btn-today:hover { background: var(--color-fire); color: #fff; }

.calendar-week {
    display: grid; grid-template-columns: repeat(7, 1fr);
    text-align: center; font-weight: 600; color: var(--color-text); font-size: 11px;
    padding-bottom: 6px; border-bottom: 1px solid var(--color-border-light);
}
.calendar-week span.today { color: var(--color-gold); }

.calendar-days {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 4px; text-align: center;
}
.calendar-days .day-item {
    padding: 4px 2px; border-radius: 10px; font-size: 13px;
    cursor: pointer; transition: all 0.2s ease;
}
.calendar-days .day-item:hover { background: #f0e8d0; }
.calendar-days .day-item .lunar { font-size: 9px; color: var(--color-text-muted); display: block; margin-top: 1px; }
.calendar-days .day-item .cal-ganzhi { font-size: 8px; color: #0074E5; display: block; margin-top: 0; }
.calendar-days .day-item.active { background: var(--color-gold); color: #fff; }
.calendar-days .day-item.active .lunar,
.calendar-days .day-item.active .cal-ganzhi { color: rgba(255,255,255,0.8); }
.calendar-days .day-item .lunar.jieqi { color: var(--color-fire); font-weight: 600; }

.calendar-date-info {
    text-align: center; padding: 6px 0;
    border-top: 1px solid var(--color-border-light); border-bottom: 1px solid var(--color-border-light);
}
.calendar-date-info .solar-date { font-size: 13px; font-weight: 400; color: var(--color-text); margin-bottom: 2px; }
.calendar-date-info .lunar-date { font-size: 11px; font-weight: 300; color: var(--color-text-sec); }

.calendar-ganzhi-info { font-size: 11px; font-weight: 300; color: var(--color-text); text-align: center; }
.calendar-jieqi-info { font-size: 11px; color: var(--color-fire); text-align: center; margin-top: 4px; line-height: 1.7; }

.calendar-reverse {
    display: flex; align-items: center; gap: 6px; margin-top: 6px;
    flex-wrap: wrap; justify-content: center;
}
.calendar-reverse input {
    width: 48px; padding: 6px 4px; text-align: center;
    border: 1px solid var(--color-border); border-radius: 4px; font-size: 14px;
}
.calendar-reverse .btn-reverse {
    padding: 7px 16px; background: var(--color-dark); color: #fff;
    border: none; border-radius: 4px; cursor: pointer;
    font-size: 14px; font-weight: 600; white-space: nowrap;
}
.calendar-reverse .btn-reverse:hover { opacity: 0.85; }
.calendar-reverse .btn-reverse:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 历史信息card ===== */
.history-card {
    background: #fff; border-radius: 10px; padding: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    max-width: calc(100% - 110px);
}
.history-card-head {
    display: flex; align-items: center; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 1px solid var(--color-border-light);
}
.history-card-title {
    font-size: 15px; font-weight: 700; color: var(--color-dark);
}

.history-date-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.hd-row { display: flex; align-items: baseline; gap: 10px; }
.hd-label {
    width: 32px; flex-shrink: 0;
    font-size: 12px; font-weight: 700; color: var(--color-text-muted);
    text-align: right;
}
.hd-value { font-size: 14px; color: var(--color-text); }
.hd-row-dynasty .hd-value {
    font-size: 14px; color: var(--color-dark); font-weight: 600;
}
html[data-theme="dark"] .hd-row-dynasty .hd-value {
    color: var(--color-text);
}
.hd-dynasty-extra {
    font-size: 12px; color: var(--color-text-muted); font-weight: 400;
    margin-left: 8px;
}

/* 二十四史占位区 */
.history-shiji-placeholder {
    border: 1px dashed var(--color-border-light); border-radius: 8px;
    padding: 40px 20px; text-align: center;
    background: var(--color-subtle);
}
.shiji-placeholder-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.shiji-placeholder-icon { font-size: 28px; opacity: 0.4; }
.shiji-placeholder-text { font-size: 13px; color: var(--color-text-muted); }
