/* AI 文艺复兴 —— 全站样式，主题由 html[data-theme] 控制（6 套），明暗基调由 html[data-theme-mode] 区分 */

:root,
html[data-theme="light"] {
  --bg: #f6f3ec;
  --bg-soft: #fffdf8;
  --panel: #ffffff;
  --panel-border: #e3ddd0;
  --text: #23201b;
  --text-soft: #6b6459;
  --muted: #97907f;
  --accent: #8c4a2f;
  --accent-soft: #f0e2d8;
  --link: #1f5c8b;
  --danger: #a33232;
  --shadow: 0 1px 3px rgba(35, 32, 27, 0.08);
  --code-bg: #f2efe8;
  /* 语义色（明色基调） */
  --c-site: #2e8b57;
  --c-md: #8c4a2f;
  --c-image: #9b59b6;
  --c-external: #a08b46;
  --c-success: #2e8b57;
}

/* 暗色基调主题：语义色统一提亮，保证在深色底上的可读性 */
html[data-theme-mode="dark"] {
  --c-site: #6fd39c;
  --c-md: #e6a982;
  --c-image: #c99ee0;
  --c-external: #d7c58a;
  --c-success: #6fd39c;
}

html[data-theme="dark"] {
  --bg: #16151a;
  --bg-soft: #1d1c22;
  --panel: #232229;
  --panel-border: #35333d;
  --text: #ecebe6;
  --text-soft: #b6b2a8;
  --muted: #8a857b;
  --accent: #d9925f;
  --accent-soft: #3a2c22;
  --link: #7db8e6;
  --danger: #e47b7b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --code-bg: #1a1920;
}

/* 羊皮纸：复古暖棕（明色基调） */
html[data-theme="sepia"] {
  --bg: #ece0c8;
  --bg-soft: #f3e9d5;
  --panel: #f7eeda;
  --panel-border: #d8c39a;
  --text: #3a2c17;
  --text-soft: #6b5636;
  --muted: #94805c;
  --accent: #9c5b1e;
  --accent-soft: #e4d0a8;
  --link: #9a6a24;
  --danger: #9c3a2a;
  --shadow: 0 1px 3px rgba(58, 44, 23, 0.12);
  --code-bg: #e7d9bd;
}

/* 海洋：沉静深蓝（暗色基调） */
html[data-theme="ocean"] {
  --bg: #0c1b2a;
  --bg-soft: #102436;
  --panel: #14293d;
  --panel-border: #234156;
  --text: #e2eef5;
  --text-soft: #a8c2d4;
  --muted: #7f9bb0;
  --accent: #3fa9c9;
  --accent-soft: #163a4a;
  --link: #79c8f0;
  --danger: #f08a8a;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --code-bg: #0e2130;
}

/* 森林：护眼墨绿（暗色基调） */
html[data-theme="forest"] {
  --bg: #0f1a12;
  --bg-soft: #14221a;
  --panel: #18281f;
  --panel-border: #294033;
  --text: #e6f0e6;
  --text-soft: #b0c7b3;
  --muted: #86a189;
  --accent: #4caf72;
  --accent-soft: #1c3527;
  --link: #86d3a6;
  --danger: #ef8a8a;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --code-bg: #12241b;
}

/* 暮光：雅致暗紫（暗色基调） */
html[data-theme="violet"] {
  --bg: #17131f;
  --bg-soft: #1d1828;
  --panel: #241d31;
  --panel-border: #3a2f4d;
  --text: #ece7f3;
  --text-soft: #c0b4d4;
  --muted: #9a8fae;
  --accent: #b07fe0;
  --accent-soft: #322846;
  --link: #c39bf0;
  --danger: #ef8585;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --code-bg: #1b1626;
}

* { box-sizing: border-box; }
/* hidden 属性必须压过组件自身的 display 声明，否则隐藏的成功卡片 / 挑战框仍会占位 */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  letter-spacing: 0.01em;
  margin: 0 0 .5rem;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .75rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: baseline; gap: .5rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); font-size: 1.15rem; }
.brand-text { font-family: Georgia, "Songti SC", serif; font-size: 1.25rem; font-weight: 700; }
.brand-sub { color: var(--muted); font-size: .8rem; }

.mainnav { display: flex; gap: 1rem; margin-left: auto; }
.mainnav a { color: var(--text-soft); padding: .3rem .65rem; border-radius: 6px; }
.mainnav a.active, .mainnav a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }

/* 顶栏下拉菜单（用户菜单）：点击按钮展开子菜单 */
.nav-menu { position: relative; display: inline-flex; }
.nav-menu-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  font: inherit; color: var(--text-soft);
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: .3rem .65rem; cursor: pointer;
}
.nav-menu-btn:hover, .nav-menu-btn.active, .nav-menu-btn[aria-expanded="true"] {
  color: var(--text); background: var(--accent-soft);
}
.nav-menu-btn .nm-caret { font-size: .68rem; color: var(--muted); transition: transform .15s ease; }
.nav-menu-btn[aria-expanded="true"] .nm-caret { transform: rotate(180deg); }
.nav-menu-list {
  position: absolute; top: calc(100% + .5rem); right: 0; z-index: 30;
  min-width: 208px; padding: .35rem;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  display: flex; flex-direction: column; gap: .1rem;
}
.nav-menu-list[hidden] { display: none; }
.nav-menu-head {
  padding: .25rem .55rem .45rem; margin-bottom: .2rem;
  border-bottom: 1px solid var(--panel-border);
}
.nav-menu-head .nm-name { display: block; color: var(--text); font-size: .86rem; }
.nav-menu-head .nm-sub { display: block; color: var(--muted); font-size: .72rem; word-break: break-all; }
.nav-menu .nav-menu-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .38rem .55rem; border-radius: 8px;
  color: var(--text-soft); font-size: .88rem; white-space: nowrap;
}
.nav-menu .nav-menu-item:hover, .nav-menu .nav-menu-item.active {
  color: var(--text); background: var(--accent-soft); text-decoration: none;
}
.nav-menu-item .nm-ico { flex: 0 0 auto; width: 1.15em; text-align: center; }
.nav-menu-sep { height: 1px; margin: .25rem .15rem; background: var(--panel-border); }

.topbar-right { display: flex; align-items: center; gap: .6rem; }

.theme-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 999px;
  padding: .3rem .7rem; cursor: pointer; font-size: .82rem;
}
.theme-btn:hover { border-color: var(--accent); }

/* 主题切换器：点击展开 6 套主题的下拉菜单 */
.theme-switcher { position: relative; display: inline-flex; }
.theme-menu {
  position: absolute; top: calc(100% + .5rem); right: 0; z-index: 30;
  min-width: 210px; padding: .4rem;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  display: flex; flex-direction: column; gap: .15rem;
}
.theme-menu[hidden] { display: none; }
.theme-menu-title { color: var(--muted); font-size: .72rem; letter-spacing: .04em; padding: .25rem .5rem .4rem; }
.theme-item {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: .4rem .5rem; cursor: pointer; color: var(--text); font-size: .88rem; text-align: left;
}
.theme-item:hover { background: var(--accent-soft); }
.theme-item.on { border-color: var(--accent); }
.theme-swatch {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--panel-border);
}
.theme-item .ti-name { white-space: nowrap; }
.theme-item .ti-desc { color: var(--muted); font-size: .74rem; }
.theme-item .ti-check { margin-left: auto; color: var(--accent); font-size: .82rem; }

/* ---------- 页面骨架 ---------- */
.page { flex: 1; width: min(1120px, 100%); margin: 0 auto; padding: 1.5rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.15rem 1.3rem;
  box-shadow: var(--shadow);
}

.hero { text-align: center; padding: 1.2rem 0 1.4rem; }
.hero h1 { font-size: 2.1rem; margin-bottom: .3rem; }
.hero-sub { color: var(--text-soft); margin: 0; }

/* ---------- 首页（站点介绍） ---------- */
.home-hero { padding: 2.6rem 0 1.6rem; }
.why { max-width: 940px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.1rem; }
.why-title { font-size: 1.5rem; text-align: center; margin: 0; }
.why-lead { color: var(--text-soft); line-height: 1.9; margin: 0; text-align: center; }
.why-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.why-card { text-align: center; align-items: center; padding: 1.3rem 1.1rem; }
.why-card h3 { margin: 0; font-size: 1.05rem; }
.why-card p { margin: 0; color: var(--text-soft); font-size: .9rem; line-height: 1.7; }
.why-icon { font-size: 1.7rem; line-height: 1; }
.why-close { line-height: 1.9; margin: 0; text-align: center; color: var(--text); }
.home-cta { display: flex; justify-content: center; gap: .8rem; padding: 1.2rem 0 2.4rem; }

.footer {
  padding: 1.2rem 1.5rem; text-align: center; color: var(--muted);
  border-top: 1px solid var(--panel-border); font-size: .82rem;
  display: flex; flex-direction: column; gap: .5rem; align-items: center;
}

.footer .footer-links {
  display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; align-items: center;
}

/* 页尾管理后台入口：胶囊样式，与前端顶部入口形成呼应，不抢正文视觉 */
.footer .footer-links .footer-admin {
  border: 1px solid var(--panel-border); border-radius: 999px;
  padding: .14rem .6rem; color: var(--text-soft);
}

.footer .footer-links .footer-admin:hover {
  border-color: var(--accent); color: var(--accent); text-decoration: none;
}

.footer .footer-status {
  display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap;
  align-items: center;
}

.footer .footer-status .fs-item {
  font-size: .74rem; color: var(--muted);
  border: 1px dashed var(--panel-border);
  padding: .1rem .5rem; border-radius: 999px;
}

.footer .footer-status .fs-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
}

