/* ==========================================================================
   Cnplants 设计系统
   自然色系 + 卡片网格 + 响应式；不依赖任何构建工具，直接由浏览器加载
   ========================================================================== */

:root {
    --brand:        #1f7a4d;
    --brand-dark:   #175f3c;
    --brand-light:  #e8f4ed;
    --accent:       #c9851f;
    --ink:          #16211c;
    --ink-2:        #46564e;
    --ink-3:        #7d8c85;
    --line:         #e4eae7;
    --line-soft:    #eef2f0;
    --bg:           #ffffff;
    --bg-soft:      #f7f9f8;
    --bg-soft-2:    #eef3f0;
    --danger:       #c0392b;
    --ok:           #1f7a4d;
    --radius:       14px;
    --radius-sm:    10px;
    --radius-lg:    20px;
    --shadow-sm:    0 1px 2px rgba(22, 33, 28, .06), 0 1px 3px rgba(22, 33, 28, .04);
    --shadow:       0 2px 8px rgba(22, 33, 28, .07), 0 8px 24px rgba(22, 33, 28, .05);
    --shadow-lg:    0 8px 30px rgba(22, 33, 28, .12);
    --maxw:         1280px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg-soft);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-dark); }

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

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
p  { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

.muted   { color: var(--ink-3); }
.small   { font-size: 13px; }
.center  { text-align: center; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

/* ---------- 布局 ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 1 auto; padding-bottom: 56px; }

/* ---------- 页头 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 60;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    background: linear-gradient(135deg, var(--brand) 0%, #35a06a 100%);
    display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 700;
}
.brand-sub { font-size: 12px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav a {
    padding: 7px 12px; border-radius: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
}
.nav a:hover { background: var(--bg-soft-2); color: var(--ink); }
.nav a.on { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-size: 14.5px; font-weight: 600; font-family: inherit; cursor: pointer;
    background: var(--bg-soft-2); color: var(--ink); transition: all .15s ease;
}
.btn:hover { background: var(--line); color: var(--ink); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink-3); background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a33024; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 区块 ---------- */
.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; }
.section-head .more { margin-left: auto; font-size: 13.5px; font-weight: 500; }

.hero {
    margin-top: 28px; padding: 38px 40px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f0f7f2 0%, #e6f2ea 55%, #e9f3ef 100%);
    border: 1px solid #dcebe2;
}
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero p  { color: var(--ink-2); font-size: 15px; margin-bottom: 0; max-width: 62ch; }

/* 统计条 */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; margin-top: 22px; }
.stat {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 12px; text-align: center; transition: all .18s ease;
}
.stat:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 21px; font-weight: 700; color: var(--brand-dark); letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--ink-3); }

/* ---------- 卡片网格 ---------- */
.grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}
.grid-taxa { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: all .2s ease; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: #d5e3da; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.045); }
.card-body { padding: 12px 14px 14px; }
.card-title { font-size: 14.5px; font-weight: 600; line-height: 1.45; margin-bottom: 3px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); }
.card-meta { font-size: 12.5px; color: var(--ink-3); }
.card-badge {
    position: absolute; left: 10px; top: 10px; z-index: 2;
    background: rgba(22, 33, 28, .74); color: #fff; font-size: 11.5px; font-weight: 600;
    padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px);
}

/* 分类单元卡（科/属） */
.taxa-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 14px; text-align: center; transition: all .2s ease;
}
.taxa-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.taxa-card .tc-name { font-size: 15px; font-weight: 650; color: var(--ink); }
.taxa-card .tc-la { font-size: 12.5px; color: var(--ink-3); font-style: italic; margin-top: 1px; }
.taxa-card .tc-count { margin-top: 8px; font-size: 12.5px; color: var(--brand-dark); font-weight: 600; }

