/* ============================================================
   HTML 协作平台 · 设计系统
   风格基调：Linear / Notion 式「冷静生产力」——
   暖灰画布、纸张感文档、柔和层次阴影、克制的紫罗兰主色
   ============================================================ */

:root {
  /* 色板 */
  --bg: #F7F7F5;             /* 页面底 · 暖灰 */
  --canvas: #EDEDEA;         /* 编辑器画布 */
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --border: #E4E4E0;
  --border-strong: #D4D4CF;

  --text: #1C1C1A;
  --text-2: #6E6E69;
  --text-3: #9C9C96;

  --accent: #5B5BD6;         /* 紫罗兰主色 */
  --accent-hover: #4E4EC4;
  --accent-soft: #EEEEFB;
  --accent-border: #C9C9F0;

  --green: #1F9D63;
  --green-soft: #E5F5EC;
  --red: #D6455B;
  --red-soft: #FBEAED;
  --amber: #B7791F;
  --amber-soft: #FCF3E3;

  /* 形状与阴影 */
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(28,28,26,.05), 0 0 0 1px rgba(28,28,26,.04);
  --shadow-md: 0 2px 8px rgba(28,28,26,.07), 0 0 0 1px rgba(28,28,26,.04);
  --shadow-lg: 0 12px 32px -6px rgba(28,28,26,.14), 0 2px 8px rgba(28,28,26,.06), 0 0 0 1px rgba(28,28,26,.04);
  --shadow-pop: 0 20px 48px -10px rgba(28,28,26,.22), 0 4px 12px rgba(28,28,26,.08), 0 0 0 1px rgba(28,28,26,.05);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: #D9D9F7; }

/* ---------------- 基础组件 ---------------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-weight: 500; font-size: 13.5px;
  line-height: 1.4;
  transition: background .13s, box-shadow .13s, color .13s, transform .05s;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(.5px); }
.btn svg { flex: none; }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(75,75,180,.35), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .5; cursor: default; }

.btn-ghost {
  background: transparent; color: var(--text-2);
}
.btn-ghost:hover { background: rgba(28,28,26,.06); color: var(--text); }

.btn-outline {
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { background: var(--surface-2); }

.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn-danger-soft:hover { background: #F6DCE1; }
.btn-green-soft { background: var(--green-soft); color: var(--green); }
.btn-green-soft:hover { background: #D6EEDF; }

.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-icon { padding: 6px; border-radius: var(--r-sm); }

.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  transition: border-color .13s, box-shadow .13s;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-3); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  line-height: 1.5;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-gray { background: rgba(28,28,26,.07); color: var(--text-2); }

.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11.5px; font-weight: 600;
  flex: none;
  user-select: none;
}

/* 开关 */
.switch {
  position: relative; width: 36px; height: 21px; flex: none;
  border-radius: 999px; background: var(--border-strong);
  transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: left .15s;
}
.switch.on { background: var(--accent); }
.switch.on::after { left: 17.5px; }

/* 弹层 */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(28,28,26,.4);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .16s ease;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  width: min(480px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  animation: popIn .18s cubic-bezier(.2,.9,.3,1.2);
}
.modal-head {
  padding: 18px 22px 0;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.modal-head h3 { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; }
.modal-body { padding: 14px 22px 22px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(6px); } }

/* Toast */
#toasts {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #26261F; color: #F5F5F0;
  padding: 9px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .22s cubic-bezier(.2,.9,.3,1.15);
}
.toast.ok::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; }
.toast.warn::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #FBBF24; }
.toast.err::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #F87171; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.95); } }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ============================================================
   首页
   ============================================================ */

.home {
  min-height: 100%;
  display: flex; flex-direction: column;
}
.home-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  max-width: 1060px; width: 100%; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; }
.logo-mark-img {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(75,75,200,.35);
  display: block;
}

