:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-card: #0d0d0d;
  --bg-card-hover: #131313;
  --bg-hover: #1a1a1a;
  --border: #1f1f1f;
  --border-strong: #2e2e2e;
  --text: #ededed;
  --text-dim: #8f8f8f;
  --text-faint: #5a5a5a;
  --accent: #0070f3;
  --accent-hover: #3291ff;
  --danger: #e5484d;
  --success: #22c55e;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
iconify-icon { display: inline-block; vertical-align: middle; }

/* ============ 无限符号加载动画 ============ */
.inf-loader {
  display: inline-block;
  width: 40px;
  height: 20px;
  filter: drop-shadow(0 0 10px rgba(237, 237, 237, 0.3));
  flex-shrink: 0;
}
.inf-loader.lg { width: 72px; height: 36px; filter: drop-shadow(0 0 14px rgba(237, 237, 237, 0.4)); }
.inf-loader.sm { width: 26px; height: 13px; filter: drop-shadow(0 0 6px rgba(237, 237, 237, 0.25)); }
.inf-loader.xs { width: 18px; height: 9px; filter: drop-shadow(0 0 4px rgba(237, 237, 237, 0.2)); }

.inf-loader .inf-path {
  fill: none;
  stroke: #ededed;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: inf-draw 1.2s ease-in-out infinite;
}
@keyframes inf-draw {
  0%   { stroke-dashoffset: 300; }
  50%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -300; }
}

.inf-loader.dark .inf-path { stroke: #000; }
.inf-loader.dark { filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.2)); }

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 13px;
}

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 40px;
  color: var(--text-dim);
  font-size: 13px;
}

/* ============ 启动屏 ============ */
#splash {
  position: fixed;
  inset: 0;
  background: #000;
  display: grid;
  place-items: center;
  z-index: 9999;
  transition: opacity 0.4s var(--ease);
}
#splash.hide { opacity: 0; pointer-events: none; }

/* ============ 通用过渡动画 ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.anim-fade { animation: fadeIn 0.25s var(--ease); }
.anim-up { animation: fadeInUp 0.35s var(--ease) backwards; }
.anim-scale { animation: scaleIn 0.2s var(--ease); }
.anim-slide { animation: slideDown 0.2s var(--ease); }

/* ============ 布局 ============ */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  cursor: pointer;
  user-select: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
  background: var(--bg-elev);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }

.brand-badge {
  font-size: 11px;
  color: var(--text-faint);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 500;
}

.topbar-spacer { flex: 1; }

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.15s, background 0.15s;
}
.topbar-status:hover { border-color: var(--border-strong); background: var(--bg-elev); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.2s;
}
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.dot.err { background: var(--danger); box-shadow: 0 0 0 3px rgba(229,72,77,0.15); }

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

/* ============ 团队 / Key 切换器 ============ */
.team-switch { position: relative; margin-bottom: 12px; }

.team-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
}
.team-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.team-avatar {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: linear-gradient(135deg, #2d4a3e, #1a2d24);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #86e8b5;
  flex-shrink: 0;
  border: 1px solid #2d4a3e;
}

.team-info { flex: 1; min-width: 0; }

.team-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.team-chev {
  color: var(--text-faint);
  font-size: 14px;
  transition: transform 0.2s var(--ease);
}
.team-switch.open .team-chev { transform: rotate(180deg); }

.team-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  z-index: 50;
  animation: slideDown 0.18s var(--ease);
  max-height: 320px;
  overflow-y: auto;
}

.team-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.team-menu-item:hover { background: var(--bg-hover); color: var(--text); }
.team-menu-item.active { background: var(--bg-hover); color: var(--text); }

.team-menu-item .k-avatar {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--bg-hover);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}

.team-menu-item .k-name {
  flex: 1; min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-menu-item .k-del {
  width: 20px; height: 20px;
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--text-faint);
  font-size: 13px;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.team-menu-item .k-del:hover { background: rgba(229,72,77,0.15); color: var(--danger); }

.team-menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }

.team-menu-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.team-menu-action:hover { background: var(--bg-hover); color: var(--text); }

/* ============ 导航 ============ */
.nav-group { margin-bottom: 16px; }

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  width: 100%;
  text-align: left;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); transform: translateX(2px); }
.nav-item.active { background: var(--bg-card); color: var(--text); }
.nav-item iconify-icon { font-size: 15px; flex-shrink: 0; }

/* ============ 主内容区 ============ */
.main {
  padding: 32px 40px 80px;
  max-width: 1100px;
  width: 100%;
  animation: fadeIn 0.3s var(--ease);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  animation: fadeInUp 0.35s var(--ease);
}

