:root {
  --bg: #08080a;
  --bg-1: #0e0e12;
  --bg-2: #14141a;
  --line: #23232b;
  --tx: #edeef2;
  --tx-2: #8d8d99;
  --ac: #7c5cff;
  --ac-2: #33e6b0;
  --warn: #ff5c7a;
  --r: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 15px/1.6 -apple-system, "Helvetica Neue", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
input, select, textarea, button { font-family: inherit; color: inherit; }

/* ---------- 工作区视图切换：玩法设计 ↔ 资产库 ----------
   顶栏的紫色已被「返回主页」与「发布」占用，所以这两个视图各用一个专属色：
   玩法设计 = 青绿（逻辑与运行），资产库 = 琥珀（实体与素材）。
   图标在未选中时也保持色相，这样一眼能认出、且与灰色普通按钮区分。 */
.ws-switch {
  display: flex; gap: 4px; padding: 3px; flex: none;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 11px;
}
.ws-tab {
  --c: var(--ac);
  --c-soft: rgba(124, 92, 255, .08);
  --c-dim: rgba(124, 92, 255, .2);
  --c-line: rgba(124, 92, 255, .6);
  position: relative; display: flex; align-items: center; gap: 7px;
  padding: 6px 13px 6px 10px; border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px; font-weight: 600;
  transition: background .16s, border-color .16s, box-shadow .16s;
  white-space: nowrap;
  /* 未选中也用自己的颜色，这样两个入口不点也醒目、且与顶栏灰按钮区分 */
  color: var(--c);
  background: var(--c-soft);
}
.ws-tab[data-view="design"] {
  --c: #33e6b0;
  --c-soft: rgba(51, 230, 176, .09);
  --c-dim: rgba(51, 230, 176, .2);
  --c-line: rgba(51, 230, 176, .6);
}
.ws-tab[data-view="assets"] {
  --c: #ff9f45;
  --c-soft: rgba(255, 159, 69, .1);
  --c-dim: rgba(255, 159, 69, .22);
  --c-line: rgba(255, 159, 69, .6);
}

/* 当前视图靠更实的底色 + 边框 + 左侧指示条来区分，而不是靠"另一个变暗" */
.ws-tab:hover { background: var(--c-dim); }
.ws-tab.on {
  background: var(--c-dim);
  border-color: var(--c-line);
  box-shadow: inset 0 0 0 1px var(--c-soft), 0 1px 8px var(--c-soft);
}
/* 当前视图左侧的实心指示条 */
.ws-tab.on::before {
  content: ""; position: absolute; left: 4px; top: 50%;
  width: 3px; height: 13px; margin-top: -6.5px;
  border-radius: 2px; background: var(--c);
}
.ws-tab.on { padding-left: 14px; }

.ws-ico { display: flex; width: 18px; height: 18px; color: var(--c); }
.ws-ico svg { width: 100%; height: 100%; }
.ws-tab.on .ws-ico { filter: drop-shadow(0 0 5px var(--c-dim)); }

.ws-badge {
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; font-style: normal; font-size: 10.5px;
  font-family: var(--mono); font-weight: 600;
  background: var(--c); color: #10101a;
}

@media (max-width: 900px) {
  .ws-label { display: none; }
  .ws-tab { padding: 6px 10px; }
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 26px;
  padding: 0 22px; height: 58px;
  background: rgba(8, 8, 10, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.03em; }
.logo i {
  width: 20px; height: 20px; border-radius: 6px;
  background: linear-gradient(135deg, var(--ac), var(--ac-2));
}
.nav-links { display: flex; gap: 20px; font-size: 14px; color: var(--tx-2); }
.nav-links a { position: relative; }
.nav-links a:hover, .nav-links a.on { color: var(--tx); }
.nav-badge {
  position: absolute; top: -9px; left: 100%; margin-left: 3px;
  padding: 1px 5px; border-radius: 20px;
  font-size: 9.5px; font-style: normal; font-weight: 600; color: #fff; white-space: nowrap;
}
.burger { display: none; background: none; border: 0; font-size: 18px; cursor: pointer; padding: 0; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #3a3a48, #1c1c24);
  border: 1px solid var(--line);
}

/* ---------- atoms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg-2);
  font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: .16s;
}
.btn:hover { border-color: #3a3a46; background: #1b1b22; }
.btn.pri { background: linear-gradient(135deg, var(--ac), #5b3ee0); border-color: transparent; font-weight: 600; }
.btn.pri:hover { filter: brightness(1.12); }
.btn.gho { background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 返回主页：全站统一的醒目入口 */
.btn.home {
  padding: 0 15px; font-weight: 600; flex: none;
  background: rgba(124, 92, 255, .14);
  border-color: rgba(124, 92, 255, .5);
  color: #cbbcff;
}
.btn.home b { font-size: 15px; transition: transform .16s; }
.btn.home:hover {
  background: rgba(124, 92, 255, .26);
  border-color: var(--ac); color: #fff;
}
.btn.home:hover b { transform: translateX(-3px); }
.v-sep { width: 1px; height: 20px; background: var(--line); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--bg-1);
  font-size: 11.5px; color: var(--tx-2);
}
.mono { font-family: var(--mono); }
.muted { color: var(--tx-2); }
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); }
.grad-tx {
  background: linear-gradient(100deg, #fff, #b9a7ff 55%, var(--ac-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.field {
  height: 34px; padding: 0 10px; border-radius: 9px;
  background: var(--bg-2); border: 1px solid var(--line); outline: none; font-size: 13.5px;
}
.field:focus { border-color: var(--ac); }

/* ---------- modal / toast ---------- */
.mask {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, .66); backdrop-filter: blur(6px);
}
.mask.on { display: flex; }
.modal { width: 100%; max-width: 620px; max-height: 88vh; overflow: auto; padding: 22px; }
.modal-x { position: absolute; top: 14px; right: 16px; cursor: pointer; color: var(--tx-2); }

#toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 80;
  transform: translate(-50%, 20px);
  padding: 10px 16px; border-radius: 10px;
  background: #1d1d26; border: 1px solid var(--line);
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: .22s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.foot {
  padding: 40px 22px; border-top: 1px solid var(--line);
  color: var(--tx-2); font-size: 13px; text-align: center;
}

/* 后端缺省态 */
#offline {
  display: none; padding: 9px 22px;
  background: rgba(255, 92, 122, .12); border-bottom: 1px solid rgba(255, 92, 122, .4);
  color: #ffb3c1; font-size: 13px;
}
#offline.on { display: flex; align-items: center; gap: 10px; }
#offline .btn { margin-left: auto; }

/* ---------- 运营通知条（后端下发） ---------- */
#notice {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 22px; font-size: 13px;
  background: linear-gradient(90deg, rgba(124, 92, 255, .22), rgba(51, 230, 176, .14));
  border-bottom: 1px solid var(--line);
}
#notice .nb {
  padding: 2px 8px; border-radius: 20px; background: var(--ac);
  font-size: 11.5px; font-weight: 600; color: #fff;
}
#notice .nx { margin-left: auto; background: none; border: 0; color: var(--tx-2); cursor: pointer; }
#notice:hover { filter: brightness(1.1); }

/* ---------- 骨架屏 ---------- */
.sk {
  border-radius: var(--r);
  background: linear-gradient(90deg, #14141a 25%, #1d1d26 50%, #14141a 75%);
  background-size: 200% 100%;
  animation: sk 1.3s infinite;
}
@keyframes sk { to { background-position: -200% 0; } }
.sk-card { height: 292px; }
.sk-ch { height: 54px; margin-bottom: 8px; }

/* ---------- 表单 / 分段控件 ---------- */
.fl { display: block; margin: 14px 0; font-size: 12.5px; color: var(--tx-2); }
.fl .field { display: block; width: 100%; margin-top: 6px; color: var(--tx); }
.field.ta { height: auto; min-height: 68px; padding: 9px 10px; resize: vertical; line-height: 1.6; }
.chk { display: block; font-size: 12.5px; margin: 10px 0; color: var(--tx-2); }

/* ---------- 协作 ---------- */
/* 顶栏「申请」按钮上的待办数 */
.dot-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 15px; height: 15px; margin-left: 5px; padding: 0 4px;
  border-radius: 8px; background: var(--warn, #ff6b6b); color: #fff;
  font-size: 10px; font-family: var(--mono); font-weight: 700;
}
/* 项目名后的小标记：改自 xxx / 我 */
.tag-mini {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 5px; background: var(--bg-2); border: 1px solid var(--line);
  font-size: 10.5px; font-style: normal; color: var(--tx-2);
}
.lv .rm { margin-left: 8px; cursor: pointer; color: var(--tx-2); }
.lv .rm:hover { color: var(--warn, #ff6b6b); }
.lv.rq { align-items: flex-start; gap: 12px; }
.lv.rq .btn.sm { margin-left: 5px; }
.field.mini { padding: 2px 6px; font-size: 11.5px; width: auto; }

/* ---------- 用户菜单（三个页面共用） ---------- */
.um { position: relative; }
.um-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 4px; border-radius: 20px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--tx); font-size: 12.5px; font-weight: 550; cursor: pointer;
  transition: border-color .16s, background .16s;
}
.um-btn:hover { border-color: var(--ac); background: var(--bg-1); }
.um-av {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 11.5px; font-weight: 700;
  background: linear-gradient(140deg, var(--ac), #33e6b0); color: #0d0d14;
}
.um-nm { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 208px; padding: 6px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}
.um-hd { padding: 8px 10px 9px; display: flex; flex-direction: column; gap: 2px; }
.um-hd b { font-size: 13.5px; }
.um-hd .muted { font-size: 11px; }
.um-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 10px; font-size: 11.5px; color: var(--tx-2);
}
.um-row b { font-family: var(--mono); font-size: 11px; color: var(--tx); font-weight: 500; }
.um-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.um-item {
  display: block; padding: 7px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--tx-2); cursor: pointer;
}
.um-item:hover { background: var(--bg-2); color: var(--tx); }
.um-item.danger:hover { color: var(--warn, #ff6b6b); }
#um-cloud-badge { font-size: 10px; color: var(--tx-2); white-space: nowrap; }
.um-cloud { padding: 6px 10px; width: min(310px, calc(100vw - 48px)); font-size: 12px; line-height: 1.6; }
.um-cloud p { margin: 5px 0; }
.um-cloud details { margin: 8px 0; }
.um-cloud summary { cursor: pointer; }
#um-cloud-projects { max-height: 220px; overflow-y: auto; }
.um-cloud-project { padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.um-cloud-project span { display: block; color: var(--tx-2); }

/* 文件拖放区（新建资产 / 上传弹窗） */
.drop-zone {
  display: flex; align-items: center; justify-content: center;
  margin-top: 6px; padding: 16px 12px; border-radius: 10px;
  border: 1px dashed #35354a; background: var(--bg-1);
  font-size: 12.5px; color: var(--tx-2); cursor: pointer; text-align: center;
  transition: border-color .16s, background .16s, color .16s;
}
.drop-zone:hover { border-color: var(--ac); color: var(--tx); }
.drop-zone.on { border-color: var(--ac); background: rgba(124, 92, 255, .12); color: var(--tx); }

/* 附件标签（对话框与弹窗共用） */
.attach { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.attach .at {
  display: inline-flex; align-items: center; gap: 6px; max-width: 210px;
  padding: 3px 6px 3px 5px; border-radius: 7px;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--tx-2);
}
.attach .at img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; flex: none; }
.attach .at i {
  width: 20px; height: 20px; flex: none; font-style: normal; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; background: var(--bg-1);
}
.attach .at span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 11px;
}
.attach .at b { flex: none; cursor: pointer; font-weight: 400; padding: 0 2px; }
.attach .at b:hover { color: var(--warn); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  padding: 0 10px; height: 28px; font-size: 12px; cursor: pointer;
  background: transparent; border: 0; color: var(--tx-2);
}
.seg button.on { background: var(--bg-2); color: var(--tx); }

/* 生成中的动画点 */
.dots i {
  display: inline-block; width: 4px; height: 4px; margin-left: 3px; border-radius: 50%;
  background: var(--tx-2); animation: dt 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dt { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------- 移动端导航 ---------- */
@media (max-width: 900px) {
  .nav { gap: 14px; padding: 0 14px; }
  .burger { display: block; }
  #q { display: none; }
  .nav-links {
    position: absolute; top: 58px; left: 0; right: 0; display: none;
    flex-direction: column; gap: 0; padding: 8px 14px;
    background: var(--bg-1); border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .nav-badge { position: static; margin-left: 8px; }
}