.lang-toggle {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 650;
  background: var(--surface); color: var(--text-2);
  box-shadow: var(--shadow-sm);
  letter-spacing: .02em;
}
.lang-toggle:hover { color: var(--accent); box-shadow: var(--shadow-md); }

/* 下拉菜单 */
.menu {
  position: fixed; z-index: 150;
  min-width: 200px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  animation: popIn .14s cubic-bezier(.2,.9,.3,1.15);
}
.menu-label {
  font-size: 11px; font-weight: 650; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 7px 10px 4px;
}
.menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text);
}
.menu-item:hover { background: rgba(28,28,26,.06); }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red-soft); }
.menu-item .mi-check { margin-left: auto; color: var(--accent); font-weight: 700; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ============================================================
   全屏 Shader 首页（1:1 原版动画）+ 液态玻璃创建面板
   ============================================================ */

body.shader-page {
  background: #000;
  min-height: 100vh;
  overflow: hidden;
}
body.shader-page #heroShader {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
}
.overlay-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 10;
  max-width: none;
}

/* 玻璃扩散层：极轻模糊，涟漪只是隔了一层薄玻璃，保留锐度与微光晕 */
.glass-diffuser {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  backdrop-filter: blur(3.5px) saturate(118%);
  -webkit-backdrop-filter: blur(3.5px) saturate(118%);
  background: radial-gradient(ellipse 85% 65% at 50% 45%, rgba(255,255,255,.012), transparent 70%);
}

/* 右下角极简语言切换 */
.lang-min {
  position: fixed; right: 24px; bottom: 22px;
  z-index: 15;
  font-size: 12px; font-weight: 550; letter-spacing: .1em;
  color: rgba(255,255,255,.38);
  padding: 6px 10px;
  transition: color .18s;
}
.lang-min:hover { color: rgba(255,255,255,.85); }

/* 中心舞台 */
.stage {
  position: fixed; inset: 0;
  z-index: 5;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.stage.dimmed { opacity: 0; transform: scale(.97); pointer-events: none; }
.wordmark {
  font-size: clamp(64px, 9vw, 108px);
  font-weight: 650;
  letter-spacing: -.045em;
  color: #fff;
  line-height: 1.05;
  text-shadow: 0 0 60px rgba(120,120,255,.25);
  user-select: none;
}
.stage-tag {
  color: rgba(255,255,255,.55);
  font-size: 15.5px;
  letter-spacing: .02em;
  user-select: none;
}
.start-btn {
  pointer-events: auto;
  margin-top: 26px;
  padding: 13px 52px;
  border-radius: 999px;
  font-size: 16.5px; font-weight: 600; letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 36px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.start-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(160deg, rgba(255,255,255,.24), rgba(255,255,255,.10));
  box-shadow: 0 16px 48px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.1), inset 0 1px 0 rgba(255,255,255,.4);
}
.start-btn:active { transform: translateY(0); }

/* 液态玻璃面板 */
.glass-wrap {
  position: fixed; inset: 0;
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.glass-panel {
  width: min(540px, 100%);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  border-radius: 26px;
  padding: 26px 28px 24px;
  color: #F3F3FA;
  background: linear-gradient(150deg, rgba(255,255,255,.15), rgba(255,255,255,.06) 55%, rgba(255,255,255,.10));
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  box-shadow:
    0 32px 90px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(255,255,255,.32),
    inset 0 -1px 0 rgba(255,255,255,.07);
  animation: glassIn .34s cubic-bezier(.2,.9,.3,1.08);
}
@keyframes glassIn {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
}
/* 面板内滚动条：液态玻璃质感（半透明白、细、圆角、悬停增亮） */
.glass-panel { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
.glass-panel::-webkit-scrollbar { width: 8px; }
.glass-panel::-webkit-scrollbar-track { background: transparent; }
.glass-panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.glass-panel::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); background-clip: content-box; }
.glass-panel textarea { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
.glass-panel textarea::-webkit-scrollbar { width: 8px; }
.glass-panel textarea::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 999px; }