/* ---------- 表单 ---------- */
.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: 14.5px; font-family: inherit; color: var(--ink); background: #fff; transition: border-color .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 122, 77, .12); }
textarea.input { min-height: 92px; resize: vertical; }
.field-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 提示 ---------- */
.flash { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.flash-item {
    padding: 11px 15px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    border: 1px solid transparent;
}
.flash-success { background: var(--brand-light); color: var(--brand-dark); border-color: #cfe6da; }
.flash-error   { background: #fdecea; color: #a33024; border-color: #f6d5d1; }
.flash-info    { background: #eef4fb; color: #2c5282; border-color: #d6e4f5; }

.empty {
    background: #fff; border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 44px 24px; text-align: center; color: var(--ink-3);
}
.empty h3 { font-size: 16px; color: var(--ink-2); margin-bottom: 6px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.page-btn {
    padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; color: var(--ink-2); font-size: 13.5px; font-weight: 500;
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-btn.disabled { opacity: .45; pointer-events: none; }
.page-info { margin-left: 8px; font-size: 13px; color: var(--ink-3); }

/* ---------- 照片详情 ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .95fr); gap: 26px; margin-top: 24px; align-items: start; }
.detail-media { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-media img { width: 100%; height: auto; background: var(--bg-soft-2); }
.detail-side { display: flex; flex-direction: column; gap: 16px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel h3 { font-size: 15.5px; margin-bottom: 12px; }
.panel + .panel { margin-top: 0; }

.kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-3); margin-top: 20px; }
.breadcrumb a { color: var(--ink-2); }
.breadcrumb .sep { color: var(--line); }

/* ---------- 照片详情：大图下方的工具条 / 徽章 / 鉴定 / 评论 ---------- */
.photo-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }

.latin { font-style: italic; color: var(--ink-3); }

.badge {
    display: inline-block; font-size: 11.5px; font-weight: 600; line-height: 1.6;
    padding: 0 8px; border-radius: 8px; background: var(--brand-light); color: var(--brand-dark);
}
.badge.gray     { background: var(--bg-soft-2); color: var(--ink-3); font-weight: 500; }
.badge.admin    { background: #fdecea; color: #a33024; }
.badge.verified { background: #e8f4ed; color: var(--brand-dark); }
.badge.wait     { background: #fdf3e3; color: #97650f; }

/* 鉴定历史 */
.rev-list { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.rev-title { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.rev-item { padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.rev-item:last-child { border-bottom: 0; }

/* 鉴定表单 */
.identify-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.identify-form .field { position: relative; }
.checkbox-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.ac-hits { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 13px; }
.ac-hit { color: var(--brand); }

/* 评论 */
.comments-box { margin-top: 20px; }
.comment-form { margin-top: 12px; }
.comment-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.comment-list { margin-top: 14px; }
.comment-item { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.comment-item:first-child { border-top: 0; }
.ci-body { min-width: 0; flex: 1 1 auto; }
.ci-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.ci-text { margin: 4px 0 0; font-size: 14px; white-space: pre-wrap; }
.avatar {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--brand-light); color: var(--brand-dark); font-weight: 700; font-size: 15px;
}
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.btn-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.btn-link:hover { color: var(--brand); }
.btn-link.danger:hover { color: var(--danger); }

/* 相关图片 */
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.rel-item { display: block; }
.rel-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-soft-2); }
.rel-item .rel-name { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 页脚 ---------- */
.footer { background: #16211c; color: #b8c7bf; padding: 38px 0 28px; margin-top: 60px; font-size: 13.5px; }
.footer a { color: #d9e5de; }
.footer a:hover { color: #fff; }
/* 首栏（站点名）宽一些，其余栏目数由后台配置决定，用 grid-auto 自适应 */
.footer-grid { display: grid; grid-template-columns: 1.4fr; grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 1fr); gap: 26px; }
.footer h4 { color: #fff; font-size: 14px; margin-bottom: 10px; font-weight: 600; }
.footer li { margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 26px; padding-top: 16px;
    display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: #8b9d94; }

/* ---------- 上传区 ---------- */
.dropzone {
    border: 2px dashed var(--line); border-radius: var(--radius); padding: 44px 24px;
    text-align: center; background: #fff; cursor: pointer; transition: all .18s ease;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-light); }
.dropzone .dz-icon { font-size: 34px; margin-bottom: 8px; }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; margin-top: 16px; }
.upload-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.upload-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.upload-item .ui-name { font-size: 11.5px; padding: 6px 8px; color: var(--ink-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .ui-del { position: absolute; right: 6px; top: 6px; background: rgba(0, 0, 0, .6); color: #fff;
    border: 0; border-radius: 999px; width: 24px; height: 24px; cursor: pointer; line-height: 1; }

/* 进度条 */
.progress { height: 6px; background: var(--bg-soft-2); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .25s ease; }

/* ---------- 表格（后台） ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.table th { background: var(--bg-soft); font-weight: 600; color: var(--ink-2); font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-soft); }

/* ---------- 物种详情（/species）：封面 + 七级阶元 ---------- */
.sp-hero { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 28px; align-items: start; }
.sp-hero > div { min-width: 0; }
.sp-cover { display: block; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; background: var(--bg-soft-2); }
.sp-cover img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    transition: transform .35s ease; }
a.sp-cover:hover img { transform: scale(1.03); }
.sp-name { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.sp-rank { width: 60px; }
.sp-desc { margin-top: 14px; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.ext-links { border-top: 1px dashed var(--line); padding-top: 12px; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--bg-soft-2); color: var(--ink-2); }
.tag-ok   { background: var(--brand-light); color: var(--brand-dark); }
.tag-wait { background: #fdf3e3; color: #97650f; }
.tag-bad  { background: #fdecea; color: #a33024; }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
    .sp-hero { grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 900px) {
    .detail { grid-template-columns: 1fr; }
    .sp-hero { grid-template-columns: 1fr; gap: 18px; }
    .footer-grid { grid-auto-flow: row; grid-template-columns: 1fr 1fr; grid-auto-columns: auto; }
}
@media (max-width: 680px) {
    .wrap { padding: 0 16px; }
    .topbar-inner { height: 56px; gap: 12px; }
    .nav { display: none; }
    .nav-mobile { display: flex; }
    .hero { padding: 26px 20px; }
    .hero h1 { font-size: 24px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .grid-taxa { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .footer-grid { grid-template-columns: 1fr; }
    .brand-sub { display: none; }
}

/* 移动端底部导航 */
.nav-mobile { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: #fff; border-top: 1px solid var(--line); }
.nav-mobile a { flex: 1 1 0; text-align: center; padding: 9px 4px; font-size: 12px; color: var(--ink-3); }
.nav-mobile a.on { color: var(--brand); font-weight: 600; }
.nav-mobile span { display: block; font-size: 17px; line-height: 1.3; }
@media (max-width: 680px) { body { padding-bottom: 56px; } }

/* ---------- 分类树（/tree）：左树懒加载 + 右侧影像预览 ---------- */
.tree-layout {
    display: grid;
    grid-template-columns: 304px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
/* grid 子项默认 min-width:auto，长名字会把整列撑破 → 一律归零 */
.tree-pane, .tree-panel { min-width: 0; }
.tree-pane {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    position: sticky;
    top: 74px;          /* 页头 sticky 高度 62px + 12px 呼吸 */
}
.tree-toolbar { padding: 8px; border-bottom: 1px solid var(--line); position: relative; }
.tree-toolbar input {
    width: 100%; padding: 6px 9px; font-size: 12px;
    border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink);
}
.tree-toolbar input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.tree-suggest {
    position: absolute; left: 8px; right: 8px; top: calc(100% - 4px);
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    box-shadow: var(--shadow); z-index: 40; max-height: 320px; overflow: auto;
}
.tree-sug {
    display: block; width: 100%; text-align: left; padding: 6px 9px;
    border: 0; border-bottom: 1px solid var(--line-soft); background: none; cursor: pointer;
    font: inherit; color: inherit;
}
.tree-sug:last-child { border-bottom: 0; }
.tree-sug:hover { background: var(--brand-light); }
.tree-sug b { display: block; font-size: 12px; color: var(--ink); font-weight: 600; }
.tree-sug i { display: block; font-size: 10px; color: var(--ink-3); font-style: italic; }
.tree-sug em { display: block; font-size: 10px; color: var(--ink-3); font-style: normal; }
.tree-sug-empty { padding: 9px; font-size: 12px; }

.tree-scroll { max-height: 68vh; min-height: 280px; overflow: auto; padding: 4px 4px 8px; }
.tree-foot { padding: 7px 9px; border-top: 1px solid var(--line); background: var(--bg-soft-2); font-size: 11px; }

.tree-node > .tree-row {
    display: flex; align-items: center; gap: 4px;
    padding: 1px 4px 1px 3px; border-radius: 5px; cursor: pointer;
}
.tree-node > .tree-row:hover { background: var(--brand-light); }
.tree-node > .tree-row.active { background: var(--brand-light); box-shadow: inset 0 0 0 1px var(--brand); }

/* + / − 展开按钮：小方框，等宽字体保证两个符号居中对齐 */
.tree-toggle {
    flex: 0 0 16px; width: 16px; height: 16px; padding: 0; margin: 0;
    border: 1px solid #b9cfbd; border-radius: 3px;
    background: var(--bg-soft-2); color: var(--brand-dark); cursor: pointer;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 13px; font-weight: 700; line-height: 14px; text-align: center;
    user-select: none;
}
.tree-toggle:hover { border-color: var(--brand); background: var(--brand-light); }
.tree-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tree-toggle.ghost { border-color: transparent; background: none; color: transparent; cursor: default; pointer-events: none; }
/* 已展开的节点：按钮底色点亮，配合 − 号一眼看出状态 */
.tree-node.open > .tree-row > .tree-toggle {
    background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark);
}

.tree-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.tree-name .cn {
    font-size: 12px; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tree-name .la {
    font-size: 10px; color: var(--ink-3); font-style: italic;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tree-badge {
    flex: 0 0 auto; font-size: 10px; line-height: 1.45;
    padding: 0 5px; border-radius: 8px;
    background: var(--brand-light); color: var(--brand-dark); font-weight: 600;
}
/* 层级缩进：每级 18px，配虚线导引线 */
.tree-kids { margin-left: 10px; padding-left: 8px; border-left: 1px dotted var(--line); }
.tree-tip { padding: 3px 6px; margin: 0; font-size: 11px; }
.tree-retry { margin: 4px 8px; }

.tree-panel { min-width: 0; }
.tree-panel-head { margin-bottom: 14px; }
.tree-panel-head h2 { margin-bottom: 4px; font-size: 20px; }
.tree-panel-head .latin { font-size: 14px; color: var(--ink-3); font-style: italic; font-weight: 400; }
.tree-panel-head .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.tree-rank {
    display: inline-block; vertical-align: middle; font-size: 11px; font-weight: 600;
    padding: 1px 7px; border-radius: 8px; background: var(--bg-soft-2); color: var(--ink-3);
}

@media (max-width: 1000px) {
    .tree-layout { grid-template-columns: 264px minmax(0, 1fr); gap: 12px; }
    .tree-pane { top: 68px; }
    .tree-foot { font-size: 10px; }
}
@media (max-width: 760px) {
    .tree-layout { grid-template-columns: minmax(0, 1fr); }
    .tree-pane { position: static; }
    .tree-scroll { max-height: 44vh; min-height: 0; }
}
@media (max-width: 480px) {
    .tree-scroll { max-height: 52vh; }
    .tree-node > .tree-row { padding: 3px 4px 3px 3px; }   /* 触控更容易点中 */
    .tree-toggle { flex: 0 0 20px; width: 20px; height: 20px; font-size: 14px; line-height: 18px; }
}

/* ---------- 后台「站点设置」 ---------- */
.set-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.set-tab {
    padding: 9px 15px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.set-tab:hover { color: var(--ink); }
.set-tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.set-pane { display: none; }
.set-pane.on { display: block; }

.set-table td { padding: 6px 10px; }
.set-table .input { padding: 7px 10px; font-size: 13.5px; }
.set-act { white-space: nowrap; }
.set-btn {
    width: 26px; height: 26px; margin-right: 4px; border: 1px solid var(--line); background: #fff;
    border-radius: 6px; color: var(--ink-3); font-size: 13px; line-height: 1; cursor: pointer;
}
.set-btn:hover { border-color: var(--brand); color: var(--brand); }
.set-btn-del:hover { border-color: #c0392b; color: #c0392b; }
.set-col {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 14px; margin-bottom: 12px; background: var(--bg-soft);
}
