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

.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.78); color: #fff; padding: 12px 28px; border-radius: 8px; font-size: 14px; z-index: 99999; display: none; pointer-events: none; }

/* 广告栏 */
.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; }

/* ===== 左右分栏布局 ===== */
.main-layout { display: grid; grid-template-columns: 360px 1fr; gap: 24px; margin: 0 auto; max-width: 1100px; align-items: start; }
/* 窄屏兜底：预防 mode-mobile JS 加载延迟时闪出双栏 */
@media (max-width: 768px) {
    .main-layout { grid-template-columns: 1fr; margin-left: 0; }
}

/* 左栏 */
.left-panel { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }

/* 用户卡片 — 紧凑 */
.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 8px; font-size: 13px; 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: 0; max-width: 100%; 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-blue); 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-blue); 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-date-info .festival-info { font-size: 11px; font-weight: 300; color: var(--color-text-muted); min-height: 0; }

.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: 4px; margin-top: 6px;
    flex-wrap: wrap; justify-content: center;
}
.calendar-reverse input {
    width: 52px; padding: 6px 4px; text-align: center;
    border: 1px solid var(--color-border); border-radius: 4px; font-size: 13px;
}
.calendar-reverse span {
    font-size: 13px; color: var(--color-text-muted);
}
.calendar-reverse .btn-reverse {
    padding: 7px 14px; 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; }

/* 四柱反查布局 */
.reverse-layout { display: flex; gap: 16px; flex-wrap: wrap; }
.reverse-calendar { flex: 3; min-width: 300px; }
.reverse-instructions { flex: 4; min-width: 200px; background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); font-size: 13px; color: var(--color-text-sec); line-height: 1.9; }
.reverse-instructions h4 { margin: 0 0 10px; color: var(--color-dark); font-size: 15px; }
.reverse-instructions ol { padding-left: 18px; margin: 0; }
.rev-note { margin: 8px 0 0; font-size: 11px; color: var(--color-text-faint); line-height: 1.8; }
.text-gold { color: var(--color-gold); }
.text-dark { color: var(--color-dark); }

/* 面板/卡片背景 */
html[data-theme="dark"] .user-card,
html[data-theme="dark"] .tab-bar,
html[data-theme="dark"] .auth-box,
html[data-theme="dark"] .reverse-instructions,
html[data-theme="dark"] .left-instructions,
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .calendar-module { background: var(--color-panel); }

/* 输入框 */
html[data-theme="dark"] .auth-form-group input,
html[data-theme="dark"] .calendar-header input,
html[data-theme="dark"] .calendar-reverse input,
html[data-theme="dark"] .calendar-reverse .btn-reverse { background: #6e6290; }
html[data-theme="dark"] .search-input { background: var(--color-input-bg); color: var(--color-text); border-color: var(--color-input-border); }

html[data-theme="dark"] .auth-form-group input:focus { border-color: var(--color-brand); }
html[data-theme="dark"] ::placeholder { color: #fff; opacity: 1; }

/* 发送验证码按钮 */
html[data-theme="dark"] .auth-btn-code { background: var(--color-subtle); color: var(--color-brand); border-color: var(--color-brand); }

/* 品牌蓝色 → 品牌色变量 */
html[data-theme="dark"] .search-tab.active { border-bottom-color: var(--color-brand); }
html[data-theme="dark"] .auth-tab.active { border-bottom-color: var(--color-brand); }
html[data-theme="dark"] .auth-btn-submit { background: var(--color-brand); }
html[data-theme="dark"] .auth-sub-tab.active { background: var(--color-brand); color: #fff; border-color: var(--color-brand); }
html[data-theme="dark"] .search-tag:hover { border-color: var(--color-brand); color: var(--color-brand); }
html[data-theme="dark"] .search-tag.selected { background: var(--color-brand); border-color: var(--color-brand); }
html[data-theme="dark"] .storage-bar .used { background: linear-gradient(90deg, var(--color-brand), #48bb78); }
html[data-theme="dark"] .link-vip { color: var(--color-brand); }
html[data-theme="dark"] .tree-self-badge { color: var(--color-brand); }
html[data-theme="dark"] .tb-mark-self { color: var(--color-brand); border-color: var(--color-border-light); }
html[data-theme="dark"] .tree-chk,
html[data-theme="dark"] .tree-chk-folder { accent-color: var(--color-brand); }

/* 分隔线 */
html[data-theme="dark"] .tree-sort-item { border-bottom-color: var(--color-border-light); }
html[data-theme="dark"] .move-menu-item { border-bottom-color: var(--color-border-light); }