/* ---------- 筛选与搜索 ---------- */
.filterbar { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.2rem; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--panel-border); background: var(--panel);
  color: var(--text-soft); border-radius: 999px; padding: .28rem .75rem; font-size: .85rem;
}
.chip b { color: var(--accent); margin-left: .25rem; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on b { color: #fff; }

.search { display: flex; gap: .5rem; align-items: center; }
.search input[type="search"] { flex: 1; max-width: 380px; }

/* ---------- 作品卡片 ---------- */
.grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 1rem 1.1rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .55rem;
}
.card-title { font-size: 1.06rem; font-weight: 600; color: var(--text); }
.card-title:hover { color: var(--accent); text-decoration: none; }
.card-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.card-summary { margin: 0; color: var(--text-soft); font-size: .9rem; }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); margin-top: auto; }
.card-foot .links { display: flex; gap: .7rem; align-items: center; }
/* 单文件网页预览：小按钮样式，与普通文字链接区分 */
.preview-link {
  display: inline-block; padding: .1rem .55rem; border-radius: 6px; font-size: .78rem;
  background: var(--bg-soft); border: 1px solid var(--panel-border); color: var(--text-soft);
}
.preview-link:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

.tag {
  display: inline-block; padding: .1rem .5rem; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); font-size: .76rem; border: 1px solid transparent;
}
.tag-md { background: var(--accent-soft); color: var(--c-md); }
.tag-html { background: rgba(31, 92, 139, .14); color: var(--link); }
.tag-site { background: rgba(38, 122, 74, .14); color: var(--c-site); }
.tag-image { background: rgba(155, 89, 182, .16); color: var(--c-image); }
.tag-external { background: rgba(194, 178, 128, .18); color: var(--c-external); }
.tag-github { background: rgba(90, 90, 90, .16); color: var(--text-soft); }

/* 作品标签与分类 */
.tags-row { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 0; }
.work-tag {
  display: inline-block; padding: .08rem .5rem; border-radius: 10px;
  background: var(--code-bg); color: var(--text-soft); font-size: .74rem;
  border: 1px solid var(--panel-border);
}
.cat { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .76rem; }

/* 文件拖放区：整块区域即原生 file 控件的点击热区 */
.dropzone {
  position: relative;
  display: flex; align-items: center; gap: .7rem; margin-top: .35rem;
  border: 1.5px dashed var(--panel-border); border-radius: 8px;
  padding: .8rem .9rem; background: var(--code-bg); cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
/* 原生控件透明覆盖整块区域：点击任意位置都能调起系统选择框，同时保留键盘可达性 */
.dz-input {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; border-radius: inherit;
  background: transparent; opacity: 0; cursor: pointer;
  /* flex 子项按文档顺序绘制，必须提升层级才能覆盖图标/文字/胶囊按钮 */
  z-index: 1;
}
.dz-input:focus { outline: none; }
.dz-icon { font-size: 1.25rem; line-height: 1; flex: 0 0 auto; }
.dz-hint { color: var(--muted); font-size: .82rem; line-height: 1.45; word-break: break-all; }
.dz-hint.has-file { color: var(--accent); font-weight: 600; }
/* 胶囊按钮：仅作视觉呈现，实际点击由 .dz-input 接管 */
.dz-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  padding: .42rem 1.15rem; border-radius: 999px;
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
  font-size: .84rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background .15s, color .15s, opacity .15s;
}
.dropzone:hover .dz-btn { opacity: .9; }
/* 主上传区：更显眼的虚线大框，图标居中 */
.dropzone-lg {
  flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: .55rem; padding: 1.3rem 1rem; border-width: 2px; border-radius: 10px;
}
.dropzone-lg .dz-icon { font-size: 1.9rem; }
.dropzone-lg .dz-hint { font-size: .85rem; max-width: 30rem; }
/* 已选中文件：实线强调边框 + 弱化按钮（重新选择） */
.dropzone.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-file .dz-btn { background: var(--bg-soft); color: var(--accent); }
/* 次要输入：折叠的粘贴区，节省高度 */
.alt-input { border: 1px dashed var(--panel-border); border-radius: 8px; padding: .35rem .7rem; background: var(--bg-soft); }
.alt-input > summary { cursor: pointer; color: var(--text-soft); font-size: .85rem; font-weight: 600; padding: .2rem 0; }
.alt-input[open] > summary { margin-bottom: .5rem; }
.alt-input textarea { width: 100%; margin-top: .35rem; }

.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1.5rem; color: var(--muted); }
.empty { text-align: center; padding: 3rem 0; color: var(--text-soft); }