.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.page-desc { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* ============ 卡片 ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s var(--ease);
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease), opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: #444; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}
.btn-primary:hover { background: #ccc; border-color: #ccc; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-elev); }

.btn-danger {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-danger:hover { color: var(--danger); border-color: var(--danger); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14px; }

.btn.loading { pointer-events: none; opacity: 0.85; }
.btn .btn-loader { display: none; }
.btn.loading .btn-label { display: none; }
.btn.loading .btn-loader { display: inline-flex; align-items: center; }

/* 让 <label> 包 file input 的按钮外观一致 */
.editor-load-btn {
  position: relative;
  cursor: pointer;
}
.editor-load-btn input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ============ 表单 ============ */
.field { margin-bottom: 16px; }

.label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.input, .textarea, .select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s var(--ease), background 0.15s;
  font-size: 13px;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); background: var(--bg-elev); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.textarea {
  resize: vertical;
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, "Cascadia Code", monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

/* ============ 文件 / 文件夹选择按钮 ============ */
.file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.file-picker:hover { border-color: var(--accent); background: var(--bg-elev); }
.file-picker.filled { border-style: solid; border-color: var(--success); background: rgba(34,197,94,0.05); }
.file-picker.processing { border-color: var(--accent); background: var(--bg-elev); }

.file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-hover);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.file-picker:hover .file-picker-icon { color: var(--accent); }
.file-picker.filled .file-picker-icon { color: var(--success); }

.file-picker-body { flex: 1; min-width: 0; }
.file-picker-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.file-picker-sub { font-size: 12px; color: var(--text-dim); }

.file-picker-action {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  transition: background 0.15s, border-color 0.15s;
  pointer-events: none;
  flex-shrink: 0;
}
.file-picker:hover .file-picker-action { background: var(--bg-hover); border-color: #444; }
.file-picker.filled .file-picker-action { color: var(--success); border-color: rgba(34,197,94,0.4); }

input[type="file"]::file-selector-button {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 5px 12px;
  margin-right: 12px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.muted { color: var(--text-faint); }

/* ============ 项目卡片 ============ */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
  animation: fadeInUp 0.4s var(--ease) backwards;
}
.site-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.site-card-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.2s var(--ease);
}
.site-card-main:hover { background: var(--bg-card-hover); }

.site-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
  transition: transform 0.25s var(--ease);
}
.site-card-main:hover .site-thumb { transform: scale(1.06) rotate(-3deg); }

.site-body { flex: 1; min-width: 0; }

.site-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-domain { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; word-break: break-all; }
.site-time { font-size: 13px; color: var(--text-dim); }

.site-status {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1.5px solid var(--success);
  color: var(--success);
  margin-top: 2px;
  font-size: 12px;
}

.site-card-foot {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}

.site-card-foot .btn {
  flex: 1;
  height: 30px;
  font-size: 12.5px;
}

