
/* =========================================================
   style.css · Gongbi Silk V2（合并移动端优化 · 保持原配色/结构）
   说明：
   1) 在不改变配色和大体布局风格的前提下，强化移动端表现；
   2) 关键点：提案列表自适应列宽与换行、KVS 栅格在小屏改为单列、
      视频卡片标题常显、语言切换在小屏不遮挡标题；
   3) 框架：mobile-first，通过少量 @media 覆盖桌面端增强。
   ========================================================= */

/* ---------- 色板与基础 ---------- */
:root{
  --silk-paper:#EDE3C8;
  --silk-paper-2:#FAF4E1;
  --ink-strong:#2B2B2B;
  --ink-muted:#6B5E40;
  --qing-lv:#2B6F68;
  --cinnabar:#C23A2D;
  --gold:#B1935A;
  --vote-yes:#3C9D77;
  --vote-no:var(--cinnabar);
  --vote-none:var(--ink-strong);
}

*{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  color:var(--ink-strong);
  font:18px/1.7 system-ui,-apple-system,"PingFang TC","Noto Sans TC","Microsoft JhengHei",sans-serif;
  background:
    radial-gradient(1000px 720px at 80% -10%, rgba(177,147,90,.10), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.018), rgba(0,0,0,.018) 1px, transparent 1px, transparent 6px),
    repeating-linear-gradient(0deg, rgba(0,0,0,.014), rgba(0,0,0,.014) 1px, transparent 1px, transparent 6px),
    var(--silk-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

/* ---------- 布局与标题 ---------- */
.wrap{ max-width:1200px; margin:40px auto; padding:0 16px; position:relative; }

h1{
  margin:0 0 12px;
  font-size:32px;
  font-family:"Noto Serif TC","Source Han Serif TC","Songti SC","PMingLiU",serif;
  letter-spacing:.5px;
  color:var(--ink-strong);
  padding-bottom:10px;
  background:linear-gradient(var(--gold),var(--gold)) bottom left/64px 1px no-repeat;
}

.sub{ color:var(--ink-muted); margin-bottom:20px; }

.row{ display:flex; gap:14px; flex-wrap:wrap; align-items:stretch; }
.col{ flex:1; min-width:280px; display:flex; flex-direction:column; }

/* ---------- 卡片 ---------- */
.card{
  position:relative;
  flex:1;
  background:var(--silk-paper-2);
  border:.5px solid var(--gold);
  border-radius:16px;
  padding:24px;
  margin-bottom:14px;
  box-shadow:
    inset 0 0 0 .5px rgba(177,147,90,.35),
    0 1px 0 rgba(177,147,90,.20),
    0 10px 24px rgba(0,0,0,.06);
}
.card::before{
  content:"";
  pointer-events:none;
  position:absolute; inset:10px;
  background:
    linear-gradient(var(--gold),var(--gold)) top left/22px 1px no-repeat,
    linear-gradient(var(--gold),var(--gold)) top left/1px 22px no-repeat,
    linear-gradient(var(--gold),var(--gold)) top right/22px 1px no-repeat,
    linear-gradient(var(--gold),var(--gold)) top right/1px 22px no-repeat,
    linear-gradient(var(--gold),var(--gold)) bottom left/22px 1px no-repeat,
    linear-gradient(var(--gold),var(--gold)) bottom left/1px 22px no-repeat,
    linear-gradient(var(--gold),var(--gold)) bottom right/22px 1px no-repeat,
    linear-gradient(var(--gold),var(--gold)) bottom right/1px 22px no-repeat;
  opacity:.65; border-radius:12px;
}

/* ---------- KVS（键值网格） ---------- */
.kvs{ display:grid; grid-template-columns:180px 1fr; gap:12px 16px; }
.kvs>.kv{ align-self:stretch; display:flex; align-items:center; color:var(--ink-muted); font-size:.95rem; }

/* 小屏：KVS 单列，避免左侧 180px 造成挤压 */
@media (max-width:600px){
  .kvs{ grid-template-columns:1fr; gap:10px 12px; }
  .kvs>.kv{ align-items:flex-start; }
}

code{
  font-family:ui-monospace,Menlo,Consolas,monospace;
  font-size:.95rem;
  background:#F6EED5;
  border:1px solid rgba(177,147,90,.6);
  padding:2px 6px; border-radius:6px; word-break:break-all;
}

.power{
  display:inline-flex; align-items:center; line-height:1;
  font-size:26px; font-weight:700;
}
.power .ada-icon{ width:30px; height:30px; margin-left:6px; object-fit:contain; }

.small{ font-size:13px; color:var(--ink-muted); }

/* ---------- 标签/徽章 ---------- */
.tag{
  display:inline-block; border:1px solid var(--gold);
  padding:2px 8px; border-radius:999px; color:var(--ink-strong);
}
.chip{
  display:inline-block; padding:4px 10px; border-radius:999px;
  background:radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.12), transparent 50%), var(--cinnabar);
  color:#F6EFE2; border:1px solid #A62E23; letter-spacing:.5px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18), inset 0 -3px 8px rgba(0,0,0,.20);
}
.badge{
  display:inline-block; background:#0b2b1f; border:1px solid #216b50;
  border-radius:999px; color:#b8f3d7; padding:2px 8px;
}