/* ---------- 表单 ---------- */
.form-head h1 { font-size: 1.7rem; }
.form { display: flex; flex-direction: column; gap: 1.2rem; max-width: 940px; }
.form-section { display: flex; flex-direction: column; gap: 1rem; }
.section-title { font-size: 1.15rem; margin: 0; padding-bottom: .5rem; border-bottom: 1px solid var(--panel-border); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-grid .span-2 { grid-column: 1 / -1; }
.row { display: flex; flex-direction: column; gap: .35rem; }
.row label { font-weight: 600; font-size: .88rem; }
.file-label { font-weight: 400 !important; color: var(--text-soft); font-size: .82rem !important; margin-top: .35rem; }
.req { color: var(--danger); }

/* 表单分区 Tab（基本信息 / 作品内容）：步骤式页签，与内部类型选择器区分层级 */
.form-tabs { flex-wrap: wrap; gap: .1rem; }
.form-tabs .tab {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1rem; font-size: .95rem;
}
.tab-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  border: 1px solid var(--panel-border); background: var(--bg-soft);
  font-size: .72rem; font-weight: 600; color: var(--muted);
}
.form-tabs .tab.on .tab-step { background: var(--accent); border-color: var(--accent); color: var(--bg-soft); }
.form .tab-pane { gap: 1.2rem; }
.pane-foot { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.tab-next { font-size: .85rem; }

/* 类型 Tab 选择器（嵌在内容分区内，胶囊样式以区别于分区 Tab） */
.type-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
/* 需高于后定义的 .tabs（同优先级时会保留其下边框） */
.tabs.type-picker { flex-wrap: wrap; gap: .45rem; border-bottom: none; }
.type-picker .tab {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .38rem .85rem; font-size: .86rem;
  border: 1px solid var(--panel-border); border-radius: 999px; background: var(--bg-soft);
}
.type-picker .tab:hover { border-color: var(--accent); color: var(--accent); }
.type-picker .tab.on {
  background: var(--accent); border-color: var(--accent);
  color: var(--bg-soft); font-weight: 600;
}
.type-tab { display: inline-flex; align-items: center; gap: .35rem; }
.tt-icon { font-size: 1.05rem; line-height: 1; }

input, select, textarea, button {
  font: inherit; color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--panel-border);
  border-radius: 8px; padding: .5rem .65rem;
}
textarea { font-family: ui-monospace, Consolas, monospace; font-size: .86rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.type-blocks { display: flex; flex-direction: column; gap: 1rem; }
.type-block { display: none; }
.type-block.on { display: flex; }
.type-block[data-always="1"] { display: flex; }

.actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.kept-file { color: var(--text-soft); font-size: .85rem; margin: 0; }
.status { font-size: .85rem; color: var(--muted); }
.status.err { color: var(--danger); }
.status.ok { color: var(--c-success); }

.btn {
  display: inline-block; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 8px;
  padding: .45rem .95rem; cursor: pointer; font-size: .88rem;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; opacity: .92; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-text { background: transparent; border-color: transparent; color: var(--muted); }

/* ---------- 详情 ---------- */
.work { display: flex; flex-direction: column; gap: 1rem; }
.work-head h1 { font-size: 1.85rem; }
.work-meta { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .84rem; }
.work-meta .wid { font-family: ui-monospace, Consolas, monospace; }
.work-summary { color: var(--text-soft); margin: .6rem 0 0; }
.work-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .9rem; }
.work-body { overflow: hidden; }

.frame { width: 100%; border: 1px solid var(--panel-border); border-radius: 8px; background: #fff; }
.frame-tall { height: 72vh; min-height: 420px; }
.image-wrap { margin: 0; text-align: center; }
.image-wrap img { max-width: 100%; border-radius: 8px; background: var(--bg-soft); }
.image-wrap figcaption { color: var(--muted); margin-top: .6rem; font-size: .86rem; }
.link-line { margin: .2rem 0; word-break: break-all; }
.note { color: var(--text-soft); }
.muted { color: var(--muted); font-size: .84rem; }

/* ---------- Markdown 正文 ---------- */
.markdown { max-width: 820px; margin: 0 auto; }
.markdown h1, .markdown h2 { border-bottom: 1px solid var(--panel-border); padding-bottom: .25rem; }
.markdown code { background: var(--code-bg); padding: .1rem .35rem; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; }
.markdown pre { background: var(--code-bg); padding: .9rem 1rem; border-radius: 8px; overflow: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown table { border-collapse: collapse; width: 100%; }
.markdown th, .markdown td { border: 1px solid var(--panel-border); padding: .4rem .6rem; }
.markdown img { max-width: 100%; }
.markdown blockquote { margin: 0; padding: .2rem 1rem; border-left: 3px solid var(--accent); color: var(--text-soft); background: var(--bg-soft); }

/* ---------- 错误页 ---------- */
.error-box { max-width: 860px; }
.err-msg { font-size: 1.02rem; color: var(--danger); word-break: break-all; }
.trace { max-height: 320px; overflow: auto; background: var(--code-bg); padding: .8rem; font-size: .78rem; }

@media (max-width: 720px) {
  .topbar { gap: .8rem; }
  .mainnav { order: 3; margin-left: 0; width: 100%; }
  /* 顶栏条目在窄屏整块换行，避免“前台首页”被拆成两行 */
  .mainnav > a, .mainnav .nav-menu-btn { white-space: nowrap; }
  .hero h1 { font-size: 1.6rem; }
  .frame-tall { height: 60vh; }
  .field-grid { grid-template-columns: 1fr; }
  .type-picker { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

/* ---------- 前台菜单：管理员入口与登录信息 ---------- */
.nav-user {
  margin-left: .4rem; font-size: .72rem; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: .05rem .45rem;
}
.admin-chip {
  font-size: .78rem; color: var(--text-soft); border: 1px solid var(--panel-border);
  padding: .15rem .55rem; border-radius: 999px; background: var(--bg-soft);
}
.admin-chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

/* ---------- 管理后台：左菜单 + 右内容 ---------- */
.admin-body { min-height: 100vh; }
.admin-shell { display: flex; flex: 1; align-items: stretch; width: 100%; }

.admin-side {
  width: 220px; flex: 0 0 220px;
  background: var(--panel); border-right: 1px solid var(--panel-border);
  padding: 1rem .75rem; display: flex; flex-direction: column; gap: .5rem;
}
.admin-side-title { color: var(--muted); font-size: .74rem; text-transform: uppercase; padding: 0 .6rem .3rem; }
.admin-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.admin-menu a {
  display: block; color: var(--text-soft); padding: .5rem .7rem; border-radius: 8px;
  font-size: .92rem;
}
.admin-menu a:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.admin-menu a.on { background: var(--accent); color: #fff; }
.admin-side-foot { margin-top: auto; color: var(--muted); font-size: .74rem; padding: 0 .6rem; }

.admin-main { flex: 1; min-width: 0; padding: 1.5rem; overflow: auto; }
.admin-main > * + .panel, .admin-main > * + .admin-cols { margin-top: 1.2rem; }
.admin-page-head h1 { font-size: 1.7rem; margin-bottom: .2rem; }

.panel-title { font-size: 1.05rem; margin: 0 0 .8rem; }
.admin-cols { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1.2rem; }
.stat-card {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 1rem; text-align: center; box-shadow: var(--shadow);
}
.stat-num { font-size: 1.7rem; font-weight: 700; color: var(--accent); font-family: Georgia, serif; }
.stat-label { color: var(--muted); font-size: .82rem; margin-top: .3rem; }

.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--panel-border); }
.tbl thead th { color: var(--muted); font-weight: 600; font-size: .8rem; border-bottom: 2px solid var(--panel-border); }
.tbl tbody tr:hover { background: var(--bg-soft); }
.tbl .wid { font-family: ui-monospace, Consolas, monospace; }
.table-wrap { overflow-x: auto; }
.row-links { display: flex; gap: .6rem; white-space: nowrap; }

.dist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.dist-row { display: flex; align-items: center; gap: .7rem; }
.dist-row .tag { flex: 0 0 auto; min-width: 120px; }
.dist-bar { flex: 1; height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: var(--accent); }
.dist-num { flex: 0 0 auto; min-width: 2ch; text-align: right; color: var(--accent); }
.dist-foot { display: flex; justify-content: space-between; margin-top: .9rem; color: var(--muted); font-size: .8rem; }

.kv { width: 100%; border-collapse: collapse; font-size: .88rem; }
.kv th, .kv td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--panel-border); vertical-align: top; }
.kv th { color: var(--muted); font-weight: 600; width: 120px; white-space: nowrap; }
.kv code { background: var(--code-bg); padding: .05rem .35rem; border-radius: 4px; word-break: break-all; }

/* ---------- 管理后台登录页 ---------- */
.admin-login-body { align-items: center; justify-content: center; }
.login-wrap { margin: auto; width: min(420px, 92vw); display: flex; flex-direction: column; gap: 1.2rem; padding: 2rem 0; }
.brand-center { justify-content: center; }
.login-card { display: flex; flex-direction: column; gap: 1rem; }
.login-title { font-size: 1.4rem; text-align: center; margin: 0; }
.login-err { color: var(--danger); font-size: .86rem; margin: 0; }
.login-hint { color: var(--muted); font-size: .78rem; margin: 0; text-align: center; }
/* 需要登录的页面拦截后带来的提示语（如发布 / 编辑作品） */
.login-notice {
  margin: 0;
  padding: .6rem .8rem;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--text-soft);
  font-size: .86rem;
}

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; flex: none; border-right: none; border-bottom: 1px solid var(--panel-border); }
  .admin-menu { flex-direction: row; flex-wrap: wrap; }
  .dist-row .tag { min-width: 96px; }
}

