/* 寻根页：大厅 / 发布 / 我的寻根 / 审核管理 */

.xg-main {
    flex: 1 1 auto;
    width: 100%;
    background: linear-gradient(180deg, #FBF6EA 0%, #F7F4EE 100%);
}

.xg-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 4% 72px;
    box-sizing: border-box;
}

/* 顶部横幅 + 登录入口 */
.xg-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 200px;
    background-color: #C9B48A;
    background-image:
        linear-gradient(90deg, rgba(255, 248, 232, 0.82) 0%, rgba(255, 248, 232, 0.42) 36%, rgba(255, 248, 232, 0.08) 58%, rgba(255, 248, 232, 0) 72%),
        url('https://cdn.zongyuanjiapu.com/page/xungentitle.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 16px;
    padding: 30px 40px;
    margin-bottom: 26px;
    color: #2C1810;
    box-shadow: 0 10px 24px rgba(90, 54, 20, 0.12);
}

.xg-hero-text {
    max-width: 34em;
    padding: 8px 18px 10px 14px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(255, 248, 232, 0.78) 0%, rgba(255, 248, 232, 0.42) 70%, rgba(255, 248, 232, 0) 100%);
}

.xg-hero-text h1 {
    margin: 0 0 8px;
    font-size: 30px;
    letter-spacing: 6px;
    font-weight: 800;
    color: #2C1810;
    text-shadow: 0 1px 0 rgba(255, 248, 232, 0.9);
}

.xg-hero-text p {
    margin: 0;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 600;
    color: #2C1810;
    text-shadow: 0 1px 0 rgba(255, 248, 232, 0.9);
}

@media (max-width: 640px) {
    .xg-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }

    .xg-hero-text h1 {
        font-size: 24px;
        letter-spacing: 4px;
    }
}

/* 标签 */
.xg-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.xg-tabs button,
.xg-admin-subtabs button {
    position: relative;
    padding: 10px 30px;
    border-radius: 999px;
    border: 1px solid #E8DCC8;
    background: #fff;
    color: #8B0000;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(90, 54, 20, 0.05);
}

.xg-tabs button.is-active,
.xg-admin-subtabs button.is-active {
    background: #8B0000;
    color: #FFF6E0;
    border-color: #8B0000;
}

.xg-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #C49A3A;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* ---------- 大厅 ---------- */
.xg-hall-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 26px;
}

.xg-hall-bar input {
    width: 320px;
    max-width: 60vw;
    padding: 11px 18px;
    border: 1px solid #E8DCC8;
    border-radius: 999px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.xg-hall-bar input:focus {
    border-color: #8B0000;
}

.xg-hall-bar button {
    padding: 11px 30px;
    border: none;
    border-radius: 999px;
    background: #8B0000;
    color: #FFF6E0;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.xg-hall-bar button:hover {
    background: #6E0000;
}

.xg-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.xg-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(90, 54, 20, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.xg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(139, 0, 0, 0.14);
}

.xg-card-cover {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;
    background: #F7F3EA;
}

.xg-card-cover-default {
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #8B0000 0%, #6E0000 100%);
    color: #F3D9A4;
}

.xg-card-cover-default .def-char {
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.1em;
}

.xg-card-cover-default .def-label {
    font-size: 12px;
    letter-spacing: 0.3em;
    opacity: 0.8;
}

.xg-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
}

.xg-card-title {
    font-size: 19px;
    font-weight: 800;
    color: #8B0000;
}

.xg-card-meta {
    font-size: 13px;
    color: #6B6055;
    line-height: 1.8;
}

.xg-card-meta b {
    color: #3F3A33;
    font-weight: 700;
}

.xg-card-desc {
    font-size: 13px;
    color: #8A8073;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.xg-card-foot {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.xg-card-clues {
    font-size: 12px;
    color: #8A8073;
}

.xg-clue-btn {
    padding: 8px 20px;
    border: 1px solid #8B0000;
    border-radius: 999px;
    background: #fff;
    color: #8B0000;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.xg-clue-btn:hover {
    background: #8B0000;
    color: #FFF6E0;
}