.gp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.gp-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.gp-close {
  width: 30px; height: 30px; border-radius: 50%;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.08);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.gp-close:hover { background: rgba(255,255,255,.18); color: #fff; }

.gp-label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: rgba(255,255,255,.6);
  margin-bottom: 7px;
}
.gp-input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.gp-input::placeholder { color: rgba(255,255,255,.38); }
.gp-input:focus {
  border-color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.13);
  box-shadow: 0 0 0 4px rgba(255,255,255,.08);
}

.gp-drop {
  margin-top: 14px;
  border: 1.5px dashed rgba(255,255,255,.3);
  border-radius: 16px;
  padding: 26px 18px;
  text-align: center;
  color: rgba(255,255,255,.75);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.gp-drop strong { color: #fff; }
.gp-drop:hover, .gp-drop.drag { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.07); }
.gp-drop.has-file { border-style: solid; border-color: rgba(134,239,172,.7); background: rgba(134,239,172,.1); }
.gp-drop-hint { font-size: 12px; color: rgba(255,255,255,.42); margin-top: 5px; }

.gp-assets { margin-top: 12px; }
.gp-assets-btn {
  font-size: 12.5px; font-weight: 550;
  color: rgba(255,255,255,.78);
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  transition: background .15s;
}
.gp-assets-btn:hover { background: rgba(255,255,255,.15); }
.gp-assets-btn.has-assets { color: #A7F3C8; border-color: rgba(134,239,172,.4); }
.gp-assets .gp-drop-hint { margin-top: 6px; }

.gp-details { margin-top: 12px; }
.gp-details summary { font-size: 12.5px; color: rgba(255,255,255,.55); cursor: pointer; user-select: none; }

.gp-actions {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.gp-sample { font-size: 12.5px; color: rgba(255,255,255,.5); }
.gp-sample button { color: #B8B8FF; font-weight: 500; }
.gp-sample button:hover { text-decoration: underline; }

.gp-recent { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.gp-recent-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  text-decoration: none; color: #EDEDF8;
  transition: background .14s;
}
.gp-recent-item:hover { background: rgba(255,255,255,.09); }
.gp-recent-item .ri-name { font-size: 13.5px; font-weight: 600; }
.gp-recent-item .ri-meta { font-size: 11.5px; color: rgba(255,255,255,.45); }
.gp-recent-item .ri-go { margin-left: auto; color: rgba(255,255,255,.4); }

/* —— 深色 Shader Hero（旧版式样式，品牌页等处保留基础类） —— */
.hero-dark {
  position: relative;
  background: #0E0E1C radial-gradient(ellipse 70% 60% at 50% 30%, #1B1B38, #0E0E1C 75%); /* WebGL 不可用时的兜底 */
  overflow: hidden;
  padding-bottom: 120px;
}
#heroShader {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero-veil {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 52% at 50% 42%, rgba(10,10,26,.46), rgba(10,10,26,0) 74%),
    linear-gradient(rgba(10,10,26,.28), rgba(10,10,26,0) 26%);
}
.hero-dark .home-nav, .hero-dark .hero { position: relative; z-index: 1; }

.home-nav.on-dark .logo { color: #F2F2FA; }
.badge-dark {
  background: rgba(255,255,255,.10); color: #C6C6DC;
  backdrop-filter: blur(4px);
}
.lang-toggle-dark {
  background: rgba(255,255,255,.12); color: #E4E4F2;
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.lang-toggle-dark:hover { background: rgba(255,255,255,.2); color: #fff; box-shadow: none; }

.hero {
  max-width: 1060px; width: 100%; margin: 0 auto;
  padding: 60px 32px 40px;
  text-align: center;
}
.hero h1 {
  font-size: 42px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2;
  color: #F5F5FC;
  text-shadow: 0 2px 24px rgba(10,10,26,.8);
}
.hero h1 em { font-style: normal; color: #A5A5F5; }
.hero p {
  margin-top: 14px; color: #B3B3C9; font-size: 16px;
  max-width: 560px; margin-left: auto; margin-right: auto;
  text-shadow: 0 1px 12px rgba(10,10,26,.9);
}

/* 创建卡片跨在明暗交界处 */
.create-zone.raised {
  margin-top: -86px;
  position: relative; z-index: 2;
  box-shadow: var(--shadow-lg);
}

.create-zone {
  max-width: 720px; width: calc(100% - 64px); margin: 26px auto 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 26px;
  text-align: left;
}
.create-zone .field-label {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 7px; display: block;
}
.dropzone {
  margin-top: 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 30px 20px;
  text-align: center;
  color: var(--text-2);
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { font-size: 26px; margin-bottom: 6px; }
.dropzone strong { color: var(--text); font-weight: 600; }
.dropzone .dz-hint { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--green-soft); color: var(--green); }

.create-actions {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sample-link { font-size: 13px; color: var(--text-2); }
.sample-link button { color: var(--accent); font-weight: 500; text-decoration: none; }
.sample-link button:hover { text-decoration: underline; }

.feature-row {
  max-width: 860px; margin: 44px auto 0; padding: 0 32px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.feature {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.feature .f-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 10px;
}
.feature h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.feature p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

.recent {
  max-width: 720px; width: calc(100% - 64px); margin: 40px auto 60px;
}
.recent h2 { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
.recent-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 13px 16px;
  margin-bottom: 8px;
  text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.recent-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.recent-item .ri-icon {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.recent-item .ri-name { font-weight: 600; font-size: 14px; }
.recent-item .ri-meta { font-size: 12px; color: var(--text-3); }
.recent-item .ri-go { margin-left: auto; color: var(--text-3); }

.home-foot {
  margin-top: auto; padding: 24px; text-align: center;
  color: var(--text-3); font-size: 12.5px;
}

@media (max-width: 720px) {
  .feature-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
}

/* ============================================================
   项目工作台
   ============================================================ */

.workspace {
  height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* —— 顶栏 —— */
.topbar {
  height: 52px; flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 14px;
  gap: 10px;
  z-index: 50;
}
.topbar .tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar .tb-right { display: flex; align-items: center; gap: 8px; }

.tb-home {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(75,75,200,.3);
  transition: transform .15s, box-shadow .15s;
}
.tb-home img { display: block; border-radius: 8px; }
.tb-home:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(75,75,200,.4); }
.proj-name {
  font-weight: 650; font-size: 14.5px; letter-spacing: -.01em;
  padding: 4px 8px; border-radius: 6px;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid transparent;
}
.proj-name[contenteditable="true"]:hover { background: var(--surface-2); }
.proj-name[contenteditable="true"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }

.mode-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 4px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  background: rgba(28,28,26,.055); color: var(--text-2);
  transition: background .15s, color .15s;
  cursor: default;
}
.mode-pill.owner-togglable { cursor: pointer; }
.mode-pill.on { background: var(--amber-soft); color: var(--amber); }
.mode-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }

/* 审阅/互动 分段切换 */
.view-seg {
  display: flex; gap: 2px;
  background: rgba(28,28,26,.07);
  border-radius: 8px; padding: 2px;
  margin-right: 4px;
}
.view-seg button {
  padding: 4px 13px;
  border-radius: 6px;
  font-size: 12.5px; font-weight: 550;
  color: var(--text-2);
  transition: background .13s, color .13s;
}
.view-seg button:hover { color: var(--text); }
.view-seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

.presence { display: flex; align-items: center; margin-right: 4px; }
.presence .avatar { margin-left: -7px; border: 2px solid var(--surface); width: 28px; height: 28px; }
.presence .avatar:first-child { margin-left: 0; }
.presence .more { margin-left: -7px; background: var(--border); color: var(--text-2); border: 2px solid var(--surface); }

/* —— 主区 —— */
.main {
  flex: 1; display: flex; min-height: 0;
}

/* 画布 */
.canvas {
  flex: 1; min-width: 0;
  background: var(--canvas);
  overflow: auto;
  position: relative;
  padding: 28px 36px 60px;
}
.sheet {
  max-width: 940px; margin: 0 auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(28,28,26,.09), 0 8px 28px -8px rgba(28,28,26,.13), 0 0 0 1px rgba(28,28,26,.045);
  overflow: hidden;
  position: relative;
}
.sheet iframe {
  display: block; width: 100%; border: 0;
  min-height: 400px;
}

/* 编辑提示条 */
.canvas-hint {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: center;
  margin: -8px 0 14px;
  pointer-events: none;
}
.canvas-hint span {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12.5px; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px;
}
.canvas-hint kbd {
  font-family: var(--mono); font-size: 11px;
  background: rgba(28,28,26,.06); border-radius: 4px; padding: 1px 5px;
  border: 1px solid var(--border);
}

/* 选中文字的浮动批注按钮（覆盖在 iframe 上，由 JS 定位） */
.float-bubble {
  position: absolute; z-index: 30;
  background: #26261F; color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  display: flex; align-items: center;
  overflow: hidden;
  animation: popIn .15s cubic-bezier(.2,.9,.3,1.2);
}
.float-bubble button {
  padding: 7px 13px; font-size: 13px; font-weight: 500; color: #fff;
  display: flex; align-items: center; gap: 6px;
}
.float-bubble button:hover { background: rgba(255,255,255,.12); }

/* —— 右侧栏 —— */
.sidebar {
  width: 320px; flex: none;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
}
.side-tabs {
  display: flex; gap: 2px; padding: 10px 12px 0;
  border-bottom: 1px solid var(--border);
}
.side-tab {
  padding: 7px 12px 9px;
  font-size: 13px; font-weight: 550; color: var(--text-2);
  border-radius: 7px 7px 0 0;
  position: relative;
  display: flex; align-items: center; gap: 6px;
}
.side-tab:hover { color: var(--text); }
.side-tab.active { color: var(--text); }
.side-tab.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.side-tab .count {
  font-size: 11px; font-weight: 600;
  background: rgba(28,28,26,.08); color: var(--text-2);
  border-radius: 999px; padding: 0 6px; line-height: 1.6;
}
.side-tab.active .count { background: var(--accent-soft); color: var(--accent); }

.side-body { flex: 1; overflow-y: auto; padding: 12px; }

.side-empty {
  text-align: center; color: var(--text-3);
  padding: 44px 20px;
  font-size: 13px; line-height: 1.7;
}
.side-empty .se-icon { font-size: 26px; margin-bottom: 8px; opacity: .6; }

/* 卡片（批注 / 修订共用骨架） */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 13px;
  margin-bottom: 9px;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.card-head .avatar { width: 22px; height: 22px; font-size: 10px; }
.card-head .who { font-size: 13px; font-weight: 600; }
.card-head .when { font-size: 11.5px; color: var(--text-3); margin-left: auto; flex: none; }

.quote {
  font-size: 12px; color: var(--text-2);
  border-left: 2.5px solid var(--amber);
  padding: 2px 0 2px 9px;
  margin-bottom: 7px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card .body-text { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.replies { margin-top: 9px; border-top: 1px solid var(--border); padding-top: 9px; display: flex; flex-direction: column; gap: 8px; }
.reply { display: flex; gap: 8px; }
.reply .avatar { width: 20px; height: 20px; font-size: 9.5px; margin-top: 1px; }
.reply .r-body { font-size: 13px; line-height: 1.55; }
.reply .r-meta { font-size: 11px; color: var(--text-3); }

.reply-box { margin-top: 9px; display: flex; gap: 7px; }
.reply-box input {
  flex: 1; border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 10px; font-size: 13px; outline: none; background: var(--surface-2);
}
.reply-box input:focus { border-color: var(--accent); background: #fff; }

.card-actions { display: flex; gap: 6px; margin-top: 10px; }

/* 修订 diff 展示 */
.diff {
  font-size: 13px; line-height: 1.65;
  border-radius: 7px; background: var(--surface-2);
  padding: 8px 10px;
  word-break: break-word;
}
.diff del {
  color: var(--red); background: var(--red-soft);
  text-decoration: line-through; text-decoration-thickness: 1.5px;
  border-radius: 3px; padding: 0 2px;
}
.diff ins {
  color: var(--green); background: var(--green-soft);
  text-decoration: none;
  border-radius: 3px; padding: 0 2px;
  font-weight: 500;
}
.diff .arrow { color: var(--text-3); margin: 0 5px; }
.diff .ctx { color: var(--text-3); }

/* 待审批批量操作条 */
.bulk-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--amber-soft);
  border: 1px solid #F0E1C2;
  border-radius: var(--r-md);
  padding: 9px 12px;
  margin-bottom: 10px;
  font-size: 12.5px; color: var(--amber); font-weight: 550;
}
.bulk-bar .bb-btns { display: flex; gap: 6px; }

.section-label {
  font-size: 11.5px; font-weight: 650; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 14px 4px 8px;
}
.section-label:first-child { margin-top: 2px; }

/* 活动流 */
.act-item {
  display: flex; gap: 9px; padding: 7px 4px;
  font-size: 12.5px; color: var(--text-2); line-height: 1.5;
}
.act-item .avatar { width: 20px; height: 20px; font-size: 9.5px; margin-top: 1px; }
.act-item b { color: var(--text); font-weight: 600; }
.act-item .when { color: var(--text-3); font-size: 11px; }

/* —— 分享弹窗 —— */
.share-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: 9px;
}
.share-row .sr-icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.share-row .sr-info { flex: 1; min-width: 0; }
.share-row .sr-title { font-size: 13.5px; font-weight: 600; }
.share-row .sr-desc { font-size: 12px; color: var(--text-2); }

/* 名字弹窗 */
.name-modal-body { text-align: center; padding: 6px 26px 26px; }
.name-modal-body .nm-icon {
  width: 52px; height: 52px; margin: 4px auto 12px;
  border-radius: 15px;
  background: linear-gradient(135deg, #6D6DE3, #4B4BC8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 23px;
  box-shadow: 0 6px 18px rgba(75,75,200,.35);
}
.name-modal-body h3 { font-size: 17px; font-weight: 650; }
.name-modal-body p { color: var(--text-2); font-size: 13.5px; margin: 6px 0 16px; }

/* 加载 */
.loading-page {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; color: var(--text-2);
}
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 窄屏：侧栏覆盖式 */
@media (max-width: 900px) {
  .sidebar { position: fixed; right: 0; top: 52px; bottom: 0; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .2s; z-index: 60; }
  .sidebar.open { transform: none; }
}

/* ============================================================
   工作台 · 暗色液态玻璃主题（body.ws-dark）
   冷淡基调：深靛黑画布，白纸文档浮于其上，四周 chrome 全部玻璃化
   ============================================================ */
body.ws-dark {
  --glass: rgba(24, 24, 40, .58);
  --glass-strong: rgba(26, 26, 44, .78);
  --glass-line: rgba(255, 255, 255, .09);
  --glass-line-strong: rgba(255, 255, 255, .16);
  --ink: #ECECF4;
  --ink-2: rgba(236, 236, 244, .58);
  --ink-3: rgba(236, 236, 244, .34);
  background: #0E0E1A;
  color: var(--ink);
}
body.ws-dark .workspace { background: radial-gradient(ellipse 120% 90% at 50% -10%, #16162A, #0E0E1A 60%); }

/* 顶栏 */
body.ws-dark .topbar {
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border-bottom: 1px solid var(--glass-line);
}
body.ws-dark .proj-name { color: var(--ink); }
body.ws-dark .proj-name[contenteditable="true"]:hover { background: rgba(255,255,255,.07); }
body.ws-dark .proj-name[contenteditable="true"]:focus { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); box-shadow: none; }
body.ws-dark .badge-gray { background: rgba(255,255,255,.09); color: var(--ink-2); }
body.ws-dark .mode-pill { background: rgba(255,255,255,.08); color: var(--ink-2); }
body.ws-dark .mode-pill.on { background: rgba(183,121,31,.22); color: #E4B063; }
body.ws-dark .btn-ghost { color: var(--ink-2); }
body.ws-dark .btn-ghost:hover { background: rgba(255,255,255,.09); color: var(--ink); }
body.ws-dark .btn-outline { background: rgba(255,255,255,.08); color: var(--ink); box-shadow: inset 0 0 0 1px var(--glass-line); }
body.ws-dark .btn-outline:hover { background: rgba(255,255,255,.14); }
body.ws-dark .view-seg { background: rgba(255,255,255,.07); }
body.ws-dark .view-seg button { color: var(--ink-2); }
body.ws-dark .view-seg button:hover { color: var(--ink); }
body.ws-dark .view-seg button.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
body.ws-dark .presence .avatar { border-color: rgba(20,20,36,.9); }
body.ws-dark .tb-home { box-shadow: 0 1px 6px rgba(0,0,0,.5); }

/* 画布与纸张 */
body.ws-dark .canvas { background: transparent; }
body.ws-dark .sheet {
  box-shadow: 0 24px 70px -18px rgba(0,0,0,.75), 0 4px 18px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.07);
  border-radius: 8px;
}
body.ws-dark .canvas-hint span {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--glass-line);
}
body.ws-dark .canvas-hint kbd { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color: var(--ink-2); }

/* 侧栏 */
body.ws-dark .sidebar {
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border-left: 1px solid var(--glass-line);
}
body.ws-dark .side-tabs { border-bottom-color: var(--glass-line); }
body.ws-dark .side-tab { color: var(--ink-3); }
body.ws-dark .side-tab:hover, body.ws-dark .side-tab.active { color: var(--ink); }
body.ws-dark .side-tab.active::after { background: #8F8FF0; }
body.ws-dark .side-tab .count { background: rgba(255,255,255,.1); color: var(--ink-2); }
body.ws-dark .side-tab.active .count { background: rgba(143,143,240,.25); color: #B9B9F7; }
body.ws-dark .side-empty { color: var(--ink-3); }
body.ws-dark .section-label { color: var(--ink-3); }

/* 卡片 */
body.ws-dark .card {
  background: rgba(255,255,255,.05);
  border-color: var(--glass-line);
}
body.ws-dark .card:hover { border-color: var(--glass-line-strong); box-shadow: none; }
body.ws-dark .card.active { border-color: rgba(143,143,240,.55); box-shadow: 0 0 0 3px rgba(143,143,240,.14); }
body.ws-dark .card-head .who { color: var(--ink); }
body.ws-dark .card-head .when, body.ws-dark .reply .r-meta { color: var(--ink-3); }
body.ws-dark .card .body-text, body.ws-dark .reply .r-body { color: var(--ink); }
body.ws-dark .quote { color: var(--ink-2); border-left-color: #C89B4B; }
body.ws-dark .replies { border-top-color: var(--glass-line); }
body.ws-dark .reply-box input {
  background: rgba(255,255,255,.07); border-color: var(--glass-line); color: var(--ink);
}
body.ws-dark .reply-box input::placeholder { color: var(--ink-3); }
body.ws-dark .reply-box input:focus { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); }
body.ws-dark .diff { background: rgba(255,255,255,.06); color: var(--ink); }
body.ws-dark .diff del { color: #F09AA8; background: rgba(214,69,91,.18); }
body.ws-dark .diff ins { color: #8FD8B0; background: rgba(31,157,99,.18); }
body.ws-dark .diff .arrow { color: var(--ink-3); }
body.ws-dark .btn-green-soft { background: rgba(31,157,99,.2); color: #8FD8B0; }
body.ws-dark .btn-green-soft:hover { background: rgba(31,157,99,.3); }
body.ws-dark .btn-danger-soft { background: rgba(214,69,91,.18); color: #F09AA8; }
body.ws-dark .btn-danger-soft:hover { background: rgba(214,69,91,.28); }
body.ws-dark .badge-amber { background: rgba(183,121,31,.22); color: #E4B063; }
body.ws-dark .badge-green { background: rgba(31,157,99,.2); color: #8FD8B0; }
body.ws-dark .badge-accent { background: rgba(143,143,240,.2); color: #B9B9F7; }
body.ws-dark .bulk-bar { background: rgba(183,121,31,.14); border-color: rgba(183,121,31,.3); color: #E4B063; }
body.ws-dark .act-item { color: var(--ink-2); }
body.ws-dark .act-item b { color: var(--ink); }
body.ws-dark .act-item .when { color: var(--ink-3); }

/* 弹层 / 菜单 / 输入 */
body.ws-dark .modal-mask { background: rgba(8,8,16,.55); }
body.ws-dark .modal {
  background: var(--glass-strong);
  backdrop-filter: blur(34px) saturate(160%);
  -webkit-backdrop-filter: blur(34px) saturate(160%);
  box-shadow: 0 32px 90px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 1px var(--glass-line);
  color: var(--ink);
}
body.ws-dark .modal-head h3 { color: var(--ink); }
body.ws-dark .modal .input {
  background: rgba(255,255,255,.07); border-color: var(--glass-line); color: var(--ink);
}
body.ws-dark .modal .input::placeholder { color: var(--ink-3); }
body.ws-dark .modal .input:focus { border-color: rgba(255,255,255,.35); box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
body.ws-dark .share-row { border-color: var(--glass-line); }
body.ws-dark .share-row .sr-title { color: var(--ink); }
body.ws-dark .share-row .sr-desc { color: var(--ink-2); }
body.ws-dark .name-modal-body p { color: var(--ink-2); }
body.ws-dark .switch { background: rgba(255,255,255,.18); }
body.ws-dark .switch.on { background: #6D6DE3; }
body.ws-dark .menu {
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 1px var(--glass-line);
}
body.ws-dark .menu-label { color: var(--ink-3); }
body.ws-dark .menu-item { color: var(--ink); }
body.ws-dark .menu-item:hover { background: rgba(255,255,255,.09); }
body.ws-dark .menu-item.danger { color: #F09AA8; }
body.ws-dark .menu-item.danger:hover { background: rgba(214,69,91,.16); }
body.ws-dark .menu-item .mi-check { color: #B9B9F7; }
body.ws-dark .menu-sep { background: var(--glass-line); }
body.ws-dark .toast {
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  color: var(--ink);
  box-shadow: 0 16px 48px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 1px var(--glass-line);
}
body.ws-dark .loading-page { color: var(--ink-2); background: #0E0E1A; }
body.ws-dark .spinner { border-color: rgba(255,255,255,.14); border-top-color: #8F8FF0; }

/* 玻璃滚动条（工作台全局） */
body.ws-dark ::-webkit-scrollbar { width: 9px; height: 9px; }
body.ws-dark ::-webkit-scrollbar-track { background: transparent; }
body.ws-dark ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
  border: 2.5px solid transparent;
  background-clip: content-box;
}
body.ws-dark ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.32); background-clip: content-box; }
body.ws-dark { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }

/* 分享弹窗：色点角色标识与审批开关容器 */
.sr-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin: 0 6px; }
.share-approval {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 12px;
  background: var(--surface-2); border-radius: 10px;
}
body.ws-dark .share-approval { background: rgba(255,255,255,.06); }
body.ws-dark .diff .ctx { color: var(--ink-3); }