/* ---------- 登录 / 注册页 ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 2rem 0; }
.auth-card { width: min(680px, 100%); display: flex; flex-direction: column; gap: 1rem; }
.auth-title { font-size: 1.5rem; margin: 0; }
.auth-sub { margin: 0; }
.steps { display: flex; gap: .5rem; flex-wrap: wrap; }
.step {
  font-size: .8rem; color: var(--muted); border: 1px dashed var(--panel-border);
  border-radius: 999px; padding: .18rem .7rem;
}
.step.on { color: var(--accent); border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--panel-border); flex-wrap: wrap; }
.tab {
  background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  padding: .45rem .8rem; cursor: pointer; color: var(--muted); font-size: .9rem;
}
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-badge {
  margin-left: .4rem; font-size: .72rem; font-weight: 400;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: .02rem .42rem;
}
.tab.on .tab-badge { background: var(--accent); color: #fff; }
.tab-pane { display: none; flex-direction: column; gap: .9rem; }
.tab-pane.on { display: flex; }
/* 管理后台内的分区 Tab：与下方内容留出间距 */
.admin-main > .tabs { margin-bottom: 1.2rem; flex-wrap: wrap; }
.challenge-box { display: flex; flex-direction: column; gap: .8rem; background: var(--bg-soft);
  border: 1px dashed var(--panel-border); border-radius: 10px; padding: .9rem 1rem; }