.xg-empty {
    text-align: center;
    padding: 60px 0;
    color: #8A8073;
    font-size: 14px;
    grid-column: 1 / -1;
}

/* 分页 */
.xg-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 26px;
    font-size: 14px;
    color: #6B6055;
}

.xg-pager button {
    padding: 7px 20px;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    background: #fff;
    color: #8B0000;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.xg-pager button:disabled {
    color: #B8AFA0;
    cursor: default;
}

.xg-pager button:not(:disabled):hover {
    border-color: #8B0000;
}

/* ---------- 表单 ---------- */
.xg-form-card {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    padding: 34px 40px 38px;
    box-shadow: 0 8px 28px rgba(90, 54, 20, 0.08);
}

.xg-form-title {
    margin: 0 0 6px;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: #8B0000;
    letter-spacing: 0.05em;
}

.xg-form-tip {
    margin: 0 0 24px;
    text-align: center;
    font-size: 13px;
    color: #8A8073;
}

.xg-form-tip b {
    color: #B03A2E;
}

.xg-field {
    margin-bottom: 16px;
}

.xg-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #3F3A33;
}

.xg-field label b {
    color: #B03A2E;
}

.xg-field input[type="text"],
.xg-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #FFFDF8;
}

.xg-field input[type="text"]:focus,
.xg-field textarea:focus {
    border-color: #8B0000;
}

.xg-field input[type="file"] {
    font-size: 13px;
    color: #6B6055;
}

.xg-img-preview {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.xg-img-preview img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #E8DCC8;
}

.xg-form-error {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #FDECEA;
    color: #B03A2E;
    font-size: 13px;
}

/* ---------- 免责协议 ---------- */
.xg-agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 16px;
    font-size: 13px;
    color: #6B6055;
    line-height: 1.7;
    cursor: pointer;
}

.xg-agree input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #8B0000;
    flex: none;
    cursor: pointer;
}

.xg-agree-link {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: #8B0000;
    font-weight: 700;
    cursor: pointer;
}

.xg-agree-link:hover { text-decoration: underline; }

.xg-agree-mask {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: rgba(40, 26, 16, 0.55);
}

.xg-agree-mask[hidden] { display: none; }

.xg-agree-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 760px;
    max-height: 100%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(40, 26, 16, 0.32);
    overflow: hidden;
}

.xg-agree-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: #8B0000;
    color: #FFF6E0;
}

.xg-agree-head h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.xg-agree-close {
    border: none;
    background: none;
    color: #FFF6E0;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

.xg-agree-close:hover { opacity: 1; }

.xg-agree-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 22px 28px 26px;
    font-size: 14px;
    color: #4A4238;
    line-height: 1.95;
}

.xg-agree-body h3 {
    margin: 22px 0 8px;
    font-size: 15px;
    font-weight: 800;
    color: #8B0000;
}

