:root {
  --bg: #0b0d10; --bg2: #12151a; --panel: #171b21; --panel2: #1e232b; --line: #2a303a; --line2: #363d49;
  --text: #e6e9ef; --dim: #9aa3b2; --mute: #6b7381;
  --accent: #2dd4bf; --accent2: #14b8a6; --danger: #f87171;
  --c-text: #34d399; --c-image: #60a5fa; --c-video: #a78bfa; --c-audio: #f472b6; --c-note: #facc15;
  --r: 10px; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font: 13px/1.5 "Microsoft YaHei UI", "PingFang SC", "Segoe UI", system-ui, sans-serif; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.ic { flex: none; display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2d333d; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line2); background: var(--panel2); color: var(--text); text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #4a5260; background: #252b34; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #062420; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #5eead4; border-color: #5eead4; }
.btn.danger { background: #3a1d20; border-color: #6b2b2f; color: #fecaca; }
.btn.block { width: 100%; justify-content: center; margin: 4px 0 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; border: 0;
  background: transparent; color: var(--dim); }
.icon-btn:hover { background: #262c35; color: var(--text); }
.icon-btn.active { color: var(--accent); background: rgba(45, 212, 191, .12); }
.input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2); outline: none; }
.input:focus { border-color: var(--accent); }
.input.big { min-height: 320px; resize: vertical; line-height: 1.6; }
kbd { font: 11px/1 Consolas, monospace; padding: 3px 6px; border-radius: 5px; background: #262c35; border: 1px solid var(--line2); color: var(--dim); white-space: nowrap; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-top-color: #062420; border-color: rgba(6, 36, 32, .25); border-top-color: #062420; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 首页 ---------- */
.logo { width: 26px; height: 26px; border-radius: 8px; background: conic-gradient(from 210deg, var(--accent), #60a5fa, #a78bfa, var(--accent)); }
.day { margin: 26px 0 12px; font-size: 13px; color: var(--dim); font-weight: 500; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.canvas-card { position: relative; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; cursor: pointer; transition: .15s; }
.canvas-card:hover { border-color: #3d4655; transform: translateY(-2px); box-shadow: var(--shadow); }
.cc-cover { aspect-ratio: 16 / 10; background: #0f1216; display: grid; place-items: center; overflow: hidden;
  background-image: radial-gradient(#252b33 1px, transparent 1px); background-size: 14px 14px; }
.cc-cover img { width: 100%; height: 100%; object-fit: cover; }
.cc-blank { color: #39414d; }
.cc-info { padding: 10px 12px; }
.cc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 26px; }
.cc-meta { color: var(--mute); font-size: 12px; }
.cc-more { position: absolute; right: 6px; bottom: 14px; }
.canvas-card.new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px;
  border-style: dashed; color: var(--dim); background: transparent; }
.canvas-card.new:hover { color: var(--accent); border-color: var(--accent); }
.home-tip { color: var(--mute); }

/* ---------- 菜单 / 弹窗 / 提示 ---------- */
.menu { position: fixed; z-index: 1000; min-width: 190px; padding: 5px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.menu-item span { flex: 1; }
.menu-item:hover:not(:disabled) { background: #262c35; }
.menu-item.danger { color: var(--danger); }
.menu-item kbd { font-size: 10px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.ic-gap { width: 15px; }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.menu-title { padding: 5px 9px 3px; color: var(--mute); font-size: 11px; }
.modal-wrap { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: rgba(0, 0, 0, .55); animation: fade .15s; }
.modal { max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px 18px; }
.modal-body { padding: 4px 18px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.confirm-text { margin: 4px 0; color: var(--dim); }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 9px; background: #232931; border: 1px solid var(--line2); box-shadow: var(--shadow); transition: .3s; animation: fade .2s; max-width: 560px; }
.toast.error { background: #3a1d20; border-color: #6b2b2f; color: #fecaca; }
.toast.out { opacity: 0; transform: translateY(-8px); }