/* ---------- 链接/按钮 ---------- */
.links a,.video-title a{
  color:var(--qing-lv); text-decoration:none;
  background-image:linear-gradient(var(--gold),var(--gold));
  background-repeat:no-repeat; background-size:0% 1px; background-position:0 100%;
  transition:background-size .18s ease;
}
.links a:hover,.video-title a:hover{ background-size:100% 1px; }

.btns{ display:flex; gap:10px; flex-wrap:wrap; }
.btn{
  position:relative; display:inline-flex; align-items:center; justify-content:center;
  padding:8px 14px; width:132px; border-radius:999px; border:1px solid var(--gold);
  background:transparent; color:var(--qing-lv); text-decoration:none; font-size:.95rem; overflow:hidden;
}
.btn::after{ content:""; position:absolute; left:0; bottom:0; height:1px; width:0; background:var(--gold); transition:width .18s ease; }
.btn:hover{ background:rgba(177,147,90,.14); color:var(--ink-strong); }
.btn:hover::after{ width:100%; }

a:focus,.btn:focus{ outline:2px solid rgba(177,147,90,.7); outline-offset:2px; }

/* ---------- 通用网格 & 展示区 ---------- */
.grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; }

.card-showcase{ padding:24px; }

.showcase-grid{
  display:grid; grid-template-columns:repeat(2,1fr); gap:20px; margin:0;
  transform:translateY(10%);
}
@media (max-width:768px){ .showcase-grid{ grid-template-columns:1fr; transform:none; } }

.video-card{ display:flex; flex-direction:column; }
.video-card>a{
  display:block; aspect-ratio:16/9; overflow:hidden;
  border:1px solid rgba(177,147,90,.6); border-radius:10px; background:none;
}
.video-card>a img{
  width:100%; height:100%; object-fit:cover; display:block; transition:transform .18s ease;
}
.video-card>a:hover img{ transform:scale(1.03); }
.video-title{
  margin-top:8px; font-size:14px; line-height:1.5; color:var(--ink-strong);
}

/* ---------- 提案列表（重构为自适应列宽 & 文本可换行） ---------- */
#proposals-chip{ margin-bottom:20px; }

/* 列宽：mobile-first。小屏最小 260px，自适应多列；大屏提升到 320px */
.proposals-list{
  display:grid;
  grid-template-columns: 1fr; /* 永远单列，每个提案独占一行 */
  gap:10px;
}