.xg-agree-body p { margin: 0 0 8px; }
.xg-agree-body b { color: #3F3A33; }

.xg-agree-intro {
    padding: 14px 16px;
    background: #FBF6EA;
    border-left: 3px solid #8B0000;
    border-radius: 0 8px 8px 0;
}

.xg-agree-sub {
    padding-left: 14px;
    color: #6B6055;
}

.xg-agree-note {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed #E0D6C4;
    color: #8A8073;
    font-size: 13px;
}

.xg-agree-foot {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid #EFE7D8;
    background: #FDFBF6;
}

.xg-agree-foot button {
    padding: 9px 26px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.xg-agree-cancel {
    border: 1px solid #D8CDBA;
    background: #fff;
    color: #6B6055;
}

.xg-agree-cancel:hover { border-color: #8B0000; color: #8B0000; }

.xg-agree-ok {
    border: none;
    background: #8B0000;
    color: #FFF6E0;
}

.xg-agree-ok:hover { background: #6E0000; }

@media (max-width: 640px) {
    .xg-agree-body { padding: 18px 18px 22px; }
}

.xg-submit {
    display: block;
    width: 100%;
    padding: 13px 0;
    border: none;
    border-radius: 10px;
    background: #8B0000;
    color: #FFF6E0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: background 0.2s;
}

.xg-submit:hover {
    background: #6E0000;
}

.xg-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------- 上图家谱开放数据 ---------- */
#xgShlib {
    padding-bottom: min(55vh, 520px);
}

.xg-shlib-head {
    text-align: center;
    margin: 0 0 22px;
}

.xg-shlib-head h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 800;
    color: #8B0000;
    letter-spacing: 0.06em;
}

.xg-shlib-head p {
    margin: 0 auto;
    max-width: 720px;
    font-size: 13px;
    line-height: 1.7;
    color: #8A8073;
}

.xg-shlib-cats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px;
    position: sticky;
    top: 64px;
    z-index: 20;
    padding: 10px 0;
    background: #FBF6EA;
}

.xg-shlib-cats button {
    border: 1px solid #E8DFD2;
    background: #fff;
    color: #5C5348;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}

.xg-shlib-cats button:hover {
    border-color: #C4A574;
    color: #8B0000;
}

.xg-shlib-cats button.is-active {
    background: #8B0000;
    border-color: #8B0000;
    color: #fff;
}

.xg-shlib-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
    scroll-margin-top: 140px;
}

.xg-shlib-panel {
    background: #fff;
    border-radius: 14px;
    padding: 0 24px 24px;
    box-shadow: 0 8px 28px rgba(90, 54, 20, 0.08);
    min-width: 0;
    overflow: hidden;
}

.xg-shlib-panel-head {
    margin: 0 -24px 18px;
    padding: 16px 24px 14px;
    background: #F3E6D0;
    border-bottom: 1px solid #E4D2B4;
}

.xg-shlib-panel-head .xg-shlib-hint {
    margin-bottom: 0;
}

.xg-shlib-panel-wide {
    grid-column: 1 / -1;
}

.xg-shlib-panel h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    color: #8B0000;
}

.xg-shlib-bundle .xg-shlib-sub {
    padding: 18px 0 2px;
    border-top: 1px solid #EFE6D8;
}

.xg-shlib-bundle .xg-shlib-panel-head + .xg-shlib-sub {
    border-top: none;
    padding-top: 4px;
}

.xg-shlib-bundle h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
    color: #5C3A28;
}

.xg-shlib-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 22px;
    padding: 18px 0 2px;
    border-top: 1px solid #EFE6D8;
}

.xg-shlib-subgrid .xg-shlib-sub {
    padding: 0;
    border-top: none;
}

.xg-shlib-hint {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.6;
    color: #8A8073;
}

.xg-shlib-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.xg-shlib-row input,
.xg-shlib-row select {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #FFFDF8;
}

.xg-shlib-row input:focus,
.xg-shlib-row select:focus {
    border-color: #8B0000;
}

.xg-shlib-row button {
    flex: 0 0 auto;
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    background: #8B0000;
    color: #FFF6E0;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.xg-shlib-row button:hover {
    background: #6E0000;
}

.xg-shlib-row button:disabled {
    opacity: 0.6;
    cursor: default;
}

.xg-shlib-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    margin-bottom: 12px;
}

.xg-shlib-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #3F3A33;
}

.xg-shlib-fields input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    font-family: inherit;
    outline: none;
    background: #FFFDF8;
}

.xg-shlib-fields input:focus {
    border-color: #8B0000;
}

.xg-shlib-result {
    margin-top: 12px;
}

.xg-shlib-result-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.xg-shlib-result-bar .xg-shlib-badge {
    margin-right: auto;
}