.auth-result { display: flex; flex-direction: column; gap: .6rem; background: var(--bg-soft);
  border: 1px solid var(--panel-border); border-radius: 10px; padding: 1rem 1.1rem; }
.break { word-break: break-all; }

code.inline-key { background: var(--code-bg); padding: .05rem .35rem; border-radius: 4px; }

/* ---------- 退出登录：落地提示条 + 确认弹窗 ---------- */
.flash {
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1.2rem;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-left: 3px solid var(--c-success); border-radius: 10px;
  padding: .7rem .95rem; box-shadow: var(--shadow);
  transition: opacity .25s ease, transform .25s ease;
}
.flash.hide { opacity: 0; transform: translateY(-6px); }
.flash-ico { flex: 0 0 auto; font-size: 1.15rem; line-height: 1; }
.flash-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.flash-body b { font-size: .92rem; }
.flash-text { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.flash-x {
  flex: 0 0 auto; background: transparent; border: none; color: var(--muted);
  font-size: .8rem; line-height: 1; padding: .35rem .45rem; border-radius: 6px; cursor: pointer;
}
.flash-x:hover { color: var(--danger); background: var(--accent-soft); }
.flash .btn { flex: 0 0 auto; font-size: .82rem; padding: .32rem .8rem; }
#logoutModalText { margin: 0; line-height: 1.6; }
@media (max-width: 620px) {
  .flash { flex-wrap: wrap; }
  .flash-body { flex: 1 1 100%; }
  /* 窄屏时按钮与关闭键换到第二行并靠右对齐 */
  .flash .btn { margin-left: auto; }
}

/* ---------- 注册页 UE ---------- */
/* 标题行：标题 + 右侧登录链接用 grid 分列，链接不会因副标题过长而换行 */
.auth-head { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; align-items: start; }
.auth-head > div { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.auth-alt { font-size: .84rem; white-space: nowrap; }
.method-tabs .tab { display: inline-flex; align-items: center; gap: .4rem; }
.auth-fine { color: var(--muted); font-size: .76rem; margin: 0; }
.opt { color: var(--muted); font-weight: 400; font-size: .76rem; }

/* 字段级提示与校验：错误时输入框标红，说明文字落在字段下方 */
.field-hint { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.field-err { color: var(--danger); font-size: .78rem; font-weight: 600; }
.row.has-err input, .row.has-err textarea { border-color: var(--danger); }
.row.has-err input:focus, .row.has-err textarea:focus { outline-color: var(--danger); }

/* 密码框：右侧内置显隐按钮 */
.pass-wrap { position: relative; display: flex; }
.pass-wrap input { flex: 1; padding-right: 2.6rem; }
.pass-eye {
  position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  width: 2rem; height: 2rem; padding: 0; display: inline-flex;
  align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: transparent;
  color: var(--muted); font-size: .95rem; line-height: 1; cursor: pointer;
}
.pass-eye:hover { color: var(--accent); background: var(--accent-soft); }

/* 密码强度条：未输入时不显示，避免看起来像一条多余分隔线 */
.pwd-meter { display: none; height: 4px; border-radius: 999px; background: var(--panel-border); overflow: hidden; }
.pwd-meter.lv1, .pwd-meter.lv2, .pwd-meter.lv3 { display: block; }
.pwd-meter > i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--danger); transition: width .2s ease, background .2s ease; }
.pwd-meter.lv1 > i { background: var(--danger); }
.pwd-meter.lv2 > i { background: var(--c-external); }
.pwd-meter.lv3 > i { background: var(--c-success); }

/* 注册成功卡片：绿色描边 + 私章保存区 */
.auth-result.success { border-color: var(--c-success); border-left: 3px solid var(--c-success); }
.success-head { display: flex; gap: .7rem; align-items: flex-start; }
.success-head h3 { margin: 0; font-size: 1.05rem; }
.success-head p { margin: .15rem 0 0; }
.ok-badge {
  flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-success); color: #fff; font-weight: 700; font-size: .9rem;
}
.seal-box { display: flex; flex-direction: column; gap: .55rem;
  border: 1px dashed var(--panel-border); border-radius: 8px; padding: .7rem .8rem; background: var(--panel); }