/* 卡片网格：小屏单列内容流式；大屏回到 3 列（标签/标题/查看） */
.proposals-list a,.proposal-link{
  display:grid; grid-template-columns:1fr; row-gap:6px;
  padding:10px 12px;
  border:1px solid rgba(177,147,90,.45); background:var(--silk-paper-2); border-radius:10px;
  text-decoration:none; color:var(--ink-strong);
  overflow:hidden;
  transition:background-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.proposals-list a:hover,.proposal-link:hover{
  background:rgba(177,147,90,.10); transform:translateY(-1px); box-shadow:0 4px 14px rgba(0,0,0,.08);
}

/* 标签：小屏宽度自适应并靠左；大屏回 180px 定宽 */
.proposals-list .tag{
  display:inline-flex; align-items:center; justify-content:flex-start;
  width:auto; min-width:0; text-align:left; white-space:nowrap; margin:0;
}

/* 右侧查看提示：小屏靠左；大屏再靠右 */
.proposals-list .view-hint,.proposal-link .view-hint{
  justify-self:start; align-self:center; white-space:nowrap; font-size:16px; color:var(--ink-muted); opacity:.9;
}

/* 提案标题行：允许换行，移动端最多 2 行，桌面端 1 行 */
.proposals-list span{
  white-space:normal;
  overflow:hidden;
  text-overflow:ellipsis;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

/* ≥900px：恢复三列布局（标签 / 标题 / 查看）并设置标签固定宽度 */
@media (min-width:900px){
  .proposals-list a,.proposal-link{
    grid-template-columns:180px 1fr auto; column-gap:12px; row-gap:0;
  }
  .proposals-list .tag{
    justify-content:center; width:180px; min-width:180px; text-align:center;
  }
  .proposals-list .view-hint,.proposal-link .view-hint{ justify-self:end; }
  .proposals-list span{ -webkit-line-clamp:1; }
}

/* vote 图标（可选） */
.proposals-list a[data-vote="yes"]::before{ content:"■ "; color:var(--vote-yes); }
.proposals-list a[data-vote="no"]::before{ content:"■ "; color:var(--vote-no); }
.proposals-list a[data-vote="abstain"]::before,
.proposals-list a[data-vote="null"]::before{ content:"○ "; color:var(--vote-none); }

/* ---------- 其他 ---------- */
.hash{ font-family:ui-monospace,Menlo,Consolas,monospace; word-break:break-all; color:var(--qing-lv); }

.copy-btn{
  margin-left:8px; padding:2px 8px; border:1px solid var(--gold); border-radius:6px;
  background:transparent; color:var(--qing-lv); cursor:pointer; font-size:.85rem; line-height:1.6;
  transition:transform .08s ease, opacity .18s ease, background-color .18s ease;
}
.copy-btn:hover{ background:rgba(177,147,90,.14); color:var(--ink-strong); }
.copy-btn:active{ transform:scale(.96); }
.copy-btn.copied{ opacity:.7; }

/* 卡片水印（仅含 #kvs 的卡） */
.card:has(#kvs){ position:relative; }
.card:has(#kvs)::after{
  content:""; position:absolute; right:14px; bottom:12px;
  width:clamp(200px,36%,360px); aspect-ratio:4/3;
  background:url('lazycat.webp') no-repeat right bottom/contain;
  opacity:.5; pointer-events:none;
}
@media (max-width:720px){ .card:has(#kvs)::after{ display:none; } }

/* ---------- 页脚 & 语言切换 ---------- */
#site-footer{
  margin-top:28px;
  padding:12px 0 48px;
  border-top:1px solid rgba(0,0,0,.08);
  text-align:center; font-size:12.5px; line-height:1.6;
  color:var(--ink-soft,#64748b);
}
@media (prefers-color-scheme:dark){
  #site-footer{ border-top-color:rgba(255,255,255,.12); color:#9aa4b2; }
}

/* 小屏：语言切换不再绝对定位，避免挡住标题 */
.lang-switch{
  position:absolute; top:8px; right:10px;
  display:flex; gap:6px;
}
@media (max-width:560px){
  .lang-switch{ position:static; margin:8px 0 12px; }
}

.lang-switch button{
  padding:2px 8px; font-size:12px; border:1px solid rgba(0,0,0,.15);
  background:#fff; border-radius:8px; cursor:pointer;
}
.lang-switch button.active{
  border-color:rgba(0,0,0,.35); background:#f2f2f2; font-weight:600;
}
@media (prefers-color-scheme:dark){
  .lang-switch button{ background:#0b1220; color:#e5e7eb; border-color:rgba(255,255,255,.18); }
  .lang-switch button.active{ background:#111a2e; border-color:rgba(255,255,255,.35); }
}

/* ---------- 详情页（proposal.html）补充 ---------- */
.container{ max-width:960px; margin:24px auto 32px; padding:0 16px; }
.crumbs{ margin-bottom:12px; font-size:13px; opacity:.8; }
.crumbs a{ text-decoration:none; }
.p-header{ margin-bottom:16px; }
.p-tag{ display:inline-block; padding:2px 8px; border:1px solid rgba(177,147,90,.6); border-radius:999px; font-size:12px; margin-right:8px; }
.p-title{ margin:6px 0 4px; line-height:1.3; }
.p-meta{ font-size:13px; color:var(--ink-soft,#64748b); margin-bottom:16px; }
.p-meta a{ text-decoration:none; }
.p-sec{ margin:18px 0; }
.p-sec h3{ margin:0 0 8px; font-size:16px; }
.muted{ color:var(--ink-soft,#64748b); }

/* 正文换行显示 */
#p-abstract .p-body,#p-motivation .p-body,#p-rationale .p-body{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;line-break:anywhere;}
#p-abstract .p-body *,#p-motivation .p-body *,#p-rationale .p-body *{min-width:0;overflow-wrap:anywhere;word-break:break-word;}
#p-abstract .p-body a,#p-motivation .p-body a,#p-rationale .p-body a{word-break:break-all;}

/* ---------- 响应式 ---------- */
@media (max-width:1024px){
  .wrap{ padding:0 20px; }
  .card{ padding:20px; }
  /* 桌面->平板的过渡：KVS 左列略缩窄 */
  .kvs{ grid-template-columns:135px 1fr; gap:10px 14px; }
}
@media (max-width:480px){
  .wrap{ padding:0 16px; }
  .card{ padding:16px; }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion:reduce){
  .btn,.links a,.video-title a,.video-card img{ transition:none !important; }
}

/* === 语言感知字体栈（确保 html 上的 lang 正确：zh-CN / zh-TW / en） === */

/* 正文字体 */
html[lang="zh-CN"] body{
  font-family: system-ui, -apple-system,
               "PingFang SC","Noto Sans SC","Source Han Sans SC",
               "Microsoft YaHei", "WenQuanYi Micro Hei",
               sans-serif;
}
html[lang="zh-TW"], html[lang="zh-HK"] body{
  font-family: system-ui, -apple-system,
               "PingFang TC","Noto Sans TC","Source Han Sans TC",
               "Microsoft JhengHei",
               sans-serif;
}
html[lang="en"] body{
  font-family: system-ui, -apple-system, "Inter","Segoe UI","Helvetica Neue", Arial, sans-serif;
}

/* 标题（衬线） */
html[lang="zh-CN"] h1{
  font-family: "Noto Serif SC","Source Han Serif SC","Songti SC", serif;
}
html[lang="zh-TW"], html[lang="zh-HK"] h1{
  font-family: "Noto Serif TC","Source Han Serif TC","PMingLiU", serif;
}
html[lang="en"] h1{
  font-family: Georgia, "Times New Roman", serif;
}

@media (max-width:600px){
/* === 提案列表：小屏单列 + 查看提示垂直居中 === */
.proposals-list{grid-template-columns:1fr!important;}
.proposals-list a,.proposal-link{grid-template-columns:1fr;row-gap:6px;min-width:0;}
.proposals-list .tag{justify-content:flex-start;width:auto;min-width:0;text-align:left;white-space:nowrap;}
.proposals-list .view-hint,.proposal-link .view-hint{justify-self:start;align-self:center;font-size:14px;font-weight:500;opacity:.95;}

/* === 视频展示 === */
.showcase-grid{grid-template-columns:1fr;transform:none;}
.video-card>a{aspect-ratio:16/9;}

/* === 语言切换不遮标题 === */
.lang-switch{position:static;margin:8px 0 12px;}

/* === 小屏收紧间距 + 去角装饰 === */
.wrap{padding:0 16px;}
.card{padding:16px;}
.card::before{display:none;}

}

@media (max-width:900px){
.kvs{display:grid;grid-template-columns:1fr!important;gap:8px 12px;align-items:start;max-width:100%!important;}
.kvs>*,.kvs .kv+div>*,.kvs code{max-width:100%!important;}
.kvs .kv{display:block!important;margin:0;font-weight:600;}
.kvs .kv+div{display:flex!important;flex-direction:column;align-items:flex-start;}
.kvs code{display:block;overflow-wrap:anywhere;word-break:break-all;margin-top:4px;}
.copy-btn{display:inline-block;margin-top:4px;flex:0 0 auto;}
/* 防横向滚动（兜底） */
html,body{overflow-x:clip;}
}

@media (max-width:600px){
  /* 让提案和交易 ID 自动换行 */
  .mono, .proposal-content, .proposal-link, .proposal-link * {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}