.xg-shlib-result-clear,
.xg-shlib-result-fold {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #E8DCC8;
    border-radius: 50%;
    background: #fff;
    color: #8A8073;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.xg-shlib-result-clear:hover,
.xg-shlib-result-fold:hover {
    border-color: #8B0000;
    color: #8B0000;
    background: #FFF6E0;
}

.xg-shlib-result.is-collapsed .xg-shlib-result-body {
    display: none;
}

.xg-shlib-more {
    display: block;
    width: auto;
    margin: 16px auto 4px;
    padding: 8px 22px;
    border: 1px solid #C4A574;
    border-radius: 999px;
    background: #F3E6D0;
    color: #8B0000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.xg-shlib-more:hover:not(:disabled) {
    border-color: #8B0000;
    background: #FFF6E0;
}

.xg-shlib-more:disabled {
    opacity: 0.7;
    cursor: wait;
}

.xg-shlib-status,
.xg-shlib-fail,
.xg-shlib-meta,
.xg-shlib-uri {
    margin: 8px 0 0;
    font-size: 13px;
    color: #6B6055;
    word-break: break-all;
}

.xg-shlib-status {
    color: #1D6FD8;
}

.xg-shlib-fail {
    color: #B03A2E;
}

.xg-shlib-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.xg-shlib-badge.is-live {
    background: #E8F6EC;
    color: #1B7A3A;
}

.xg-shlib-badge.is-empty {
    background: #F4EFE6;
    color: #8A8073;
}

.xg-shlib-answer {
    position: relative;
    margin-top: 14px;
    padding: 16px 48px 16px 18px;
    border-radius: 12px;
    background: #FFF8EC;
    border: 1px solid #E8DCC8;
}

.xg-shlib-answer .xg-shlib-result-fold {
    position: absolute;
    top: 12px;
    right: 12px;
}

.xg-shlib-q {
    font-size: 13px;
    color: #8A8073;
    margin-bottom: 6px;
}

.xg-shlib-a {
    font-size: 22px;
    font-weight: 800;
    color: #8B0000;
    letter-spacing: 0.04em;
}

.xg-shlib-name-link {
    border: none;
    padding: 0;
    background: none;
    color: #8B0000;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    text-align: left;
}

.xg-shlib-name-link:hover {
    color: #6E0000;
}

.xg-shlib-view {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #8B0000;
    border-radius: 999px;
    background: #fff;
    color: #8B0000;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.xg-shlib-view:hover {
    background: #8B0000;
    color: #FFF6E0;
}

.xg-shlib-view.is-locked {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.xg-shlib-modal {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 16px 28px;
    box-sizing: border-box;
}

.xg-shlib-modal[hidden] {
    display: none;
}

.xg-shlib-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(40, 24, 10, 0.48);
}

.xg-shlib-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    padding: 20px 24px 8px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(40, 20, 8, 0.28);
    box-sizing: border-box;
}

.xg-shlib-modal-body {
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 20px;
}

.xg-shlib-modal-body .xg-shlib-pdf-frame {
    height: min(56vh, 520px);
}

.xg-shlib-modal.is-full {
    padding: 0;
    align-items: stretch;
}

.xg-shlib-modal.is-full .xg-shlib-modal-mask {
    display: none;
}

.xg-shlib-modal.is-full .xg-shlib-modal-dialog {
    width: 100%;
    max-height: none;
    height: 100%;
    border-radius: 0;
    padding: 16px 24px 8px;
    box-shadow: none;
}

.xg-shlib-modal.is-full .xg-shlib-modal-body {
    flex: 1 1 auto;
}

.xg-shlib-modal.is-full .xg-shlib-pdf-frame {
    height: calc(100vh - 200px);
}

@media (max-width: 640px) {
    .xg-shlib-modal {
        padding: 64px 10px 16px;
    }

    .xg-shlib-modal-dialog {
        padding: 16px 16px 6px;
        max-height: calc(100vh - 80px);
    }
}

.xg-shlib-browse-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex: 0 0 auto;
}

.xg-shlib-browse-bar h2 {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 22px;
    color: #8B0000;
}

.xg-shlib-browse-bar button {
    flex: 0 0 auto;
    padding: 6px 14px;
    border: 1px solid #D8CDBA;
    border-radius: 999px;
    background: #fff;
    color: #6B6055;
    cursor: pointer;
}

.xg-shlib-browse-bar button:hover {
    border-color: #8B0000;
    color: #8B0000;
}

.xg-shlib-modal-full {
    margin-left: auto;
}

.xg-shlib-modal-close {
    border-color: #8B0000;
    color: #8B0000;
}

