/* 古籍编目系统 - 编目页面样式 */
:root {
    --gb-primary: #8c0000;
    --gb-primary-hover: #a01010;
    --gb-bg: #faf8f4;
    --gb-sidebar-bg: #f5f0e8;
    --gb-border: #d4c5b2;
    --gb-card-bg: #ffffff;
    --gb-text: #3e2e1f;
    --gb-text-light: #6b5a4a;
    --gb-text-lighter: #9b8b7a;
    --gb-input-bg: #fefdfb;
    --gb-shadow-sm: 0 1px 3px rgba(60,30,10,0.04);
    --gb-shadow: 0 2px 8px rgba(60,30,10,0.06);
    --gb-radius: 6px;
    --gb-radius-sm: 4px;
    --gb-transition: 0.2s ease;
}
.guji-bianmu-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif; color: var(--gb-text); }

/* 导航 */
.gb-header { background: linear-gradient(135deg, #7a0000 0%, #8c0000 60%, #6b0000 100%); color: #fff; padding: 0 24px; display: flex; align-items: center; height: 50px; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.gb-logo { font-family: 'Noto Serif SC', serif; font-size: 18px; font-weight: 700; letter-spacing: 3px; margin-right: 32px; }
.gb-nav { display: flex; gap: 2px; flex: 1; }
.gb-nav a { color: rgba(255,255,255,0.8); text-decoration: none; padding: 7px 16px; border-radius: 4px; font-size: 12.5px; transition: all var(--gb-transition); }
.gb-nav a:hover, .gb-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.gb-header-info { font-size: 11.5px; opacity: 0.75; }


/* ============================================================
   主布局：左右分栏，固定高度，独立滚动
   ============================================================ */
.gb-main {
    display: flex;
    height: calc(100vh - 50px - 56px);   /* ⭐ 视口 - 头部 - 底部 */
    overflow: hidden;                     /* ⭐ 页面整体不滚动 */
}

/* ============================================================
   左栏：分类法侧栏（独立垂直滚动）
   ============================================================ */
.gb-sidebar {
    width: 20%;
    min-width: 220px;
    max-width: 300px;
    height: 100%;
    max-height: 100%;
    background: var(--gb-sidebar-bg);
    border-left: 1px solid var(--gb-border);
    overflow-y: auto;                     /* ⭐ 独立滚动 */
    overflow-x: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    padding: 8px 0;
}

/* 左栏滚动条 */
.gb-sidebar::-webkit-scrollbar { width: 6px; }
.gb-sidebar::-webkit-scrollbar-track { background: rgba(140,0,0,0.04); border-radius: 3px; }
.gb-sidebar::-webkit-scrollbar-thumb { background: rgba(140,0,0,0.25); border-radius: 3px; }
.gb-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(140,0,0,0.4); }

/* 左栏每个区块 */
.gb-section {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(180,160,140,0.2);
}
.gb-section:last-child { border-bottom: none; }
.gb-section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--gb-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.gb-section-sub {
    font-size: 10px;
    font-weight: 400;
    color: var(--gb-text-lighter);
    margin-left: 4px;
}
.gb-badge {
    font-size: 10px;
    background: var(--gb-primary);
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}

/* 缩略图 */
.gb-thumb-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    background: #e8e0d5;
    border: 2px dashed var(--gb-border);
    border-radius: var(--gb-radius);
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 10px;
}
.gb-thumb-wrap:hover { border-color: var(--gb-primary); }
.gb-thumb-wrap.has-image { border-style: solid; background: #000; }
.gb-thumb-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }
.gb-thumb-placeholder { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; color: var(--gb-text-lighter); }
.gb-placeholder-icon { font-size: 36px; display: block; margin-bottom: 6px; opacity: 0.5; }
.gb-placeholder-text { font-size: 12px; font-style: italic; }
.gb-thumb-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent,rgba(0,0,0,0.7));
    padding: 20px 10px 8px;
    display: flex; gap: 6px; justify-content: center;
    opacity: 0;
    transition: opacity var(--gb-transition);
}
.gb-thumb-wrap.has-image:hover .gb-thumb-overlay { opacity: 1; }
.gb-thumb-overlay .gb-btn { font-size: 10px; padding: 3px 8px; background: rgba(255,255,255,0.9); color: var(--gb-text); border: none; }
.gb-thumb-overlay .gb-btn:hover { background: #fff; }
.gb-thumb-actions { display: flex; gap: 8px; justify-content: center; }

/* 分类树 */
.gb-cat-tree {
    max-height: 220px;                    /* ⭐ 每个分类树自身滚动 */
    overflow-y: auto;
    font-size: 13px;
    scrollbar-width: thin;
    padding-right: 2px;
}
.gb-cat-tree::-webkit-scrollbar { width: 5px; }
.gb-cat-tree::-webkit-scrollbar-thumb { background: rgba(140,0,0,0.2); border-radius: 3px; }
.gb-cat-tree::-webkit-scrollbar-thumb:hover { background: rgba(140,0,0,0.4); }

.gb-tree-node { margin-bottom: 1px; }
.gb-tree-node-header { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: var(--gb-radius-sm); cursor: pointer; }
.gb-tree-node-header:hover { background: rgba(140,0,0,0.05); }
.gb-tree-toggle { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; font-size: 9px; color: var(--gb-text-lighter); flex-shrink: 0; }
.gb-tree-node.expanded > .gb-tree-node-header .gb-tree-toggle { transform: rotate(90deg); }
.gb-tree-toggle.empty { visibility: hidden; }
.gb-tree-node-header input[type="checkbox"] { width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: var(--gb-primary); }
.gb-node-label { flex: 1; font-size: 12px; }
.gb-node-count { font-size: 10px; color: var(--gb-text-lighter); background: #e8e0d5; padding: 1px 6px; border-radius: 10px; }
.gb-tree-children { margin-left: 16px; border-left: 1px dotted #d4c0a0; padding-left: 6px; display: none; }
.gb-tree-node.expanded > .gb-tree-children { display: block; }

.gb-selected-cats {
    margin-top: 6px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid var(--gb-border);
    border-radius: var(--gb-radius-sm);
    font-size: 11px;
    min-height: 30px;
    max-height: 56px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.gb-selected-cats::-webkit-scrollbar { width: 4px; }
.gb-selected-cats::-webkit-scrollbar-thumb { background: rgba(140,0,0,0.2); border-radius: 2px; }

.gb-cat-tag { display: inline-block; background: #f0e6d8; border: 1px solid #d4c0a0; padding: 2px 8px; border-radius: 10px; margin: 2px 3px; font-size: 11px; }
.gb-cat-tag .gb-remove { cursor: pointer; margin-left: 2px; color: #999; }
.gb-cat-tag .gb-remove:hover { color: #c0392b; }

/* 标签 */
.gb-tag-wrap {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 6px 8px;
    border: 1px solid var(--gb-border);
    border-radius: var(--gb-radius-sm);
    background: var(--gb-input-bg);
    min-height: 38px;
}
.gb-tag-wrap:focus-within { border-color: var(--gb-primary); box-shadow: 0 0 0 3px rgba(140,0,0,0.08); }
.gb-tag-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 3px 10px; background: #f0e6d8; border: 1px solid #d4c0a0; border-radius: 12px; }
.gb-remove-tag { cursor: pointer; color: #b0a090; font-size: 14px; margin-left: 2px; }
.gb-remove-tag:hover { color: #c0392b; }
.gb-tag-input { border: none; outline: none; flex: 1; min-width: 80px; padding: 3px 4px; font-size: 12px; background: transparent; }
.gb-tag-suggestions { margin-top: 6px; font-size: 11px; color: var(--gb-text-lighter); }
.gb-sug-tag { display: inline-block; cursor: pointer; color: var(--gb-primary); margin: 2px 4px; }
.gb-sug-tag:hover { color: var(--gb-primary-hover); text-decoration: underline; }

/* ============================================================
   右栏：编目内容（独立垂直滚动）
   ============================================================ */
.gb-content {
    flex: 1;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;                     /* ⭐ 独立滚动 */
    overflow-x: hidden;
    padding: 16px 20px;
    background: var(--gb-bg);
    box-sizing: border-box;
    scrollbar-width: thin;
}
.gb-content::-webkit-scrollbar { width: 8px; }
.gb-content::-webkit-scrollbar-track { background: rgba(140,0,0,0.04); border-radius: 4px; }
.gb-content::-webkit-scrollbar-thumb { background: rgba(140,0,0,0.25); border-radius: 4px; }
.gb-content::-webkit-scrollbar-thumb:hover { background: rgba(140,0,0,0.4); }

.gb-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    position: sticky;                     /* ⭐ 标题吸顶 */
    top: 0;
    z-index: 10;
    background: var(--gb-bg);
    padding: 8px 0;
    border-bottom: 1px solid rgba(180,160,140,0.2);
}
.gb-content-header h2 { font-family: 'Noto Serif SC', serif; font-size: 17px; color: var(--gb-primary); margin: 0; }
.gb-header-actions { display: flex; gap: 6px; }


/* 搜索框 */
.gb-search-section { margin-bottom: 16px; position: relative; z-index: 50; }
.gb-search-box { display: flex; align-items: center; background: var(--gb-card-bg); border: 2px solid var(--gb-border); border-radius: 8px; padding: 0 12px; transition: border-color var(--gb-transition); }
.gb-search-box:focus-within, .gb-search-box.searching { border-color: var(--gb-primary); box-shadow: 0 0 0 3px rgba(140,0,0,0.08); }
.gb-search-icon { font-size: 18px; color: var(--gb-text-lighter); margin-right: 8px; flex-shrink: 0; }
.gb-search-input { flex: 1; border: none !important; outline: none !important; padding: 12px 0 !important; font-size: 14px !important; font-family: 'Noto Serif SC', serif !important; background: transparent !important; box-shadow: none !important; }
.gb-search-clear { background: none; border: none; color: #999; cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 50%; }
.gb-search-clear:hover { background: #f0e0e0; color: #c0392b; }
.gb-search-spinner { width: 20px; height: 20px; border: 2px solid var(--gb-border); border-top-color: var(--gb-primary); border-radius: 50%; animation: gbSpin 0.6s linear infinite; margin-left: 4px; }
@keyframes gbSpin { to { transform: rotate(360deg); } }
.gb-search-results { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--gb-border); border-top: none; border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); max-height: 420px; overflow-y: auto; display: none; }
.gb-search-results.show { display: block; }
.gb-search-result-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f5f0e8; }
.gb-search-result-item:hover { background: #faf7f1; }
.gb-search-result-thumb { width: 44px; height: 56px; border-radius: 4px; background: #f0ebe0; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.gb-search-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gb-search-result-info { flex: 1; min-width: 0; }
.gb-search-result-title { font-size: 13px; font-weight: 600; font-family: 'Noto Serif SC', serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-result-meta { display: flex; gap: 12px; font-size: 11px; color: var(--gb-text-lighter); margin-top: 3px; }
.gb-result-cat { font-size: 10.5px; color: var(--gb-text-lighter); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-search-pagination { display: flex; justify-content: center; gap: 4px; padding: 10px; border-top: 1px solid #f0ebe0; background: #faf8f4; border-radius: 0 0 8px 8px; }
.gb-page-btn { padding: 4px 10px; font-size: 11px; border: 1px solid var(--gb-border); border-radius: 4px; background: #fff; cursor: pointer; }
.gb-page-btn:hover, .gb-page-btn.active { background: var(--gb-primary); color: #fff; border-color: var(--gb-primary); }
.gb-page-info { font-size: 11px; color: var(--gb-text-lighter); padding: 4px 8px; display: flex; align-items: center; }

/* 卡片 */
.gb-card { background: var(--gb-card-bg); border: 1px solid var(--gb-border); border-radius: var(--gb-radius); box-shadow: var(--gb-shadow-sm); margin-bottom: 12px; }
.gb-card-header { background: #faf7f1; border-bottom: 1px solid rgba(180,160,140,0.3); padding: 10px 14px; display: flex; align-items: center; cursor: pointer; user-select: none; }
.gb-card-header h3 { font-family: 'Noto Serif SC', serif; font-size: 13.5px; font-weight: 600; color: var(--gb-primary); display: flex; align-items: center; gap: 7px; flex: 1; margin: 0; }
.gb-card-icon { font-size: 15px; width: 20px; text-align: center; }
.gb-card-badge { font-size: 10px; background: var(--gb-primary); color: #fff; padding: 2px 7px; border-radius: 10px; margin-right: 8px; }
.gb-toggle-icon { font-size: 11px; color: var(--gb-text-lighter); transition: transform var(--gb-transition); }
.gb-card.collapsed .gb-toggle-icon { transform: rotate(-90deg); }
.gb-card-body { padding: 14px; }
.gb-card.collapsed .gb-card-body { display: none; }

/* 表单 */
.gb-form-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.gb-form-group { display: flex; flex-direction: column; gap: 3px; }
.gb-form-group.col-2  { flex: 1 1 calc(50% - 5px); min-width: 180px; }
.gb-form-group.col-3  { flex: 1 1 calc(33.333% - 7px); min-width: 150px; }
.gb-form-group.col-4  { flex: 1 1 calc(25% - 8px); min-width: 120px; }
.gb-form-group.col-5  { flex: 1 1 calc(20% - 8px); min-width: 100px; }
.gb-form-group.col-8  { flex: 1 1 calc(66.666% - 4px); min-width: 200px; }
.gb-form-group.col-12 { flex: 1 1 100%; }
.gb-form-group label { font-size: 11px; font-weight: 600; color: var(--gb-text-light); text-transform: uppercase; letter-spacing: 0.4px; }
.gb-required { color: #c0392b; }
.gb-form-group input, .gb-form-group textarea, .gb-form-group select { font-family: 'Noto Serif SC', serif; font-size: 13px; padding: 7px 10px; border: 1px solid var(--gb-border); border-radius: var(--gb-radius-sm); background: var(--gb-input-bg); color: var(--gb-text); width: 100%; }
.gb-form-group input:focus, .gb-form-group textarea:focus, .gb-form-group select:focus { outline: none; border-color: var(--gb-primary); box-shadow: 0 0 0 3px rgba(140,0,0,0.08); }
.gb-form-group textarea { resize: vertical; min-height: 56px; }

/* 标题行 + 套录复选框 */
.gb-title-row { display: flex; align-items: center; gap: 10px; }
.gb-taolu-check { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--gb-text-light); cursor: pointer; white-space: nowrap; user-select: none; }
.gb-taolu-check input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; accent-color: var(--gb-primary); }
.gb-taolu-results { margin-top: 4px; border: 1px solid var(--gb-border); border-radius: var(--gb-radius-sm); background: #fff; max-height: 240px; overflow-y: auto; box-shadow: var(--gb-shadow); }
.gb-taolu-result-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f0ebe0; font-size: 12px; }
.gb-taolu-result-item:hover { background: #faf7f1; }
.gb-taolu-result-item .taolu-title { font-weight: 600; font-family: 'Noto Serif SC', serif; }
.gb-taolu-result-item .taolu-meta { font-size: 10.5px; color: var(--gb-text-lighter); margin-top: 2px; }

/* ===== Searchable Combo Box ===== */
.gb-combo-box {
    position: relative;
    display: flex;
    border: 1px solid var(--gb-border);
    border-radius: var(--gb-radius-sm);
    background: var(--gb-input-bg);
    transition: border-color var(--gb-transition);
}
.gb-combo-box:focus-within,
.gb-combo-box.open {
    border-color: var(--gb-primary);
    box-shadow: 0 0 0 3px rgba(140,0,0,0.08);
}
.gb-combo-input {
    flex: 1;
    border: none !important;
    outline: none;
    padding: 7px 8px;
    font-size: 13px;
    font-family: 'Noto Serif SC', serif;
    background: transparent;
    border-radius: var(--gb-radius-sm) 0 0 var(--gb-radius-sm) !important;
    min-width: 60px;
    box-shadow: none !important;
}
.gb-combo-divider {
    width: 1px;
    background: var(--gb-border);
    flex-shrink: 0;
}
.gb-combo-select {
    display: none; /* 隐藏原始 select，由 JS 接管 */
}
.gb-combo-toggle {
    width: 30px;
    border: none !important;
    outline: none;
    cursor: pointer;
    background: transparent;
    border-radius: 0 var(--gb-radius-sm) var(--gb-radius-sm) 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9b8b7a;
    font-size: 10px;
    transition: transform var(--gb-transition);
    flex-shrink: 0;
}
.gb-combo-box.open .gb-combo-toggle {
    transform: rotate(180deg);
}
.gb-combo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--gb-primary);
    border-top: none;
    border-radius: 0 0 var(--gb-radius-sm) var(--gb-radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.gb-combo-box.open .gb-combo-dropdown {
    display: block;
}
.gb-combo-option {
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Noto Serif SC', serif;
    cursor: pointer;
    transition: background var(--gb-transition);
    border-bottom: 1px solid #f5f0e8;
}
.gb-combo-option:last-child {
    border-bottom: none;
}
.gb-combo-option:hover {
    background: #faf7f1;
    color: var(--gb-primary);
}
.gb-combo-option.selected {
    background: var(--gb-primary);
    color: #fff;
}
.gb-combo-option.hidden {
    display: none;
}
.gb-combo-no-result {
    padding: 12px;
    text-align: center;
    color: #9b8b7a;
    font-size: 12px;
}
/* 「等」标签 */
.gb-name-with-deng { display: flex; align-items: center; gap: 4px; }
.gb-name-with-deng input { flex: 1; }
.gb-deng-tag { font-size: 11px; padding: 3px 8px; border: 1px solid #d4c0a0; border-radius: 12px; cursor: pointer; user-select: none; white-space: nowrap; background: #f5f0e8; color: #999; display: none; }
.gb-deng-tag.visible { display: inline-block; }
.gb-deng-tag.active { background: var(--gb-primary); color: #fff; border-color: var(--gb-primary); }

/* 重复器 */
.gb-repeater { border: 1px dashed var(--gb-border); border-radius: var(--gb-radius-sm); padding: 8px; background: #fefdfb; }
.gb-repeater-item { background: #fff; border: 1px solid #e8e0d5; border-radius: var(--gb-radius-sm); padding: 10px 28px 10px 10px; margin-bottom: 6px; position: relative; }
.gb-remove-item { position: absolute; top: 5px; right: 5px; background: none; border: none; color: #c0a890; cursor: pointer; font-size: 18px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.gb-remove-item:hover { background: #fde8e8; color: #c0392b; }
.gb-add-repeater { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--gb-primary); cursor: pointer; padding: 5px 12px; border: 1px solid rgba(140,0,0,0.3); border-radius: var(--gb-radius-sm); background: #fff; }
.gb-add-repeater:hover { background: var(--gb-primary); color: #fff; }

/* 子重复器 */
.gb-sub-repeater { border: 1px dashed #e0d5c0; background: #fefdfb; padding: 6px; }
.gb-sub-item { background: #faf7f1; border: 1px solid #e8e0d5; margin-bottom: 4px; }
.gb-add-sub-repeater { font-size: 10.5px; padding: 4px 10px; }

/* 按钮 */
.gb-btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 16px; font-size: 12.5px; font-weight: 600; border-radius: var(--gb-radius-sm); border: 1px solid transparent; cursor: pointer; transition: all var(--gb-transition); }
.gb-btn-primary { background: var(--gb-primary); color: #fff; }
.gb-btn-primary:hover { background: var(--gb-primary-hover); }
.gb-btn-outline { background: #fff; border-color: var(--gb-border); color: var(--gb-text); }
.gb-btn-outline:hover { background: #faf7f1; border-color: var(--gb-primary); color: var(--gb-primary); }
.gb-btn-sm { padding: 4px 10px; font-size: 11px; }
.gb-btn-xs { padding: 2px 7px; font-size: 10px; }
.gb-btn-ghost { background: transparent; color: var(--gb-primary); border: none; padding: 4px 8px; }
.gb-btn-danger { color: #c0392b; border-color: #e0c8c8; background: #fff; }
.gb-btn-danger:hover { background: #fde8e8; }
.gb-text-danger { color: #c0392b !important; }

/* 底部 */
.gb-footer { background: #fff; border-top: 2px solid var(--gb-primary); padding: 10px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; box-shadow: 0 -3px 10px rgba(0,0,0,0.05); }
.gb-footer-info { flex: 1; font-size: 11px; color: var(--gb-text-lighter); }

/* Toast */
.gb-toast { position: fixed; top: 64px; right: 20px; z-index: 9999; padding: 12px 22px; border-radius: 6px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 20px rgba(0,0,0,0.18); display: none; align-items: center; gap: 8px; animation: gbSlideIn 0.3s ease; }
.gb-toast.success { background: #2e7d32; color: #fff; }
.gb-toast.error { background: #c0392b; color: #fff; }
@keyframes gbSlideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width:900px) { .gb-main { flex-direction: column; } .gb-sidebar { width: 100%; max-width: none; border-right: none; border-bottom: 1px solid var(--gb-border); } .gb-form-group.col-2, .gb-form-group.col-3, .gb-form-group.col-4 { flex: 1 1 100%; } }





/* ============================================================
   Meta Box 模式样式
   ============================================================ */

/* meta box 容器自适应 */
.guji-bianmu-meta-box {
    margin: -6px -12px -12px;
    background: #faf8f4;
}

/* 去掉完整页面的高度限制 */
.guji-bianmu-meta-box .gb-main-meta-box {
    min-height: auto;
    display: flex;
}

/* 左栏收窄 */
.guji-bianmu-meta-box .gb-sidebar {
    width: 260px;
    min-width: 220px;
    max-width: 260px;
    max-height: 600px;
    overflow-y: auto;
}

/* 右栏滚动区 */
.guji-bianmu-meta-box .gb-content {
    padding: 12px 16px;
    max-height: 600px;
    overflow-y: auto;
    background: #faf8f4;
}

/* 卡片内边距微调 */
.guji-bianmu-meta-box .gb-card-body {
    padding: 10px;
}

/* 底部保存栏 */
.gb-meta-box-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-top: 2px solid var(--gb-primary, #8c0000);
    background: #fff;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.05);
}

.gb-meta-box-hint {
    font-size: 12px;
    color: #9b8b7a;
    flex: 1;
}

.gb-meta-box-last-saved {
    font-size: 11px;
    color: #9b8b7a;
    margin-left: auto;
}

/* meta box 模式下 toast 定位 */
.guji-bianmu-meta-box .gb-toast {
    position: fixed;
    top: 40px;
    right: 20px;
}

/* 响应式：窄屏时左栏折叠 */
@media (max-width: 900px) {
    .guji-bianmu-meta-box .gb-main-meta-box {
        flex-direction: column;
    }
    .guji-bianmu-meta-box .gb-sidebar {
        width: 100%;
        max-width: none;
        max-height: 300px;
    }
}



/* meta_box 模式：右栏占满 */
.guji-bianmu-meta-box .gb-content-full {
    width: 100%;
    max-height: 700px;
    overflow-y: auto;
}

/* 左栏分类之间的分隔 */
.gb-sidebar .gb-section + .gb-section {
    border-top: 1px dashed rgba(180, 160, 140, 0.3);
}



/* ============================================================
   浮动按钮组（右侧中部）
   ============================================================ */

.gb-floating-bar {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    user-select: none;
}

.gb-float-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--gb-border, #d4c5b2);
    border-radius: 8px;
    color: var(--gb-text, #3e2e1f);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Noto Serif SC', -apple-system, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 44px;
    justify-content: flex-start;
}

.gb-float-btn:hover {
    background: #fdfbf7;
    border-color: var(--gb-primary, #8c0000);
    color: var(--gb-primary, #8c0000);
    box-shadow: 0 6px 16px rgba(140, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
    transform: translateX(-2px);
}

.gb-float-btn:active {
    transform: translateX(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(140, 0, 0, 0.2);
}

.gb-float-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 保存按钮：主色高亮 */
.gb-float-btn-primary {
    background: var(--gb-primary, #8c0000);
    border-color: var(--gb-primary, #8c0000);
    color: #ffffff;
}

.gb-float-btn-primary:hover {
    background: var(--gb-primary-hover, #a01010);
    border-color: var(--gb-primary-hover, #a01010);
    color: #ffffff;
}

/* 隐藏按钮：低调 */
.gb-float-btn-ghost {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    font-size: 12px;
    padding: 8px 12px;
}

.gb-float-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.gb-float-text {
    line-height: 1;
}

/* 隐藏状态 */
.gb-floating-bar.gb-hidden {
    display: none !important;
}

/* 保存成功后的短暂反馈 */
.gb-float-btn.gb-saving {
    pointer-events: none;
    opacity: 0.7;
}

.gb-float-btn.gb-saving .gb-float-icon {
    animation: gbSpin 0.8s linear infinite;
    display: inline-block;
}

/* 窄屏折叠：只显示图标 */
@media (max-width: 900px) {
    .gb-floating-bar {
        right: 8px;
        gap: 6px;
    }
    .gb-float-btn {
        padding: 10px;
        min-width: 40px;
        justify-content: center;
    }
    .gb-float-text {
        display: none;
    }
    .gb-float-icon {
        font-size: 18px;
    }
}

/* meta box 模式下按钮位置略微下移，避免和 WP 后台顶栏重叠 */
.guji-bianmu-meta-box .gb-floating-bar {
    top: 50%;
}




/* ============================================================
   产品编辑页 - 自定义分类 metabox 美化
   作用于 WordPress 原生 taxonomy metabox
   ============================================================ */

/* 针对 6 个自定义分类法的 metabox 外层 */
#banbenleixingdiv,
#liubufuleidiv,
#liubufenleidiv,
#wenzhongdiv,
#hanggejielandiv,
#keyinshijiandiv,
#guancangdizhidiv {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d4c5b2;
}

/* metabox 标题栏 - 北大红风格 */
#banbenleixingdiv .postbox-header,
#liubufenleidiv .postbox-header,
#wenzhongdiv .postbox-header,
#hanggejielandiv .postbox-header,
#keyinshijiandiv .postbox-header,
#guancangdizhidiv .postbox-header {
    background: linear-gradient(135deg, #fdfbf9 0%, #f7f2ee 100%);
    border-bottom: 1px solid rgba(140, 0, 0, 0.12);
}

#banbenleixingdiv .postbox-header h2,
#liubufenleidiv .postbox-header h2,
#wenzhongdiv .postbox-header h2,
#hanggejielandiv .postbox-header h2,
#keyinshijiandiv .postbox-header h2,
#guancangdizhidiv .postbox-header h2 {
    color: #8c0000;
    font-weight: 600;
    font-size: 13.5px;
    font-family: 'Noto Serif SC', serif;
}

/* metabox 内部 */
#banbenleixingdiv .inside,
#liubufenleidiv .inside,
#wenzhongdiv .inside,
#hanggejielandiv .inside,
#keyinshijiandiv .inside,
#guancangdizhidiv .inside {
    background: #ffffff;
    margin: 0;
    padding: 10px 12px;
}

/* 分类树 ul */
#banbenleixingchecklist,
#liubufenleichecklist,
#wenzhongchecklist,
#hanggejielanchecklist,
#keyinshijianchecklist,
#guancangdizhichecklist {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
    font-size: 13px;
}

/* 每个分类项 li */
#banbenleixingchecklist li,
#liubufenleichecklist li,
#wenzhongchecklist li,
#hanggejielanchecklist li,
#keyinshijianchecklist li,
#guancangdizhichecklist li {
    position: relative;
    padding: 2px 0;
    line-height: 1.5;
}

/* label - 点击区域 */
#banbenleixingchecklist li label,
#liubufenleichecklist li label,
#wenzhongchecklist li label,
#hanggejielanchecklist li label,
#keyinshijianchecklist li label,
#guancangdizhichecklist li label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 12.5px;
    color: #3e2e1f;
}

#banbenleixingchecklist li label:hover,
#liubufenleichecklist li label:hover,
#wenzhongchecklist li label:hover,
#hanggejielanchecklist li label:hover,
#keyinshijianchecklist li label:hover,
#guancangdizhichecklist li label:hover {
    background: rgba(140, 0, 0, 0.05);
    color: #8c0000;
}

/* 复选框 */
#banbenleixingchecklist li input[type="checkbox"],
#liubufenleichecklist li input[type="checkbox"],
#wenzhongchecklist li input[type="checkbox"],
#hanggejielanchecklist li input[type="checkbox"],
#keyinshijianchecklist li input[type="checkbox"],
#guancangdizhichecklist li input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #8c0000;
    flex-shrink: 0;
}

/* 子级 ul 缩进 */
#banbenleixingchecklist li ul.children,
#liubufenleichecklist li ul.children,
#wenzhongchecklist li ul.children,
#hanggejielanchecklist li ul.children,
#keyinshijianchecklist li ul.children,
#guancangdizhichecklist li ul.children {
    list-style: none;
    margin-left: 20px;
    padding-left: 6px;
    border-left: 1px dotted #d4c0a0;
}

/* 展开/折叠 [+]/[-] */
#banbenleixingchecklist li > a.show,
#banbenleixingchecklist li > a.collapse,
#liubufenleichecklist li > a.show,
#liubufenleichecklist li > a.collapse,
#wenzhongchecklist li > a.show,
#wenzhongchecklist li > a.collapse,
#hanggejielanchecklist li > a.show,
#hanggejielanchecklist li > a.collapse,
#keyinshijianchecklist li > a.show,
#keyinshijianchecklist li > a.collapse,
#guancangdizhichecklist li > a.show,
#guancangdizhichecklist li > a.collapse {
    position: absolute;
    left: 0;
    top: 6px;
    width: 14px;
    height: 14px;
    font-size: 11px;
    line-height: 14px;
    text-align: center;
    text-decoration: none;
    color: #8c0000;
    background: rgba(140, 0, 0, 0.08);
    border-radius: 3px;
    cursor: pointer;
    z-index: 1;
}

#banbenleixingchecklist li > a.show:hover,
#banbenleixingchecklist li > a.collapse:hover,
#liubufenleichecklist li > a.show:hover,
#liubufenleichecklist li > a.collapse:hover,
#wenzhongchecklist li > a.show:hover,
#wenzhongchecklist li > a.collapse:hover,
#hanggejielanchecklist li > a.show:hover,
#hanggejielanchecklist li > a.collapse:hover,
#keyinshijianchecklist li > a.show:hover,
#keyinshijianchecklist li > a.collapse:hover,
#guancangdizhichecklist li > a.show:hover,
#guancangdizhichecklist li > a.collapse:hover {
    background: #8c0000;
    color: #fff;
}

/* 有子级的 li，label 左边留空给 [+]/[-] */
#banbenleixingchecklist li > a.show ~ label,
#banbenleixingchecklist li > a.collapse ~ label,
#liubufenleichecklist li > a.show ~ label,
#liubufenleichecklist li > a.collapse ~ label,
#wenzhongchecklist li > a.show ~ label,
#wenzhongchecklist li > a.collapse ~ label,
#hanggejielanchecklist li > a.show ~ label,
#hanggejielanchecklist li > a.collapse ~ label,
#keyinshijianchecklist li > a.show ~ label,
#keyinshijianchecklist li > a.collapse ~ label,
#guancangdizhichecklist li > a.show ~ label,
#guancangdizhichecklist li > a.collapse ~ label {
    padding-left: 20px;
}

/* ============================================================
   "最多使用"标签页
   ============================================================ */
#banbenleixing-tabs,
#liubufenlei-tabs,
#wenzhong-tabs,
#hanggejielan-tabs,
#keyinshijian-tabs,
#guancangdizhi-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid rgba(140, 0, 0, 0.1);
}

#banbenleixing-tabs li,
#liubufenlei-tabs li,
#wenzhong-tabs li,
#hanggejielan-tabs li,
#keyinshijian-tabs li,
#guancangdizhi-tabs li {
    margin: 0;
}

#banbenleixing-tabs li a,
#liubufenlei-tabs li a,
#wenzhong-tabs li a,
#hanggejielan-tabs li a,
#keyinshijian-tabs li a,
#guancangdizhi-tabs li a {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #9b8b7a;
    text-decoration: none;
    border-radius: 4px 4px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.15s ease;
}

#banbenleixing-tabs li a:hover,
#liubufenlei-tabs li a:hover,
#wenzhong-tabs li a:hover,
#hanggejielan-tabs li a:hover,
#keyinshijian-tabs li a:hover,
#guancangdizhi-tabs li a:hover {
    color: #8c0000;
    background: rgba(140, 0, 0, 0.04);
}

#banbenleixing-tabs li.tabs a,
#liubufenlei-tabs li.tabs a,
#wenzhong-tabs li.tabs a,
#hanggejielan-tabs li.tabs a,
#keyinshijian-tabs li.tabs a,
#guancangdizhi-tabs li.tabs a {
    color: #8c0000;
    background: #fff;
    border-color: rgba(140, 0, 0, 0.15);
    border-bottom-color: #fff;
    margin-bottom: -1px;
}

/* "最多使用"面板 */
#banbenleixing-pop,
#liubufenlei-pop,
#wenzhong-pop,
#hanggejielan-pop,
#keyinshijian-pop,
#guancangdizhi-pop {
    padding: 6px 0;
}

#banbenleixingchecklist-pop,
#liubufenleichecklist-pop,
#wenzhongchecklist-pop,
#hanggejielanchecklist-pop,
#keyinshijianchecklist-pop,
#guancangdizhichecklist-pop {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ============================================================
   添加新分类 区域
   ============================================================ */
#banbenleixing-adder,
#liubufenlei-adder,
#wenzhong-adder,
#hanggejielan-adder,
#keyinshijian-adder,
#guancangdizhi-adder {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(140, 0, 0, 0.15);
}

#banbenleixing-add-toggle,
#liubufenlei-add-toggle,
#wenzhong-add-toggle,
#hanggejielan-add-toggle,
#keyinshijian-add-toggle,
#guancangdizhi-add-toggle {
    font-size: 12px;
    color: #8c0000;
    text-decoration: none;
    font-weight: 600;
}

#banbenleixing-add-toggle:hover,
#liubufenlei-add-toggle:hover,
#wenzhong-add-toggle:hover,
#hanggejielan-add-toggle:hover,
#keyinshijian-add-toggle:hover,
#guancangdizhi-add-toggle:hover {
    color: #a01010;
    text-decoration: underline;
}

/* 添加新分类的输入框 */
#newbanbenleixing,
#newliubufenlei,
#newwenzhong,
#newhanggejielan,
#newkeyinshijian,
#newguancangdizhi {
    width: 100%;
    padding: 6px 10px;
    font-size: 12.5px;
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    margin: 6px 0;
    background: #fefdfb;
}

#newbanbenleixing:focus,
#newliubufenlei:focus,
#newwenzhong:focus,
#newhanggejielan:focus,
#newkeyinshijian:focus,
#newguancangdizhi:focus {
    border-color: #8c0000;
    box-shadow: 0 0 0 3px rgba(140, 0, 0, 0.08);
    outline: none;
}

/* 父级分类 select */
#newbanbenleixing_parent,
#newliubufenlei_parent,
#newwenzhong_parent,
#newhanggejielan_parent,
#newkeyinshijian_parent,
#newguancangdizhi_parent {
    width: 100%;
    padding: 6px 8px;
    font-size: 12.5px;
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    background: #fefdfb;
    margin-bottom: 6px;
}

/* 添加按钮 */
#banbenleixing-add-submit,
#liubufenlei-add-submit,
#wenzhong-add-submit,
#hanggejielan-add-submit,
#keyinshijian-add-submit,
#guancangdizhi-add-submit {
    background: #8c0000;
    color: #fff;
    border-color: #8c0000;
    border-radius: 4px;
    font-size: 12px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

#banbenleixing-add-submit:hover,
#liubufenlei-add-submit:hover,
#wenzhong-add-submit:hover,
#hanggejielan-add-submit:hover,
#keyinshijian-add-submit:hover,
#guancangdizhi-add-submit:hover {
    background: #a01010;
    border-color: #a01010;
}

/* 滚动条美化 */
#banbenleixingchecklist::-webkit-scrollbar,
#liubufenleichecklist::-webkit-scrollbar,
#wenzhongchecklist::-webkit-scrollbar,
#hanggejielanchecklist::-webkit-scrollbar,
#keyinshijianchecklist::-webkit-scrollbar,
#guancangdizhichecklist::-webkit-scrollbar {
    width: 6px;
}

#banbenleixingchecklist::-webkit-scrollbar-thumb,
#liubufenleichecklist::-webkit-scrollbar-thumb,
#wenzhongchecklist::-webkit-scrollbar-thumb,
#hanggejielanchecklist::-webkit-scrollbar-thumb,
#keyinshijianchecklist::-webkit-scrollbar-thumb,
#guancangdizhichecklist::-webkit-scrollbar-thumb {
    background: rgba(140, 0, 0, 0.2);
    border-radius: 3px;
}

#banbenleixingchecklist::-webkit-scrollbar-thumb:hover,
#liubufenleichecklist::-webkit-scrollbar-thumb:hover,
#wenzhongchecklist::-webkit-scrollbar-thumb:hover,
#hanggejielanchecklist::-webkit-scrollbar-thumb:hover,
#keyinshijianchecklist::-webkit-scrollbar-thumb:hover,
#guancangdizhichecklist::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 0, 0, 0.4);
}





/* ============================================================
   产品编辑页 - 右侧栏整体滚动
   ============================================================ */
@media screen and (min-width: 851px) {
    #side-sortables {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 4px;
    }

    #side-sortables::-webkit-scrollbar {
        width: 6px;
    }

    #side-sortables::-webkit-scrollbar-thumb {
        background: rgba(140, 0, 0, 0.25);
        border-radius: 3px;
    }

    #side-sortables::-webkit-scrollbar-thumb:hover {
        background: rgba(140, 0, 0, 0.4);
    }
}

/* 时间组件 */
.gb-time-component { margin-bottom: 6px; }
.gb-time-row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.gb-time-placeholder { font-size: 12px; color: #b0a191; padding: 8px; border: 1px dashed #d4c5b2; border-radius: 4px; text-align: center; }

/* 时间下拉框 */
.gb-year-container, .gb-day-container { position: relative; }
.gb-year-dropdown, .gb-day-dropdown { position: absolute; top: 100%; left: 0; z-index: 9999; background: #fff; border: 1px solid #d4c5b2; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.gb-year-options, .gb-day-options { max-height: 180px; overflow-y: auto; }

/* Meta Box 适配 */
.guji-bianmu-meta-box { margin: -6px -12px -12px; background: #faf8f4; }
.guji-bianmu-meta-box .gb-main-meta-box { min-height: auto; display: flex; }
.guji-bianmu-meta-box .gb-sidebar { width: 240px; min-width: 220px; max-width: 260px; max-height: 600px; overflow-y: auto; }
.guji-bianmu-meta-box .gb-content { padding: 12px 16px; max-height: 600px; overflow-y: auto; }
.guji-bianmu-meta-box .gb-card-body { padding: 10px; }
.gb-meta-box-footer { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 2px solid var(--gb-primary, #8c0000); background: #fff; position: sticky; bottom: 0; z-index: 10; }
.gb-meta-box-hint { font-size: 12px; color: #9b8b7a; flex: 1; }
.gb-meta-box-last-saved { font-size: 11px; color: #9b8b7a; margin-left: auto; }


/* ============================================================
   出版印刷信息布局（v5 最终版）
   2026-10-05
   合并去重 + 单行时间行
   ============================================================ */

/* ------------------------------------------------------------
   1. publishers 行容器
   ------------------------------------------------------------ */
.gb-publishers-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    z-index: 1;
}

/* ------------------------------------------------------------
   2. col-12 占满整行
   ------------------------------------------------------------ */
.gb-publishers-row .gb-form-group.col-12 {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    margin-bottom: 8px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    z-index: 10;
}

/* ------------------------------------------------------------
   3. col-2 / col-3
   ------------------------------------------------------------ */
.gb-publishers-row .gb-form-group.col-2 {
    flex: 0 1 120px;
    min-width: 80px;
    max-width: 140px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

.gb-publishers-row .gb-form-group.col-3 {
    flex: 0 1 140px;
    min-width: 100px;
    max-width: 180px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

/* ------------------------------------------------------------
   4. 时间组件容器
   ------------------------------------------------------------ */
.gb-time-component {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    z-index: 20;
}

/* ------------------------------------------------------------
   5. ⭐ 时间行：强制单行（关键）
   ------------------------------------------------------------ */
.gb-time-row {
    display: flex !important;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap !important;   /* ⭐ 不换行 */
    font-size: 11px;
    margin-bottom: 6px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;                /* 内容过多时横向滚动 */
    overflow-y: visible;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

/* 时间行滚动条美化 */
.gb-time-row::-webkit-scrollbar {
    height: 4px;
}
.gb-time-row::-webkit-scrollbar-track {
    background: transparent;
}
.gb-time-row::-webkit-scrollbar-thumb {
    background: #d4c5b2;
    border-radius: 2px;
}
.gb-time-row::-webkit-scrollbar-thumb:hover {
    background: #b0a191;
}

/* 时间行的直接子元素都不收缩 */
.gb-time-row > * {
    flex-shrink: 0;
    box-sizing: border-box;
}

/* label（"中历：" "西历："） */
.gb-time-label {
    font-size: 10px;
    color: #6b5a4a;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 兼容旧结构：无 class 的 label */
.gb-time-row > span:first-child {
    font-size: 10px;
    color: #6b5a4a;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 单位（"日"） */
.gb-time-unit {
    font-size: 10px;
    color: #6b5a4a;
    flex-shrink: 0;
}

/* 分隔符 "-" */
.gb-sep {
    font-size: 11px;
    color: #9b8b7a;
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   6. select 和 input 统一
   ------------------------------------------------------------ */
.gb-time-row select,
.gb-time-row input[type="text"] {
    font-size: 11px;
    padding: 2px 4px;
    height: 24px;
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    background: #fefdfb;
    color: #3e2e1f;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.gb-time-row select:focus,
.gb-time-row input[type="text"]:focus {
    border-color: #8c0000;
    box-shadow: 0 0 0 2px rgba(140,0,0,0.08);
}

.gb-time-row select.gb-reign:not(:disabled) {
    background: #fefdfb;
    color: #3e2e1f;
    cursor: pointer;
}

.gb-time-row select.gb-reign:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* 各控件固定宽度 */
.gb-time-row select.gb-dynasty { width: 68px; }
.gb-time-row select.gb-reign   { width: 68px; }
.gb-time-row select.gb-season  { width: 42px; }
.gb-time-row select.gb-month   { width: 58px; }

/* 西历输入框宽度（强制覆盖默认宽度） */
.gb-time-row input.gb-western-year-start,
.gb-time-row input.gb-western-year-end {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    text-align: center;
    padding: 2px 4px !important;
    box-sizing: border-box !important;
}

.gb-time-row input.gb-western-month-start,
.gb-time-row input.gb-western-month-end {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    text-align: center;
    padding: 2px 4px !important;
    box-sizing: border-box !important;
}

.gb-time-row input.gb-western-day-start,
.gb-time-row input.gb-western-day-end {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    text-align: center;
    padding: 2px 4px !important;
    box-sizing: border-box !important;
}

/* 所有西历输入统一高度 */
.gb-time-row input[class^="gb-western-"] {
    height: 24px !important;
    font-size: 11px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

/* 分隔符 "-" 紧凑 */
.gb-time-row .gb-sep {
    font-size: 11px;
    color: #9b8b7a;
    padding: 0 1px;
    flex-shrink: 0;
}

/* "至" 标签 */
.gb-time-row .gb-western-end-label {
    font-size: 11px;
    color: #8c0000;
    white-space: nowrap;
    padding: 0 4px;
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   7. 年份/日份容器
   ------------------------------------------------------------ */
.gb-year-container {
    position: relative;
    width: 82px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.gb-day-container {
    position: relative;
    width: 68px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* ------------------------------------------------------------
   8. 触发器
   ------------------------------------------------------------ */
.gb-year-trigger,
.gb-day-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 2px 6px;
    font-size: 11px;
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    background: #fefdfb;
    cursor: pointer;
    min-height: 24px;
    height: 24px;
    box-sizing: border-box;
    transition: border-color 0.15s;
    overflow: hidden;
}

.gb-year-trigger:hover,
.gb-day-trigger:hover {
    border-color: #8c0000;
}

.gb-year-trigger > .gb-year-text,
.gb-day-trigger > .gb-day-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: left;
    font-size: 11px;
}

/* 兼容旧结构：触发器第一个 span */
.gb-year-trigger > span:first-child,
.gb-day-trigger > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.gb-dropdown-arrow {
    font-size: 9px;
    color: #9b8b7a;
    margin-left: 2px;
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   9. 年份/日份下拉框（position: fixed）
   ------------------------------------------------------------ */
.gb-year-dropdown,
.gb-day-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999999 !important;
    background: #fff;
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 160px;
    max-height: 300px;
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.gb-year-dropdown.gb-dropdown-open,
.gb-day-dropdown.gb-dropdown-open {
    display: flex !important;
}

/* 搜索框容器 */
.gb-dropdown-search-wrap {
    flex-shrink: 0;
    padding: 6px 8px;
    background: #fff;
    border-bottom: 1px solid #e6dfd3;
}

.gb-dropdown-search {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    background: #fefdfb;
    color: #3e2e1f;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.gb-dropdown-search:focus {
    border-color: #8c0000;
    box-shadow: 0 0 0 2px rgba(140,0,0,0.08);
}

/* 选项列表 */
.gb-year-options,
.gb-day-options {
    flex: 1;
    overflow-y: auto;
    max-height: 240px;
}

.gb-year-options::-webkit-scrollbar,
.gb-day-options::-webkit-scrollbar {
    width: 6px;
}

.gb-year-options::-webkit-scrollbar-thumb,
.gb-day-options::-webkit-scrollbar-thumb {
    background: #d4c5b2;
    border-radius: 3px;
}

/* 选项 */
.gb-year-option,
.gb-day-option {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    color: #3e2e1f;
    white-space: nowrap;
    transition: background 0.1s;
}

.gb-year-option:hover,
.gb-day-option:hover {
    background: #faf7f1;
    color: #8c0000;
}

/* 分组标题（"—— 干支 ——"） */
.gb-year-options > div[style*="b0a191"],
.gb-day-options > div[style*="b0a191"] {
    pointer-events: none;
    user-select: none;
}

/* 无匹配提示 */
.gb-dropdown-no-result {
    padding: 12px;
    text-align: center;
    color: #b0a191;
    font-size: 12px;
}

/* ------------------------------------------------------------
   10. 滚动容器保留滚动条
   ------------------------------------------------------------ */
.guji-bianmu-wrap[data-mode="meta_box"] .gb-content-full,
.guji-bianmu-wrap[data-mode="meta_box"] .gb-content {
    max-height: 700px;
    overflow-y: auto !important;
    overflow-x: hidden;
}

.guji-bianmu-wrap[data-mode="page"] .gb-content {
    max-height: none;
    overflow-y: visible;
}

/* ------------------------------------------------------------
   11. 时间组件里的 textarea 隐藏
   ------------------------------------------------------------ */
.gb-time-data {
    display: none !important;
}

/* ------------------------------------------------------------
   12. publishers 里的 combobox 和普通 input
   ------------------------------------------------------------ */
.gb-publishers-row .gb-combo-box {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gb-publishers-row input[type="text"] {
    width: 100%;
    max-width: 100%;
    height: 35px;
    padding: 7px 10px;
    box-sizing: border-box;
}

/* ------------------------------------------------------------
   13. 出版印刷分隔线
   ------------------------------------------------------------ */
.gb-publishers-divider {
    border: none;
    border-top: 1px dashed #d4c5b2;
    margin: 12px 0;
    height: 0;
    width: 100%;
}

/* ------------------------------------------------------------
   14. 卡片折叠
   ------------------------------------------------------------ */
.gb-card.collapsed .gb-card-body {
    display: none !important;
}

.gb-card.collapsed .gb-toggle-icon {
    transform: rotate(-90deg);
}

.gb-card-header {
    cursor: pointer;
    user-select: none;
}

.gb-card-header:hover {
    background: #f5f0e8;
}

/* ------------------------------------------------------------
   15. 重复器按钮布局
   ------------------------------------------------------------ */
.gb-repeater > .gb-add-repeater {
    display: inline-flex;
    margin-top: 6px;
}

.gb-repeater > .gb-repeater-item + .gb-repeater-item {
    margin-top: 6px;
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 900px) {
    .gb-publishers-row .gb-form-group.col-2,
    .gb-publishers-row .gb-form-group.col-3 {
        flex: 1 1 calc(50% - 4px);
        max-width: none;
        min-width: 0;
    }
    
    .gb-time-row {
        flex-wrap: wrap !important;
        overflow-x: visible;
        gap: 2px;
    }
    
    .gb-time-row select,
    .gb-time-row input[type="text"] {
        font-size: 10px;
        padding: 1px 3px;
        height: 22px;
    }
    
    .gb-year-container {
        width: 56px;
    }
    
    .gb-day-container {
        width: 62px;
    }
}



/* ============================================================
   Meta Box 模式：隐藏左栏
   ============================================================ */
.guji-bianmu-meta-box .gb-sidebar,
.guji-bianmu-meta-box .gb-main-meta-box > .gb-sidebar {
    display: none !important;
}

.guji-bianmu-meta-box .gb-sidebar-toggle-wrap {
    display: none !important;
}

/* 让右栏占满整个宽度 */
.guji-bianmu-meta-box .gb-content-full {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
}

/* 主容器改为块级布局 */
.guji-bianmu-meta-box .gb-main-meta-box {
    display: block !important;
    width: 100% !important;
}

/* ============================================================
   下拉框统一方案：全部 appendTo('body') + 统一 z-index
   2026-10-05
   ============================================================ */

/* ------------------------------------------------------------
   1. 通用下拉框：统一 z-index + fixed 定位
   ------------------------------------------------------------ */
.gb-combo-dropdown,
.gb-year-dropdown,
.gb-day-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483000 !important;
    background: #fff;
    box-sizing: border-box;
    display: none;
    padding: 0;
    margin: 0;
}

/* ------------------------------------------------------------
   2. combobox 下拉框
   ------------------------------------------------------------ */
.gb-combo-dropdown {
    border: 1px solid #8c0000;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 260px;
    overflow-y: auto;
    min-width: 100px;
}

.gb-combo-dropdown.gb-dropdown-open {
    display: block !important;
}

/* combobox 选项 */
.gb-combo-dropdown .gb-combo-option {
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'Noto Serif SC', serif;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f5f0e8;
    color: #3e2e1f;
    white-space: nowrap;
}

.gb-combo-dropdown .gb-combo-option:last-child {
    border-bottom: none;
}

.gb-combo-dropdown .gb-combo-option:hover {
    background: #faf7f1;
    color: #8c0000;
}

.gb-combo-dropdown .gb-combo-option.selected {
    background: #8c0000;
    color: #fff;
}

.gb-combo-dropdown .gb-combo-option.hidden {
    display: none;
}

.gb-combo-dropdown .gb-combo-no-result {
    padding: 12px;
    text-align: center;
    color: #9b8b7a;
    font-size: 12px;
}

/* ------------------------------------------------------------
   3. 年份/日份下拉框
   ------------------------------------------------------------ */
.gb-year-dropdown,
.gb-day-dropdown {
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 160px;
    max-height: 300px;
    flex-direction: column;
    overflow: hidden;
}

.gb-year-dropdown.gb-dropdown-open,
.gb-day-dropdown.gb-dropdown-open {
    display: flex !important;
}

/* 搜索框容器 */
.gb-dropdown-search-wrap {
    flex-shrink: 0;
    padding: 6px 8px;
    background: #fff;
    border-bottom: 1px solid #e6dfd3;
}

.gb-dropdown-search {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    background: #fefdfb;
    color: #3e2e1f;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.gb-dropdown-search:focus {
    border-color: #8c0000;
    box-shadow: 0 0 0 2px rgba(140,0,0,0.08);
}

/* 选项列表 */
.gb-year-options,
.gb-day-options {
    flex: 1;
    overflow-y: auto;
    max-height: 240px;
}

/* 选项 */
.gb-year-option,
.gb-day-option {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    color: #3e2e1f;
    white-space: nowrap;
    transition: background 0.1s;
}

.gb-year-option:hover,
.gb-day-option:hover {
    background: #faf7f1;
    color: #8c0000;
}

/* 分组标题（"—— 干支 ——"） */
.gb-year-options > div[style*="b0a191"],
.gb-day-options > div[style*="b0a191"] {
    pointer-events: none;
    user-select: none;
}

/* 无匹配提示 */
.gb-dropdown-no-result {
    padding: 12px;
    text-align: center;
    color: #b0a191;
    font-size: 12px;
}

/* ------------------------------------------------------------
   4. ⚠️ 不要给这些父容器设置 z-index
   （否则会创建 stacking context，让 fixed 失效）
   ------------------------------------------------------------ */

/* ⚠️ 下面这些规则必须删除或注释掉：
   .gb-combo-box { z-index: 1; }
   .gb-combo-box.open { z-index: 2; }
   .gb-year-container { z-index: 1000; }
   .gb-day-container { z-index: 1000; }
   .gb-time-component { z-index: 500; }
   .gb-publishers-row { z-index: 10; }
   .gb-time-row { z-index: 100; }
*/

/* 只保留 .gb-combo-box 的基本定位（不设 z-index） */
.gb-combo-box {
    position: relative;
}

/* 时间容器基本定位（不设 z-index） */
.gb-year-container,
.gb-day-container {
    position: relative;
}

.gb-time-component {
    position: relative;
}

.gb-publishers-row {
    position: relative;
}

.gb-time-row {
    position: relative;
}


/* ============================================================
   Emoji 字符（替代 <img class="emoji">）
   ============================================================ */
.gb-emoji-char {
    display: inline-block;
    font-size: 15px;
    line-height: 1;
    vertical-align: -0.1em;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
    font-style: normal;
    font-weight: normal;
}


/* ============================================================
   内网环境：隐藏任何 emoji 图片
   ============================================================ */
img.emoji {
    display: none !important;
}

/* 符号图标样式 */
.gb-card-icon {
    font-size: 16px;
    line-height: 1;
    color: #8c0000;
    font-family: 'Noto Serif SC', serif;
    font-weight: 400;
}




/* ============================================================
   保存编目按钮：按压 + 保存中 + 成功/失败 反馈
   ============================================================ */

/* 通用：所有按钮都有按压效果 */
.gb-btn {
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
}

.gb-btn:active {
    transform: scale(0.96) translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

/* ============================================================
   保存编目按钮（主按钮）
   ============================================================ */
#gbSaveInMetaBox,
#gbSavePublish,
#gbFloatSave {
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 默认按下效果 */
#gbSaveInMetaBox:active:not(:disabled),
#gbSavePublish:active:not(:disabled),
#gbFloatSave:active:not(:disabled) {
    transform: scale(0.94);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.25);
}

/* 保存中状态 */
.gb-btn.gb-saving {
    pointer-events: none;
    opacity: 0.85;
    cursor: wait;
}

.gb-btn.gb-saving::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gb-spin 0.7s linear infinite;
}

.gb-btn.gb-saving .gb-btn-text,
.gb-btn.gb-saving > span:not(.gb-spin) {
    opacity: 0;
}

@keyframes gb-spin {
    to { transform: rotate(360deg); }
}

/* 成功状态 */
.gb-btn.gb-save-success {
    background: #2e7d32 !important;
    border-color: #2e7d32 !important;
    color: #fff !important;
    animation: gb-pulse-success 0.4s ease;
}

@keyframes gb-pulse-success {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* 失败状态 */
.gb-btn.gb-save-error {
    background: #c0392b !important;
    border-color: #c0392b !important;
    color: #fff !important;
    animation: gb-shake 0.4s ease;
}

@keyframes gb-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-4px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

/* 涟漪效果（可选） */
.gb-btn.gb-ripple::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.gb-btn.gb-ripple:active::before {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: 0s;
}



/* ============================================================
   模糊时间输入框
   ============================================================ */
.gb-time-row .gb-fuzzy-time {
    flex: 1;
    min-width: 140px;
    max-width: 260px;
    font-size: 11px;
    padding: 2px 6px;
    height: 24px;
    border: 1px solid #d4c5b2;
    border-radius: 4px;
    background: #fefdfb;
    color: #3e2e1f;
    box-sizing: border-box;
    font-family: inherit;
}

.gb-time-row .gb-fuzzy-time:focus {
    border-color: #8c0000;
    box-shadow: 0 0 0 2px rgba(140,0,0,0.08);
    outline: none;
}

.gb-time-row .gb-fuzzy-time::placeholder {
    color: #b0a191;
    font-size: 10px;
}




/* ============================================================
   Meta Box 模式：不继承全屏高度
   ============================================================ */
.guji-bianmu-meta-box .gb-main,
.gb-main-meta-box {
    height: auto !important;
    max-height: 700px;
    overflow: hidden;
}

.guji-bianmu-meta-box .gb-sidebar {
    width: 240px;
    min-width: 220px;
    max-width: 260px;
    max-height: 700px;
    overflow-y: auto;
    border-left: none;
    border-right: 1px solid var(--gb-border);
}

.guji-bianmu-meta-box .gb-content,
.guji-bianmu-meta-box .gb-content-full {
    max-height: 700px;
    overflow-y: auto;
    padding: 12px 16px;
}


/* ============================================================
   响应式：窄屏时左右分栏改上下布局
   ============================================================ */
@media (max-width: 900px) {
    .gb-main {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .gb-sidebar {
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        max-height: 400px;
        border-left: none;
        border-bottom: 1px solid var(--gb-border);
    }
    .gb-content {
        height: auto;
        max-height: none;
        overflow-y: visible;
    }
    .gb-form-group.col-2,
    .gb-form-group.col-3,
    .gb-form-group.col-4 {
        flex: 1 1 100%;
    }
}