.site-card-foot .btn-primary { flex: 1.2; }

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-weight: 500;
}
.tag.html { color: #e34f26; border-color: #3a1f15; }
.tag.md { color: #7c9cbf; border-color: #1e2a36; }
.tag.project { color: #a78bfa; border-color: #2a1f3d; }

/* ============ 广场 ============ */
.play-tabs {
  margin-bottom: 20px;
}
.play-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.play-tabs button iconify-icon {
  font-size: 14px;
  opacity: 0.85;
}
.play-tabs button.active iconify-icon {
  opacity: 1;
}

.play-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.play-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  animation: fadeInUp 0.35s var(--ease) backwards;
}
.play-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.play-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.play-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3d2a, #1a2d1a);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #9ee89e;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.play-avatar:hover {
  transform: scale(1.06);
}
.play-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-meta {
  flex: 1;
  min-width: 0;
}

.play-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.play-author-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-following {
  color: var(--accent);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

.play-time {
  font-size: 12.5px;
  color: var(--text-dim);
}

.play-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  white-space: nowrap;
}
.play-badge iconify-icon { font-size: 11px; }
.play-badge-site {
  color: #a78bfa;
  border-color: #2a1f3d;
}
.play-badge-text {
  color: #7c9cbf;
  border-color: #1e2a36;
}
.play-badge-mine {
  color: var(--success);
  border-color: #143a1f;
}

.play-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.play-content {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.play-site {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.play-site:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.play-site:active { transform: translateY(0); }

.play-site-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--accent);
  flex-shrink: 0;
}

.play-site-body {
  flex: 1;
  min-width: 0;
}

.play-site-slug {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-site-url {
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-site-arrow {
  color: var(--text-faint);
  font-size: 15px;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
.play-site:hover .play-site-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.play-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.play-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.play-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.play-stats iconify-icon {
  font-size: 13px;
  color: var(--text-faint);
}

/* 点赞的实心心：JS 用 lucide:heart 图标，liked 状态给它加类 */
.play-stats .liked iconify-icon,
.play-stats span.liked iconify-icon {
  color: var(--danger);
  fill: var(--danger);
}

/* ---- 个人资料（我的） ---- */
.play-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  animation: fadeInUp 0.35s var(--ease);
}

.play-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3d2a, #1a2d1a);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 600;
  color: #9ee89e;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}
.play-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-profile-info {
  flex: 1;
  min-width: 0;
}

.play-profile-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-profile-bio {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.6;
  word-break: break-word;
}

.play-profile-stats {
  display: flex;
  gap: 18px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.play-profile-stats strong {
  color: var(--text);
  font-weight: 600;
  margin-right: 3px;
}

/* ============ 空状态 ============ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  animation: fadeIn 0.4s var(--ease);
}
.empty-title { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 6px; }

/* ============ 404 页 ============ */
.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px;
  animation: fadeInUp 0.4s var(--ease);
}
.notfound-code {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(180deg, #ededed 0%, #5a5a5a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}
.notfound-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.notfound-desc {
  font-size: 13.5px;
  color: var(--text-dim);
  max-width: 420px;
  line-height: 1.7;
  margin-bottom: 24px;
}
.notfound-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  margin-bottom: 24px;
  word-break: break-all;
  max-width: 100%;
}

/* ============ 提示条 ============ */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: fadeInUp 0.3s var(--ease);
}
.alert iconify-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert.err { border-color: #4a1515; background: #180a0a; color: #ff8a8a; }
.alert.ok { border-color: #143a1f; background: #0a1a0f; color: #6ee7a0; }
.alert.info { border-color: #14304a; background: #0a1520; color: #7cb8f5; }

/* ============ 登录页 ============ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  animation: scaleIn 0.35s var(--ease);
}

.login-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.login-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.login-desc { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; }

.dep-notice {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.7;
}
.dep-notice-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 6px;
}
.dep-notice-head iconify-icon { font-size: 14px; color: var(--accent); }
.dep-notice a { color: var(--accent); }

.dep-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}
.dep-link:hover {
  background: var(--bg-hover);
  border-color: #444;
  text-decoration: none;
  transform: translateY(-1px);
}
.dep-link:active { transform: translateY(0); }
.dep-link iconify-icon { font-size: 14px; color: var(--accent); }

.dep-url {
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

/* ============ 模态 ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 200;
  animation: fadeIn 0.2s var(--ease);
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: scaleIn 0.25s var(--ease);
}

.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.modal-desc { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============ 分段控件 ============ */
.segmented {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  margin-bottom: 16px;
}
.segmented button {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.segmented button.active { background: var(--bg-hover); color: var(--text); }

/* ============ 全屏视图 ============ */
.fullview {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 150;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.25s var(--ease);
}

.fullview-header {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  background: var(--bg);
  animation: slideDown 0.3s var(--ease);
}

.fullview-back {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.fullview-back:hover { background: var(--bg-hover); color: var(--text); }

.fullview-crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.fullview-crumb .crumb-dim { color: var(--text-faint); }
.fullview-crumb .crumb-sep { color: var(--text-faint); font-size: 12px; }
.fullview-crumb .crumb-cur { color: var(--text); font-weight: 500; }
.fullview-crumb .crumb-link {
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s;
}
.fullview-crumb .crumb-link:hover { color: var(--text); }

.fullview-spacer { flex: 1; }
.fullview-actions { display: flex; gap: 8px; align-items: center; }

.fullview-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px 80px;
  animation: fadeInUp 0.35s var(--ease);
}

.fullview-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============ 生产部署面板 ============ */
.deploy-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeInUp 0.4s var(--ease) backwards;
  animation-delay: 0.05s;
}

.deploy-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; letter-spacing: -0.01em; }

.meta-list { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }

.meta-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  align-items: baseline;
  animation: fadeInUp 0.4s var(--ease) backwards;
}
.meta-row:nth-child(1) { animation-delay: 0.08s; }
.meta-row:nth-child(2) { animation-delay: 0.12s; }
.meta-row:nth-child(3) { animation-delay: 0.16s; }
.meta-row:nth-child(4) { animation-delay: 0.20s; }

.meta-label { font-size: 13px; color: var(--text-dim); }
.meta-value { font-size: 13.5px; color: var(--text); word-break: break-all; }

.meta-link {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
  margin-right: 16px;
}
.meta-link:hover { color: var(--accent-hover); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.status-pill .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ============ 设置面板 ============ */
.settings-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeInUp 0.4s var(--ease) backwards;
  animation-delay: 0.1s;
}

.settings-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.01em; }

.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #4a1515;
  background: #180a0a;
  border-radius: var(--radius-sm);
}

.danger-row .danger-text { flex: 1; min-width: 0; }
.danger-row .danger-text strong { color: #ff8a8a; display: block; margin-bottom: 2px; font-size: 13px; }
.danger-row .danger-text span { color: var(--text-dim); font-size: 12.5px; }

/* ============ 文件列表（详情页只读） ============ */
.file-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeInUp 0.4s var(--ease) backwards;
  animation-delay: 0.08s;
}

.file-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.file-list-title { font-size: 14px; font-weight: 600; }
.file-list-count { font-size: 12px; color: var(--text-faint); }

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  transition: background 0.12s;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg-hover); }
.file-row .fname { flex: 1; min-width: 0; font-family: ui-monospace, monospace; word-break: break-all; color: var(--text); }
.file-row .fsize { color: var(--text-faint); font-size: 12px; flex-shrink: 0; }