.xg-shlib-modal-close:hover {
    background: #8B0000;
    color: #FFF6E0;
}

.xg-shlib-related {
    margin-top: 22px;
}

.xg-shlib-related h3 {
    margin: 16px 0 8px;
    font-size: 15px;
    color: #6B6055;
}

.xg-shlib-related ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.xg-shlib-pdf {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed #E0D6C4;
}

.xg-shlib-pdf-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.xg-shlib-pdf-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.xg-shlib-pdf-nav button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid #3F3A33;
    border-radius: 4px;
    background: #fff;
    color: #3F3A33;
    cursor: pointer;
}

.xg-shlib-pdf-nav button.is-locked {
    border-color: #8B0000;
    color: #8B0000;
}

.xg-shlib-pdf-nav button.is-locked:hover {
    background: #8B0000;
    color: #FFF6E0;
}

.xg-shlib-nav-lock {
    display: inline-flex;
    line-height: 0;
}

.xg-shlib-pdf-meta {
    color: #8A8073;
    font-size: 13px;
}

.xg-shlib-pdf-stage {
    position: relative;
    margin-top: 12px;
}

.xg-shlib-pdf-frame {
    width: 100%;
    height: 70vh;
    margin-top: 0;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    background: #F7F3EA;
}

.xg-shlib-pdf-progress {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #F7F3EA;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
}

.xg-shlib-pdf-progress[hidden] {
    display: none;
}

.xg-shlib-pdf-progress p {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #6B6055;
}

.xg-shlib-pdf-progress-track {
    width: min(360px, 72%);
    height: 8px;
    overflow: hidden;
    background: #E8DCC8;
    border-radius: 999px;
}

.xg-shlib-pdf-progress-bar {
    height: 100%;
    width: 24%;
    background: #8B0000;
    border-radius: 999px;
    transition: width 0.2s ease;
}

.xg-shlib-pdf-progress-bar.is-indeterminate {
    width: 34%;
    animation: xg-pdf-indeterminate 1.15s ease-in-out infinite;
}

.xg-shlib-pdf-progress-pct {
    min-height: 1em;
    font-size: 12px;
    color: #8A8073;
}

@keyframes xg-pdf-indeterminate {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(320%); }
}

.xg-shlib-unlock-hint {
    margin: 10px 0 0;
    font-size: 13px;
    color: #8A8073;
}

.xg-shlib-unlock {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #E8DCC8;
    border-radius: 10px;
    background: #FFF8EC;
    color: #6B6055;
}

.xg-shlib-unlock p {
    margin: 0 0 10px;
}

.xg-shlib-unlock a {
    text-decoration: none;
}

button.xg-shlib-a.xg-shlib-name-link {
    display: inline;
}

.xg-shlib-detail-dialog {
    max-width: 640px;
}

.xg-shlib-dl {
    margin: 0;
}

.xg-shlib-dl-inline {
    padding: 12px 14px 4px;
    border: 1px solid #EFE6D8;
    border-radius: 10px;
    background: #FFFDF8;
}

.xg-shlib-dl dt {
    margin-top: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #8A8073;
}

.xg-shlib-dl dt:first-child {
    margin-top: 0;
}

.xg-shlib-dl dd {
    margin: 4px 0 0;
    color: #3F3A33;
    line-height: 1.7;
    word-break: break-word;
}

.xg-shlib-dl dd.is-locked {
    color: #8A8073;
}

.xg-shlib-dl dd.xg-shlib-longtext {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.85;
}

.xg-shlib-lock {
    display: inline-flex;
    align-items: center;
    color: #8B0000;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed #8B0000;
}

.xg-shlib-lock:hover {
    color: #6E0000;
    border-bottom-color: #6E0000;
}

.xg-shlib-uri-link {
    border: none;
    padding: 0;
    background: none;
    color: #8B0000;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    word-break: break-all;
    text-align: left;
}

.xg-shlib-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.xg-shlib-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.xg-shlib-table th,
.xg-shlib-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #EFE6D6;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.xg-shlib-table th {
    background: #F7F3EA;
    color: #6B6055;
    font-weight: 700;
}