.seal-warn { margin: 0; color: var(--danger); font-size: .82rem; font-weight: 600; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn:disabled:hover { border-color: var(--accent); color: inherit; }

/* ---------- 管理后台：用户管理 ---------- */
.head-with-actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.kid, .apikey { cursor: pointer; background: var(--code-bg); padding: .08rem .35rem; border-radius: 4px;
  font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
.login-name { background: var(--code-bg); padding: .08rem .35rem; border-radius: 4px;
  font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
/* 用户列表列较多：表头不换行，窄屏横向滚动而非挤压单元格 */
#userTable { min-width: 1280px; }
#userTable th { white-space: nowrap; }
#userTable td { white-space: nowrap; }
#userTable .apikey, #userTable .kid { display: inline-block; max-width: 11ch; overflow: hidden;
  text-overflow: ellipsis; vertical-align: bottom; }
.kid:hover, .apikey:hover { outline: 1px solid var(--accent); }
.tag-algo { background: rgba(31, 92, 139, .12); color: var(--link); }
.tag-ok { background: rgba(38, 122, 74, .14); color: var(--c-success); }
.tag-off { background: rgba(163, 50, 50, .12); color: var(--danger); }
.row-links .danger { color: var(--danger); }
.api-hint { margin-top: 1rem; }
.api-hint code { background: var(--code-bg); padding: .05rem .35rem; border-radius: 4px; }

/* ---------- 管理后台：用户详情（独立页面） ---------- */
.detail-keys .row + .panel-title { margin-top: 1.3rem; }
.detail-keys .row label { font-weight: 600; font-size: .88rem; }
.danger-zone { border-color: rgba(163, 50, 50, .35); }
.kv .copy-btn { margin-left: .4rem; font-size: .78rem; }

/* ---------- 对话框（modal） ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 18, 15, .55); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 1rem; overflow: auto;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 14px;
  width: min(560px, 100%); box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
  animation: modal-in .18s ease-out;
}
.modal-lg { width: min(860px, 100%); }
@keyframes modal-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--panel-border);
}
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-x {
  background: transparent; border: none; color: var(--muted); font-size: 1rem;
  cursor: pointer; padding: .2rem .45rem; border-radius: 6px;
}
.modal-x:hover { color: var(--danger); background: var(--accent-soft); }
.modal-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .9rem; }
body.modal-open { overflow: hidden; }

.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.key-pre {
  background: var(--code-bg); border: 1px solid var(--panel-border); border-radius: 8px;
  padding: .7rem .8rem; font-family: ui-monospace, Consolas, monospace; font-size: .76rem;
  white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; margin: 0;
}
.key-pre.secret { color: var(--danger); }
.ok-line { color: var(--c-success); font-size: .88rem; margin: 0; }
.err-line { color: var(--danger); font-size: .88rem; margin: 0; }

/* 登录方式/集成模式提醒条（管理页设置面板与前台登录注册页共用） */
.site-alert {
  margin: 0 0 .8rem;
  padding: .6rem .8rem;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--text-soft);
  font-size: .85rem;
  line-height: 1.6;
}
.site-alert.warn { border-left-color: var(--danger); }

@media (max-width: 720px) {
  .head-with-actions { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- 扫码（二维码面板 / 扫码确认页） ---------- */
.qr-box {
  display: flex; justify-content: center; align-items: center;
  background: #fff; border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 12px; width: min(260px, 100%); margin: 0 auto;
}
.qr-svg { width: 100%; min-height: 160px; display: flex; align-items: center; justify-content: center;
  color: #666; font-size: .78rem; text-align: center; word-break: break-all; }
.qr-svg svg { display: block; width: 100%; height: auto; }
.qr-count { margin: 0; text-align: center; font-size: .78rem; }
/* 二维码内容：二维码正下方的小链接，展开显示二维码编码的文本（扫码链接） */
.qr-content { width: min(260px, 100%); margin: .25rem auto 0; }
.qr-content > summary {
  cursor: pointer; list-style: none; text-align: center; color: var(--muted);
  font-size: .78rem; text-decoration: underline; text-underline-offset: 2px;
}
.qr-content > summary::-webkit-details-marker { display: none; }
.qr-content > summary::before { content: '▸ '; text-decoration: none; }
.qr-content[open] > summary::before { content: '▾ '; }
.qr-content > code {
  display: block; margin-top: .35rem; padding: .5rem .6rem; line-height: 1.5;
  background: var(--bg-soft); border: 1px solid var(--panel-border); border-radius: 8px;
  font-size: .72rem; user-select: all;
}
.scan-wrap { width: min(580px, 94vw); }
.scan-wrap #stepTrust, .scan-wrap #stepForm, .scan-wrap #stepResult {
  display: flex; flex-direction: column; gap: .85rem;
}
.scan-wrap #stepTrust .kv, .scan-wrap #stepResult .kv { margin: 0; }
.scan-wrap .method-tabs { margin-top: .2rem; }
.scan-wrap .actions { margin-top: .15rem; }
.steps-list { margin: 0 0 .6rem; padding-left: 1.3rem; display: flex; flex-direction: column;
  gap: .35rem; line-height: 1.65; }

/* ---------- 登录集成（配置表单 / 登录页入口） ---------- */
.check-line { display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .88rem; }
.check-line input[type="checkbox"] {
  width: 1rem; height: 1rem; padding: 0; margin: 0; accent-color: var(--accent); cursor: pointer;
}
.auth-result h2 { font-size: 1.05rem; }

/* ---------- 个人信息页：左菜单 + 右内容 ---------- */
.profile-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.profile-side {
  position: sticky; top: 4.75rem;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: .8rem .65rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .5rem;
}
.profile-side-title { color: var(--muted); font-size: .74rem; letter-spacing: .04em; padding: 0 .55rem .2rem; }
.profile-menu { display: flex; flex-direction: column; gap: .15rem; }
.pm-item {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  background: transparent; border: none; border-radius: 8px;
  padding: .52rem .55rem; color: var(--text-soft);
  font-size: .9rem; line-height: 1.4; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.pm-item:hover { background: var(--accent-soft); color: var(--text); }
.pm-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm-item.on { background: var(--accent); color: #fff; font-weight: 600; }
.pm-ico { flex: 0 0 auto; font-size: .95rem; line-height: 1; }
.pm-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-tag {
  flex: 0 0 auto; font-size: .68rem; line-height: 1.5; padding: 0 .4rem;
  border: 1px solid var(--panel-border); border-radius: 999px;
  background: var(--bg-soft); color: var(--muted); font-weight: 400;
}
.pm-tag.ok { color: var(--c-success); border-color: currentColor; }
.pm-tag.off { color: var(--danger); border-color: currentColor; }
.pm-item.on .pm-tag { background: rgba(255, 255, 255, .18); border-color: transparent; color: #fff; }
.profile-side-foot { margin-top: .3rem; border-top: 1px dashed var(--panel-border); padding: .55rem .55rem 0; }
.psf-name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psf-sub { color: var(--muted); font-size: .74rem; font-family: ui-monospace, Consolas, monospace; }
/* 侧栏底部的退出登录入口 */
.psf-logout {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: .45rem;
  font-size: .8rem; color: var(--muted);
}
.psf-logout:hover { color: var(--danger); text-decoration: none; }

.profile-main { min-width: 0; }
.profile-pane { display: none; }
.profile-pane.on { display: block; }
/* 表格后的操作行留出间距，避免按钮贴着表格底线 */
.profile-pane .kv + .actions { margin-top: 1rem; }
.profile-pane .panel-sep { margin: 1.1rem 0 .8rem; }

@media (max-width: 860px) {
  .profile-shell { grid-template-columns: 1fr; }
  .profile-side { position: static; }
  .profile-menu { flex-direction: row; flex-wrap: wrap; }
  .pm-item { width: auto; }
  .pm-label { flex: 0 0 auto; }
  .profile-side-foot { display: none; }
}
.api-key-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 .6rem; }
.api-key-line code {
  background: var(--code-bg); border: 1px solid var(--panel-border); border-radius: 6px;
  padding: .25rem .5rem; font-family: ui-monospace, Consolas, monospace; font-size: .86rem;
}
.panel-sep { border: none; border-top: 1px dashed var(--panel-border); margin: .3rem 0; }

/* AI Bot 文档分区：说明 + 三步提示 + 复制框 */
.ai-bot-head { display: flex; align-items: flex-start; gap: .6rem; }
.ai-bot-ico { font-size: 1.2rem; line-height: 1.3; }
.ai-bot-text { display: flex; flex-direction: column; gap: .15rem; }
.ai-bot-text .muted { font-size: .82rem; }
.ai-bot-steps { display: flex; gap: .5rem; flex-wrap: wrap; }
.ai-bot-step {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--text-soft); font-size: .8rem;
}
.ai-bot-step b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--accent); color: var(--bg-soft); font-size: .7rem;
}
.ai-bot-copy { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ai-bot-copy code {
  flex: 1 1 320px; min-width: 0;
  background: var(--code-bg); border: 1px solid var(--panel-border); border-radius: 8px;
  padding: .45rem .6rem; font-family: ui-monospace, Consolas, monospace; font-size: .82rem;
}
.ai-bot-meta { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }
.ai-bot-meta a { font-size: .8rem; }