/* ============================================================
   编辑器：铺满式布局
   ============================================================ */

.editor-fullscreen {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* ---------- 多文件项目：左文件列表 + 右编辑区 ---------- */
.editor-proj {
  display: grid;
  grid-template-columns: 240px 1fr;
}

.editor-proj-files {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-elev);
  min-height: 0;
}

.proj-file {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  background: transparent;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.proj-file:hover { background: var(--bg-hover); color: var(--text); }
.proj-file.active { background: var(--bg-hover); color: var(--text); }
.proj-file.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}
.proj-file .fname { font-family: ui-monospace, monospace; word-break: break-all; }
.proj-file .fsize { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.editor-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.editor-pane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
  background: var(--bg-elev);
  animation: slideDown 0.25s var(--ease);
  flex-shrink: 0;
}
.editor-pane-head .fpath {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.editor-pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}

.editor-pane-empty {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 40px 20px;
  color: var(--text-dim);
}

/* 底部按钮栏左右分组 */
.editor-foot-left,
.editor-foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 单文件站点 ---------- */
.editor-simple { flex-direction: column; }

.editor-simple-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 0;
}

.editor-pane-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.editor-fullscreen-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  flex-shrink: 0;
}

.editor-textarea-full {
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 16px 20px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, "Cascadia Code", monospace;
  font-size: 13px;
  line-height: 1.65;
  transition: border-color 0.15s var(--ease), background 0.15s;
}
.editor-textarea-full:focus {
  border-color: var(--accent);
  background: var(--bg-elev);
}

.editor-pane .editor-textarea-full {
  border: none;
  border-radius: 0;
  background: var(--bg);
}
.editor-pane .editor-textarea-full:focus {
  border: none;
  background: var(--bg);
}

/* ============ 全局遮罩 ============ */
.global-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s var(--ease);
  cursor: wait;
}

.global-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: scaleIn 0.3s var(--ease);
}

.global-overlay-inner .inf-loader {
  width: 96px;
  height: 48px;
  filter: drop-shadow(0 0 20px rgba(237, 237, 237, 0.5));
}

.global-overlay-text {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.app.blurred,
.fullview.blurred {
  filter: blur(2px);
  pointer-events: none;
  transition: filter 0.25s var(--ease);
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast iconify-icon { font-size: 16px; flex-shrink: 0; }
.toast.err iconify-icon { color: var(--danger); }
.toast.ok iconify-icon { color: var(--success); }
.toast.info iconify-icon { color: var(--accent); }

/* ============ 移动端 ============ */
@media (max-width: 900px) {
  .editor-proj { grid-template-columns: 1fr; grid-template-rows: 200px 1fr; }
  .editor-proj-files { border-right: none; border-bottom: 1px solid var(--border); }
  .fullview-body { padding: 20px 16px 60px; }
  .meta-row { grid-template-columns: 1fr; gap: 4px; }
  .editor-simple-body { padding: 16px 16px 0; }
  .editor-fullscreen-foot { padding: 12px 16px; }

  .play-profile { flex-direction: column; text-align: center; gap: 12px; }
  .play-profile-stats { justify-content: center; }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .nav-group { display: flex; gap: 4px; margin: 0 0 8px 0; flex-wrap: wrap; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; width: auto; }
  .main { padding: 24px 20px 60px; }
  .page-header { flex-direction: column; }
  .topbar { padding: 0 16px; }

  .play-card-head { flex-wrap: wrap; }
  .play-badges { width: 100%; margin-top: 8px; }

  .editor-pane-foot { flex-wrap: wrap; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.hidden { display: none !important; }

/* 登录页 / 侧栏的环境切换滑块 */
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s var(--ease);
}
.segmented button.active {
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}