.xg-shlib-raw {
    margin-top: 10px;
}

.xg-shlib-raw summary {
    cursor: pointer;
    color: #8A8073;
    font-size: 12px;
}

.xg-shlib-json {
    margin: 10px 0 0;
    padding: 12px 14px;
    border-radius: 8px;
    background: #2B241C;
    color: #F3E6C8;
    font-size: 12px;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

@media (max-width: 860px) {
    .xg-shlib-grid,
    .xg-shlib-fields,
    .xg-shlib-subgrid {
        grid-template-columns: 1fr;
    }

    .xg-shlib-subgrid .xg-shlib-sub + .xg-shlib-sub {
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #EFE6D8;
    }

    .xg-shlib-row {
        flex-direction: column;
    }
}

/* ---------- 我的寻根 ---------- */
.xg-mine-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 860px;
    margin: 0 auto;
}

.xg-mine-item {
    background: #fff;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 4px 16px rgba(90, 54, 20, 0.06);
}

.xg-mine-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.xg-mine-imgs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.xg-mine-imgs img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #E8DCC8;
    cursor: zoom-in;
}

.xg-mine-title {
    font-size: 17px;
    font-weight: 800;
    color: #3F3A33;
}

button.xg-mine-title {
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s;
}

button.xg-mine-title:hover {
    color: #8B0000;
    text-decoration: underline;
}

.xg-status {
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.xg-status.is-pending { background: #FFF4DC; color: #A87900; }
.xg-status.is-approved { background: #E5F4EC; color: #1F7A4D; }
.xg-status.is-rejected { background: #FDECEA; color: #B03A2E; }
.xg-status.is-offline { background: #EFEFEF; color: #8A8073; }

.xg-mine-opinion {
    margin-top: 10px;
    padding: 10px 14px;
    border-left: 3px solid #B03A2E;
    background: #FDF6F5;
    font-size: 13px;
    color: #6B6055;
    line-height: 1.8;
}

.xg-mine-opinion b {
    color: #B03A2E;
}

.xg-mine-desc {
    margin-top: 8px;
    font-size: 13px;
    color: #6B6055;
    line-height: 1.8;
}

.xg-mine-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.xg-mine-sub {
    max-width: 860px;
    margin: 34px auto 16px;
    font-size: 18px;
    font-weight: 800;
    color: #3F3A33;
    padding-left: 12px;
    border-left: 4px solid #8B0000;
}

.xg-mine-time {
    margin-left: auto;
    font-size: 12px;
    color: #A89E90;
}

.xg-mine-actions button {
    padding: 7px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.xg-act-edit {
    border: 1px solid #8B0000;
    background: #fff;
    color: #8B0000;
}

.xg-act-edit:hover {
    background: #8B0000;
    color: #FFF6E0;
}

.xg-mine-actions .xg-act-detail {
    border: none;
    background: #8B0000;
    color: #FFF6E0;
}

.xg-mine-actions .xg-act-detail:hover { background: #6D0000; }

.xg-mine-actions .xg-act-view {
    border: 1px solid #D8CDBA;
    background: #fff;
    color: #6B6055;
}

.xg-mine-actions .xg-act-view:hover {
    border-color: #8B0000;
    color: #8B0000;
}

.xg-act-offline {
    border: 1px solid #B8AFA0;
    background: #fff;
    color: #8A8073;
}

.xg-act-offline:hover {
    border-color: #6B6055;
    color: #3F3A33;
}

/* ---------- 审核管理 ---------- */
.xg-admin-subtabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.xg-admin-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.xg-admin-filter select {
    padding: 8px 16px;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #3F3A33;
    outline: none;
}

.xg-admin-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 920px;
    margin: 0 auto;
}

.xg-review-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 4px 16px rgba(90, 54, 20, 0.06);
}

.xg-review-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.xg-review-title {
    font-size: 17px;
    font-weight: 800;
    color: #3F3A33;
}

.xg-review-contact {
    font-size: 13px;
    font-weight: 700;
    color: #B03A2E;
    background: #FDF6F5;
    padding: 4px 12px;
    border-radius: 6px;
}

.xg-review-meta {
    font-size: 13px;
    color: #6B6055;
    line-height: 2;
}

.xg-review-meta b {
    color: #3F3A33;
}

.xg-review-desc {
    margin-top: 8px;
    padding: 12px 14px;
    background: #FBF6EA;
    border-radius: 8px;
    font-size: 13px;
    color: #3F3A33;
    line-height: 1.9;
    white-space: pre-wrap;
}

.xg-review-imgs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.xg-review-imgs img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    background: #F7F3EA;
    border-radius: 8px;
    border: 1px solid #E8DCC8;
    cursor: zoom-in;
}

.xg-review-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.xg-review-actions input {
    flex: 1 1 260px;
    min-width: 0;
    padding: 9px 14px;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.xg-review-actions input:focus {
    border-color: #8B0000;
}

.xg-btn-approve {
    padding: 9px 26px;
    border: none;
    border-radius: 8px;
    background: #1F7A4D;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.xg-btn-approve:hover { background: #17603C; }

.xg-btn-reject {
    padding: 9px 26px;
    border: none;
    border-radius: 8px;
    background: #B03A2E;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.xg-btn-reject:hover { background: #8E2F24; }

/* ---------- 详情 ---------- */
.xg-detail {
    max-width: 860px;
    margin: 0 auto;
}

.xg-detail-back {
    display: inline-block;
    margin-bottom: 18px;
    color: #8B0000;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.xg-detail-back:hover {
    text-decoration: underline;
}

.xg-detail-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(90, 54, 20, 0.08);
}

.xg-detail-gallery {
    padding: 20px 24px 0;
}

.xg-gallery-main {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 360px;
    background: #F7F3EA;
    border: 1px solid #E8DCC8;
    border-radius: 12px;
    overflow: hidden;
}

.xg-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.xg-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.xg-gallery-thumb {
    width: 92px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    background: #F7F3EA;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.xg-gallery-thumb:hover { transform: translateY(-2px); }
.xg-gallery-thumb.is-active { border-color: #8B0000; }

.xg-detail-body {
    padding: 22px 28px 28px;
}

.xg-detail-title {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 900;
    color: #8B0000;
}

.xg-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 24px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #6B6055;
}

.xg-detail-meta b {
    color: #3F3A33;
}

.xg-detail-desc {
    font-size: 14px;
    line-height: 2;
    color: #3F3A33;
    white-space: pre-wrap;
    padding-top: 14px;
    border-top: 1px dashed #E8DCC8;
}

/* 线索区 */
.xg-clues {
    margin-top: 26px;
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 8px 28px rgba(90, 54, 20, 0.08);
}

.xg-clues h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 800;
    color: #8B0000;
}

.xg-clue-item {
    padding: 12px 0;
    border-bottom: 1px solid #F0E8D8;
}

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

.xg-clue-item .c-head {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #8A8073;
    margin-bottom: 6px;
}

.xg-clue-item .c-author {
    font-weight: 700;
    color: #8B0000;
}

.xg-clue-item .c-content {
    font-size: 14px;
    line-height: 1.9;
    color: #3F3A33;
    white-space: pre-wrap;
}

.xg-clue-form {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed #E8DCC8;
}

.xg-clue-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid #E8DCC8;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #FFFDF8;
    resize: vertical;
}

.xg-clue-form textarea:focus {
    border-color: #8B0000;
}

.xg-clue-form .c-tip {
    margin: 8px 0 10px;
    font-size: 12px;
    color: #8A8073;
    line-height: 1.8;
}

.xg-clue-form button {
    padding: 10px 32px;
    border: none;
    border-radius: 999px;
    background: #8B0000;
    color: #FFF6E0;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.xg-clue-form button:hover {
    background: #6E0000;
}

.xg-clue-form button:disabled {
    opacity: 0.6;
    cursor: default;
}

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

@media (max-width: 640px) {
    .xg-cards { grid-template-columns: 1fr; }
    .xg-detail-meta { grid-template-columns: 1fr; }
    .xg-form-card { padding: 26px 20px 30px; }
}
