/* base.css —— reset + 布局 + 通用组件 */

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

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body { padding-bottom: 24px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* 内容区容器（设计稿「响应式」2026-08-19 更新：1440+ Max 1820px，优先边距32px，内容区 1408-1820 适配）
   0-767 手机(边16) / 768-1023 平板(边16) / 1024-1439 全宽(边32) / 1440-1919 Max1820(边32) / ≥1920 Max1820 */
.main {
  width: 100%;
  max-width: 1820px;
  margin: 0 auto;
  padding: 24px 16px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .main { padding: 24px 16px; }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  .main { max-width: none; padding: 24px 32px; }
}

@media (min-width: 1440px) and (max-width: 1919px) {
  .main { max-width: 1820px; padding: 24px 32px; }
}

@media (min-width: 1920px) {
  .main { max-width: 1820px; padding: 24px 32px; }
}

/* Header（Figma：60px 白条，Logo 居左，导航居中，头像居右） */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* 设计稿「生图工具-UI」2026-08-19：导航底色与全局背景一致 #f8f8f8 */
  background: var(--bg);
  /* 设计稿「生图工具-UI」2026-08-19：导航底部黑色线 */
  border-bottom: 1px solid var(--text);
  padding: 0 25px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  height: 28px;
  flex-shrink: 0;
  text-decoration: none;
}

.header-logo-svg {
  height: 24px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* 暗色下 Logo（黑字 SVG）反白（TASK-114） */
:root[data-theme="dark"] .header-logo-svg { filter: invert(1); }

.header-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.header-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 63px;
}

.header-nav a {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  transition: opacity var(--transition);
}

.header-nav a:hover { opacity: 0.6; }
.header-nav a.active { font-weight: 700; }

/* 移动端汉堡菜单（设计稿「响应式」2026-08-19：1280 为移动/PC 导航切换节点） */
.header-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.header-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.header-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header-menu-btn.open span:nth-child(2) { opacity: 0; }
.header-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1279px) {
  .header-menu-btn { display: flex; order: -1; }
  .header-nav {
    display: none;
    /* 2026-09-15 TASK-212（Colin 报障）：
       ① 「展开后字体不可见」= 桌面端的 `left:50% + transform:translateX(-50%)` 只被覆盖了 left/right，
          transform 仍然生效 → 面板整体左移半个屏宽（线上实测 left=-195@390、-384@768），
          链接文字被推出屏幕外 ✗。这里必须显式 `transform: none`。
       ② 「要铺满整个窗口」= 原来的 absolute + 内容高度（实测 339px）只占一条。
          改 `position: fixed` 铺满 header 以下的整窗（`.header` 是 sticky、无 transform/filter，
          不会成为 fixed 的包含块），并允许内部滚动。 */
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    /* 2026-09-15 TASK-212 Colin：菜单项**上下也居中**（面板已是整窗高）。
       `safe center` = 内容超高时退化为从顶部排列，避免 flex 居中 + overflow 把首项顶出可视区。 */
    justify-content: center;
    justify-content: safe center;
    gap: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 99;
  }
  .header-nav.open { display: flex; }
  /* 菜单展开时锁住背景滚动（body 类由 common.js#bindMobileNav 切换） */
  body.menu-open { overflow: hidden; }
  .header-nav a {
    /* 2026-09-15 TASK-212 Colin：菜单项**居中对齐 + 2em 字号** */
    font-size: 2em;
    text-align: center;
    padding: 12px 25px;
  }
  .header-nav a:hover { opacity: 1; background: var(--hover-gray); }
  .header-nav a.active { font-weight: 700; background: var(--hover-gray); }
}

@media (max-width: 640px) {
  .header-logo-text { display: none; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  cursor: pointer;
  padding: 6px 0;
}

.header-user.open .dropdown-menu { display: block; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 6px 0;
  z-index: 200;
}

.dropdown-menu a,
.dropdown-menu .logout-link {
  display: block;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text);
  transition: background var(--transition);
  cursor: pointer;
}

.dropdown-menu a:hover { background: var(--hover-gray); }
.dropdown-menu .logout-link { color: var(--logout-red); }
.dropdown-menu .logout-link:hover { background: var(--hover-gray); }

.header-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-disabled);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: visible;
  flex-shrink: 0;
}

.header-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 全站搜索（TASK-112，2026-09-09 v2 老板要求：白底圆撑开变形为搜索框，非旁挂输入框） */
.header-search {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-search-form {
  display: flex;
  align-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.25s ease, box-shadow var(--transition);
}

.header-search.open .header-search-form {
  width: 260px;
}

.header-search-form:hover {
  box-shadow: var(--shadow-lg);
}

.header-search-input {
  width: 0;
  flex: 0 0 auto;
  opacity: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: opacity 0.2s ease;
}

.header-search.open .header-search-input {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  opacity: 1;
  margin-left: 14px;
}

.header-search-btn {
  width: 34px;
  height: 34px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin-left: auto;
}

.header-search-btn svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .header-search.open .header-search-form { width: 180px; }
}

/* 页脚（Figma：所有页底部） */
.site-footer {
  text-align: center;
  font-size: 14px;
  color: var(--footer-text);
  padding: 40px 0 24px;
}

/* Section */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title { font-size: 20px; font-weight: 700; }

/* ===== 一级页面超大标题（设计稿「生图工具-UI」2026-08-19：中文一行 + 英文一行全大写） ===== */
.page-hero {
  /* 大屏相对字号（设计稿「响应式」：1440+ 相对放大） */
  font-size: clamp(44px, 8vw, 160px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 24px 0 4px;
}
.page-hero-en {
  display: block;
  font-size: 1em;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-top: 2px;
}

/* ===== 分类切换 bar（设计稿：黑线上下分割 / 选中态 #00ce7c / 左对齐 / 最右操作按钮） ===== */
.page-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  border-top: none; /* 2026-09-10 设计稿：去掉筛选栏上方横线（保留下方分隔线） */
  border-bottom: 1px solid var(--text);
  /* bug#24：滚动时冻结筛选栏（作品库/探索/设计师/投票复用）；原 margin-top 并入 padding-top，吸附时背景不透明遮住滚过内容 */
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--bg);
  padding: 30px 0 10px;
  margin: 0 0 24px;
}
.page-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 20px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}
.page-tab:hover { color: var(--green-600); }
.page-tab.active { color: var(--green-600); }
.page-tab-action {
  margin-left: auto;
  background: var(--text);
  color: var(--bg-card);
  border-radius: var(--radius-pill);
  padding: 7px 22px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.page-tab-action:hover { opacity: 0.85; color: var(--bg-card); }

@media (max-width: 768px) {
  .page-tab { font-size: 14px; padding: 6px 14px; }
  .page-tab-action { padding: 6px 16px; font-size: 14px; }
}

/* 区块右上入口（2026-09-10 设计稿）：粗体黑字、无箭头 */
.section-link {
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.section-link svg { width: 15px; height: 12px; }

/* 分类胶囊（Figma：高 40，16px，选中黑底白字） */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 4px;
  margin-bottom: 20px;
}

.cat-tab {
  flex-shrink: 0;
  height: 40px;
  line-height: 40px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 500;
  background: transparent; /* 2026-09-10 设计稿：未选中无圆角矩形底，纯文字 */
  color: var(--text);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: var(--transition);
}

/* tab 选中态（2026-09-10 设计稿）：无填充 + 绿字 + 绿描边胶囊 */
.cat-tab.active {
  background: transparent;
  color: var(--neon);
  border: 1.5px solid var(--neon);
}
.cat-tab:hover:not(.active) { background: var(--border-light); }
.cat-tab.disabled, .cat-tab:disabled { opacity: 0.45; cursor: not-allowed; }
.cat-tab.disabled:hover, .cat-tab:disabled:hover { background: transparent; }

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card-grid.col4 { grid-template-columns: repeat(4, 1fr); }
.card-grid.col2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.col5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1100px) { .card-grid.col4 { grid-template-columns: repeat(3, 1fr); } .card-grid.col5 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 800px) { .card-grid.col4, .card-grid.col2, .card-grid.col5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .card-grid, .card-grid.col4, .card-grid.col2, .card-grid.col5 { grid-template-columns: 1fr; } }

/* Card（2026-08-20 调整：借鉴 awwwards Winners / Recent Sites 卡片——大图 + hover 缩放 + 信息条） */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
  background: var(--border-light);
}

.card-thumb img, .card-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  /* 2026-09-10：图片缺失（404）时浏览器用 alt 文字占位，不再继承 .card-thumb 的 56px，
     否则 alt 会撑满缩略图并压住角标（如结果页名次角标）。正常图片不受影响。 */
  font-size: 14px;
  color: var(--text-muted);
}

.card:hover .card-thumb img,
.card:hover .card-thumb video { transform: scale(1.04); }

.card-thumb.figma::after {
  content: 'Figma';
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  color: var(--on-dark);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
}

.card-thumb-label {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.9);
  font-size: 48px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 设计师主页-参与的项目卡片封面（2026-09-08）：无图，用品类中文名替代，避免白字贴浅灰底 */
.designer-project-thumb { background: var(--border-light); }
.designer-project-cat {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--gold);
  color: var(--gold-text);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

/* 反馈#18：投票小组前三/前20% 作品奖杯角标（缩略图右下角） */
.card-trophy {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.card-body { padding: 14px; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.card-avatar img,
.detail-designer-avatar img,
.designer-profile-avatar img,
.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.detail-designer-avatar,
.designer-profile-avatar,
.comment-avatar { overflow: hidden; }

.card-role {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.card-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.card-title { font-size: 15px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
}

.card-votes { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
/* bug#13：作品库卡片点赞按钮（button 重置 + 选中态） */
button.card-like-btn { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
button.card-like-btn:hover { color: var(--green-600); }
button.card-like-btn.on { color: var(--green-600); font-weight: 600; }
button.card-like-btn:disabled { opacity: 0.5; cursor: default; }
.card-score {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-600);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Buttons */
.btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition);
}

.btn-primary { background: var(--text); color: var(--bg-card); }
.btn-primary:hover { background: var(--text); opacity: 0.85; }
.btn-secondary { background: var(--border-light); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
/* 描边按钮（.btn-outline）：2026-09-11 TASK-135 从页面级复刻上移为设计系统组件。
   关键：底色必须 transparent —— 旧写法用 var(--bg-card)，暗色下卡片本身就是 #111，
   按钮与卡片同色变成「隐形按钮」（老板报障「保存草稿按钮」就是这个）。 */
/* 双类名提权：页面 CSS（如 demand-center.css 自己的 .btn{border:none}）在后加载时会吃掉单类名的描边 */
.btn.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn.btn-outline:hover { border-color: var(--green-600); color: var(--green-600); background: transparent; }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-danger:hover { background: var(--red-200); }
.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 32px; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; align-items: start; }
.form-grid-2 .form-group { margin-bottom: 0; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-100);
}

.form-textarea { resize: vertical; min-height: 80px; }

/* Detail page（Figma 作品展示帧；设计稿「响应式」2026-08-19：随 .main 断点放开，Max 1820px） */
.detail-page { width: 100%; max-width: 1820px; margin: 0 auto; }
.designer-profile { max-width: 1200px; margin: 0 auto; }
.detail-hero { border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; background: var(--border-light); }
.detail-hero-img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  font-size: 80px;
  cursor: zoom-in;
}

.detail-hero-img img,
.detail-hero-img video {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
}

.detail-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-title-lg { font-size: 26px; font-weight: 700; line-height: 1.3; }

.detail-goto-rating {
  height: 40px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.detail-designer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 20px;
}

.detail-designer-avatar {
  width: 69px;
  height: 69px;
  border-radius: 50%;
  background: var(--green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--green-700);
  flex-shrink: 0;
}

.detail-designer-name { font-size: 18px; font-weight: 700; }
.detail-designer-meta { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.detail-designer-link { margin-left: auto; }

.detail-desc-lg { font-size: 15px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 24px; }

.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.detail-tag {
  font-size: 14px;
  padding: 3px 14px;
  height: 26px;
  line-height: 20px;
  border-radius: var(--radius-pill);
  background: var(--border-light);
  color: var(--text-secondary);
}

.detail-tag-best { background: var(--gold-light); color: var(--gold-text); }
.detail-tag-figma { background: var(--figma-bg); color: var(--figma-text); }

.detail-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 600px) { .detail-stats-row { grid-template-columns: repeat(2, 1fr); } }

.detail-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 16px;
  text-align: center;
}

.detail-stat-val { font-size: 28px; font-weight: 700; }
.detail-stat-lbl { font-size: 14px; color: var(--text-muted); margin-top: 6px; }

/* Detail media gallery */
.detail-media-section { margin-bottom: 32px; }
.detail-media-frame {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border-light);
  margin-bottom: 16px;
}
.detail-media-frame:last-child { margin-bottom: 0; }
.detail-media-frame.empty {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-media-img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}
.detail-media-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  background: var(--video-bg);
}
.detail-media-frame.figma {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
}
.detail-media-frame.figma iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
}

/* 新品详情长图（反馈#49/#51）：渐变窗口 + 393×852 手机视口滚动浏览（设计稿 node 1180-1223：外框 1278×956，视口居中上下各约 52px） */
.longimg-window {
  position: relative;
  height: 956px;
  background: linear-gradient(135deg, var(--longimg-grad-start) 0%, var(--longimg-grad-end) 100%);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
}

.longimg-window:last-child { margin-bottom: 0; }

.longimg-viewport {
  width: 393px;
  max-width: 92%;
  height: 852px;
  max-height: calc(100% - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.45) rgba(255, 255, 255, 0.08);
}

.longimg-viewport::-webkit-scrollbar { width: 6px; }
.longimg-viewport::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.08); }
.longimg-viewport::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.45); border-radius: 3px; }

.longimg-img {
  width: 393px;
  max-width: 100%;
  display: block;
}

.longimg-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

@media (max-width: 560px) {
  .longimg-window { height: 720px; }
  .longimg-viewport { width: 92%; height: calc(100% - 100px); }
}

.detail-tag-longimg {
  background: linear-gradient(135deg, var(--longimg-grad-start), var(--longimg-grad-end));
  color: var(--on-dark);
}

/* Designer profile */
.designer-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.designer-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--green-700);
  flex-shrink: 0;
}

.designer-profile-meta { flex: 1; }
.designer-profile-name { font-size: 24px; font-weight: 700; }
/* 2026-08-20：个人主页头像后修改密码入口 */
.profile-password-link {
  display: inline-block;
  font-size: 12px;
  font-weight: 400;
  color: var(--green-600);
  text-decoration: none;
  margin-left: 10px;
  vertical-align: middle;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  white-space: nowrap;
}
.profile-password-link:hover { color: var(--green-600); border-color: var(--green-600); }
.designer-profile-bio { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.designer-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}

@media (max-width: 600px) {
  .designer-profile-stats { grid-template-columns: repeat(2, 1fr); }
  .designer-profile-header { flex-direction: column; text-align: center; }
}

.designer-mosaic {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  aspect-ratio: 16 / 10;
}

.designer-mosaic-main { grid-row: 1 / 3; overflow: hidden; }
.designer-mosaic-sub { overflow: hidden; }

.designer-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.designer-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.designer-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 8px;
}

.designer-info-name { font-size: 15px; font-weight: 700; }

/* 头像在姓名前（反馈#59）：卡片马赛克区全部留给作品预览 */
.designer-info-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.designer-info-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.designer-info-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.designer-info-stat { display: flex; align-items: center; gap: 3px; }

/* Vote panel */
.vote-panel {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.vote-panel-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90vw;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-card);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--border-light);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: var(--border); }

.modal-body { padding: 24px; }

.modal-title { font-size: 16px; font-weight: 700; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.form-field { margin-bottom: 14px; }

.form-field .form-label { display: block; margin-bottom: 6px; }

.form-field select.form-input { width: 100%; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green-500);
}

/* Rating（Figma：10 星，39px，填充 #FFC700，未填充灰） */
.rating-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 28px;
}

.rating-stars {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rating-star {
  width: 39px;
  height: 39px;
  border: none;
  background: transparent;
  color: var(--gray-disabled);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
  padding: 0;
}

.rating-star:hover { transform: scale(1.12); }
.rating-star.active { color: var(--star); }
.rating-star.readonly { cursor: default; }
.rating-star.readonly:hover { transform: none; }

.rating-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* 赞 / 踩（Figma：39×39 双按钮组；赞已投=绿，票用完=灰 #D4D4D4；踩不限次数） */
.vote-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vote-act-btn {
  width: 39px;
  height: 39px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  padding: 0;
}

.vote-act-btn svg { width: 18px; height: 18px; }

.vote-act-btn.up:hover:not(:disabled) { border-color: var(--green-400); background: var(--green-50); }
.vote-act-btn.up.on {
  background: var(--green-400);
  border-color: var(--green-400);
  color: var(--on-dark);
}
.vote-act-btn.up:disabled {
  background: var(--gray-disabled);
  border-color: var(--gray-disabled);
  cursor: not-allowed;
  opacity: 0.7;
}

.vote-act-btn.down:hover { border-color: var(--red); background: var(--red-light); }
.vote-act-btn.down.on {
  background: var(--red);
  border-color: var(--red);
  color: var(--on-dark);
}

/* Results table */
.results-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.results-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--border-light);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
}
.results-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.results-table tr:hover td { background: var(--green-50); }

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  background: var(--border-light);
  color: var(--text-secondary);
}

.rank-1 { background: var(--gold-light); color: var(--gold-text); }
.rank-2 { background: var(--rank-2-bg); color: var(--rank-2-text); }
.rank-3 { background: var(--rank-3-bg); color: var(--rank-3-text); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--border-light);
  color: var(--text-secondary);
}

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.6; }

.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--green-600); }
.breadcrumb-sep { margin: 0 6px; }

.cond-user-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 12px;
}

.status-active { background: var(--green-100); color: var(--badge-green); }
.status-ended { background: var(--border-light); color: var(--text-muted); }
/* 2026-09-10 投票三态：报名中（active + allow_signup）与首页活动口径一致 */
.status-signup { background: var(--status-planning-bg); color: var(--status-planning-text); }

/* 2026-09-10 创建投票·封面上传 */
.vote-cover-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vote-cover-preview { flex: 1 1 240px; min-height: 44px; display: flex; align-items: center; padding: 8px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 12px; background: var(--bg-card); }
.vote-cover-actions { display: flex; gap: 8px; }
.form-hint { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.status-pending { background: var(--gold-light); color: var(--gold-text); }

/* Vote row */
.vote-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.vote-row-thumb {
  width: 60px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
}

.vote-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vote-row-info { flex: 1; min-width: 0; }
.vote-row-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-row-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.vote-row-votes { font-weight: 600; flex-shrink: 0; }

/* Vote option */
.vote-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.vote-option:hover { border-color: var(--green-400); background: var(--green-50); }
.vote-option.selected { border-color: var(--neon); background: var(--green-50); }

.vote-option-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.vote-option.selected .vote-option-check { border-color: var(--neon); background: var(--neon); }

/* Admin */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.admin-card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

/* Admin Dashboard 左右布局（反馈#23） */
.dash {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
}

.dash-main { min-width: 0; }

.dash-side {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  position: sticky;
  top: 80px;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 10px;
}

.dash-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--green-500);
  color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex: none;
}

.dash-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dash-user-name { font-size: 15px; font-weight: 700; }

.dash-user-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dash-menu { display: flex; flex-direction: column; }

.dash-menu-item {
  display: block;
  position: relative;
  padding: 13px 12px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

/* 「活动信息」进行中提醒点（2026-09-10） */
.dash-menu-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: middle;
}

.dash-menu-item:hover { background: var(--border-light); }

.dash-menu-item.active {
  color: var(--green-600);
  font-weight: 700;
  background: var(--green-50);
}

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: static; }
}

/* Auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--toast-bg);     /* 原来是 var(--text)：暗色下 --text=白 → 白底白字 */
  color: var(--toast-fg);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown { from { transform: translateX(-50%) translateY(-20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* toast 状态变体（2026-09-08 复制路径反馈）：成功=绿底、失败=红底，均白字 */
.toast.toast-success { background: var(--green-500, #00ce7c); color: #fff; }
.toast.toast-error { background: var(--red, #dc2626); color: #fff; }

/* 字段级错误（2026-09-09 方案C 创建重名提示）：输入框红框 + 红字 */
.input.field-error, .form-input.field-error, input.field-error, textarea.field-error {
  border-color: var(--red, #dc2626) !important;
  box-shadow: 0 0 0 1px var(--red, #dc2626);
}
.field-error { color: var(--red, #dc2626); font-size: 12px; margin-top: 4px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); grid-column: 1 / -1; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
/* 2026-09-11（TASK-129）：图标改用设计系统 SVG（全站无 emoji），需居中对齐 */
.empty-state-icon svg { display: block; margin: 0 auto; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

/* Comment list */
.comment-list { margin-top: 24px; }
.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.comment-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.comment-content { font-size: 14px; color: var(--text); line-height: 1.6; }

/* Pagination */
/* 分页（2026-09-10 全站统一，见 views/partials/pager.ejs）：居中；‹ [1] 2 3 … 99 100 › */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 8px;
}
.pager .pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.pager .pager-btn:hover { color: var(--text); background: var(--border-light); }
.pager .pager-btn.active {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: var(--text);
  color: var(--bg-card);
  font-weight: 700;
}
.pager .pager-ellipsis { color: var(--text-muted); font-size: 14px; letter-spacing: 1px; }
.pager .pager-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 30px;
  color: var(--text);
  text-decoration: none;
  transition: opacity .15s;
}
.pager .pager-nav:hover { opacity: .6; }
.pager .pager-nav.is-disabled { color: var(--text-muted); opacity: .5; }

/* 旧版分页容器（项目中心列表仍用）：容器保留居中，内部按钮由 .btn 提供 */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 9px; margin-top: 24px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.lightbox img {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  transition: transform 0.1s ease;
  cursor: grab;
}

.lightbox img:active { cursor: grabbing; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  background: rgba(255, 255, 255, 0.15);
  color: var(--on-dark);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 作品图片查看器 · 宫格（2026-09-11 TASK-181）——/works/:id 与活动报名页共用同一套 class
   （服务端 partial work-media-view.ejs / 客户端 MediaView.gridHtml 输出同样的 markup） */
/* 每行固定 3 张（老板 2026-09-11）：一套作品的图按组排、每行 3 张 */
.wmv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wmv-cell { padding: 0; border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; background: var(--hover-gray); cursor: zoom-in; aspect-ratio: 1 / 1; transition: border-color var(--transition); }
.wmv-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--transition); }
.wmv-cell:hover { border-color: var(--border); }
.wmv-cell:hover img { transform: scale(1.04); }
@media (min-width: 1280px) { .wmv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .wmv-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

/* 大图下方缩略图条（2026-09-11 TASK-181）：点缩略图切换大图 */
.lightbox-thumbs { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); display: flex; gap: 8px; max-width: min(92vw, 1200px); overflow-x: auto; padding: 6px; border-radius: var(--radius); background: rgba(0, 0, 0, .45); z-index: 3; }
.lightbox-thumb { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; background: rgba(255, 255, 255, .08); cursor: pointer; transition: border-color var(--transition); }
.lightbox-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox-thumb:hover { border-color: rgba(255, 255, 255, .5); }
.lightbox-thumb.is-on { border-color: var(--green-600); }
@media (max-width: 767px) {
  .lightbox-thumbs { bottom: 52px; gap: 6px; }
  .lightbox-thumb { width: 48px; height: 48px; }
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.3); }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--on-dark);
  font-size: 13px;
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ··· more 菜单（反馈#42：作品管理 / 我的分享 / 作品库通用；#47：hover 样式对齐导航下拉菜单） */
.manage-item { position: relative; }

.manage-more {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s;
}

.manage-item:hover .manage-more,
.method-card:hover .manage-more,
.manage-more.open { opacity: 1; }

.more-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg-card);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  padding: 0 0 4px;
}

.more-menu {
  position: absolute;
  top: 36px;
  right: 0;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  display: none;
  z-index: 200;
}

.manage-more.open .more-menu { display: block; }

.more-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text);
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
}

.more-item:hover { background: var(--hover-gray); }

.more-item.more-danger { color: var(--logout-red); }

.more-item.more-danger:hover { background: var(--hover-gray); }

/* 个人主页五卡（反馈#44） */
.score-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) { .score-cards { grid-template-columns: repeat(2, 1fr); } }

.score-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.score-card-val { font-size: 26px; font-weight: 700; }

.score-card-lbl {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.score-card-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  padding: 2px 6px;
  background: var(--bg-card);
  color: var(--text);
}

/* 右下角悬浮 Bug 反馈入口（反馈#57 设计稿 44×44 圆形白底；反馈#58 位置：距底部 80px、右侧 40px，移动端 16px） */
.bug-float-btn {
  position: fixed;
  right: 40px;
  bottom: 80px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--bug-float-border);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bug-float-btn:hover { transform: scale(1.06); }
.bug-float-btn svg { width: 24px; height: 24px; display: block; }
@media (max-width: 720px) {
  .bug-float-btn { right: 16px; bottom: 16px; }
}

/* ===== 站内通知中心（2026-08-27 内置头像：红点角标 + 二级弹窗） ===== */
/* 头像菜单「通知中心」这一行也要有对应角标（2026-09-11 TASK-157） */
.notify-inline-count { margin-left: 8px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; vertical-align: middle; }
.notify-badge { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; z-index: 10; }
.notify-panel { position: absolute; right: 0; top: calc(100% + 4px); width: 320px; max-height: 420px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); display: none; flex-direction: column; z-index: 500; overflow: hidden; }
.notify-panel.open { display: flex; }
.notify-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.notify-panel-list { overflow-y: auto; max-height: 360px; }
.notify-item { display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; border-bottom: 1px solid var(--border-light); background: none; cursor: pointer; }
.notify-item:hover { background: var(--border-light); }
.notify-item.unread { background: var(--border-light); }
.notify-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notify-item-body { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.notify-empty { padding: 28px 14px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ===== 时间筛选下拉（2026-08-28 设计系统组件 §4）===== */
/* 单入口：当前周期文本 + 箭头；点击弹出面板；顶部 周/月/季/年 维度 tab；tab 下方维度升级切换（周→月→季→年）；主体周期选项列表 */
.period-dropdown { position: relative; display: inline-block; }
.period-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); padding: 7px 12px; font-size: 13px;
  color: var(--text); cursor: pointer; transition: border-color 0.15s;
}
.period-trigger:hover { border-color: var(--text-muted); }
.period-trigger .period-arrow { font-size: 10px; color: var(--text-muted); transition: transform 0.15s; }
.period-dropdown.open .period-trigger .period-arrow { transform: rotate(180deg); }
.period-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 100;
  min-width: 224px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  display: none;
}
.period-dropdown.open .period-panel { display: block; }
.period-dims { display: flex; gap: 4px; padding: 10px 12px 8px; border-bottom: 1px solid var(--border-light); }
.period-dim {
  flex: 1; text-align: center; padding: 5px 0; border-radius: 6px;
  font-size: 13px; color: var(--text-muted); cursor: pointer; border: 1px solid transparent;
  background: none;
}
.period-dim:hover { background: var(--border-light); color: var(--text); }
.period-dim.on { background: var(--text); color: var(--bg-card); font-weight: 600; }
.period-upgrade {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--neon-dark);
  background: var(--green-50); cursor: pointer; border-bottom: 1px solid var(--border-light);
}
.period-upgrade:hover { background: var(--green-100); }
.period-upgrade .period-up-arrow { font-size: 12px; font-weight: 700; }
.period-options { max-height: 260px; overflow-y: auto; padding: 6px; }
.period-opt {
  padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: background 0.12s;
}
.period-opt:hover { background: var(--border-light); }
.period-opt.on { background: var(--text); color: var(--bg-card); font-weight: 600; }

/* ===== 暗色主题补丁（TASK-114，2026-09-09）：页面 CSS 中浅色硬编码的暗色适配 ===== */
:root[data-theme="dark"] .overview-status-chip.review { background: var(--gold-light); color: var(--gold-text); }
:root[data-theme="dark"] .video-stage-card .vs-thumb img { background: var(--chip-bg); }
:root[data-theme="dark"] .upload-existing-item img { background: var(--chip-bg); }
:root[data-theme="dark"] .scope-item:hover { background: var(--chip-bg); }
:root[data-theme="dark"] .tag-pending { background: var(--gold-light); color: var(--gold-text); }
:root[data-theme="dark"] .longimg-mode-toggle.on { background: var(--video-bg); border-color: var(--border); color: var(--text); }
/* 表单控件：暗色下浏览器默认白底黑字须显式接管 */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { color-scheme: dark; }

/* ===== 自定义下拉组件（2026-09-11 从 demand-center.css 抽到全局 base.css，供全站复用）=====
   用法：<select class="form-select select-custom" data-cs-label="标签">…</select>；触发 38px 药丸、hover 变边框色、聚焦绿环、菜单项 hover --hover-gray */
/* 排序下拉前置标签（「排序」放进框内） */
.cs-label { color: var(--text-muted); font-size: var(--fs-xs); margin-right: 3px; flex: none; }
/* ===== 自定义下拉组件（筛选 UI 对齐 2026-09-04：弹层非原生，复用 dropdown-menu 风格） ===== */
.cs { position: relative; display: inline-block; min-width: 118px; }
.cs select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.cs-trigger {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 38px; padding: 0 12px 0 16px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg-card); color: var(--text); font-size: var(--fs-sm); font-family: var(--font);
  cursor: pointer; white-space: nowrap; text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.cs-trigger:hover { border-color: var(--text-muted); }
.cs-trigger:focus-visible, .cs.open .cs-trigger { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px var(--green-100); }
.cs-value { overflow: hidden; text-overflow: ellipsis; }
.cs-chevron { flex: none; color: var(--text-muted); transition: transform .15s ease; }
.cs.open .cs-chevron { transform: rotate(180deg); }
.cs-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; z-index: 120;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 4px; margin: 0; list-style: none;
  max-height: 260px; overflow-y: auto; display: none;
}
.cs.open .cs-menu { display: block; }
/* 可搜索下拉（2026-09-11 TASK-135）：菜单顶部搜索框 + 无匹配空态 + 表单内整宽用法（.cs-block） */
.cs-search-item { position: sticky; top: 0; z-index: 1; background: var(--bg-card); padding: 4px 4px 6px; margin: 0; list-style: none; }
.cs-search {
  width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text); font-size: var(--fs-sm); font-family: var(--font);
}
.cs-search:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px var(--green-100); }
.cs-empty { padding: 10px 12px; font-size: var(--fs-sm); color: var(--text-muted); list-style: none; }
.cs-block { display: block; width: 100%; min-width: 0; }
/* 表单里的下拉（.form-group 内）整宽：药丸圆角在表单里改为与输入框一致的方角 */
.form-group > .cs.cs-block .cs-trigger { border-radius: var(--radius-sm); }
.cs-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.cs-option[aria-selected="true"] { color: var(--green-600); font-weight: 600; }
.cs-option:hover { background: var(--hover-gray); }
.cs-option:focus-visible { outline: none; background: var(--hover-gray); }
.cs-check { flex: none; color: var(--green-600); visibility: hidden; }
.cs-option[aria-selected="true"] .cs-check { visibility: visible; }

/* ===== 2026-09-11 G3 暗色模式专项修复（按 WCAG 对比度实测；浅色模式零改动） ===== */
:root[data-theme="dark"] .card-trophy { background: rgba(42, 42, 42, 0.92); }
:root[data-theme="dark"] .mono,
:root[data-theme="dark"] .tag-gray { background: var(--chip-bg); }
:root[data-theme="dark"] .tag-ok { background: var(--green-50); color: var(--green-600); }
:root[data-theme="dark"] .home-work-rank.is-best,
:root[data-theme="dark"] .task-filter .cat-tab.on,
:root[data-theme="dark"] .pg-btn.on { color: #111111; }
:root[data-theme="dark"] .coord-tier-badge.coord-tier-three,
:root[data-theme="dark"] .btn-danger { color: #f87171; }
:root[data-theme="dark"] .auth-card { background: rgba(28, 28, 28, 0.86); }


/* ===== 导航角标（2026-09-14 Colin）：绿底黑字，用于标记「测试中」等状态 ===== */
.nav-badge-test {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--green-600);   /* 品牌绿 #00CE7C（全站唯一允许的绿） */
  color: #111111;                  /* 黑字 */
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: .2px;
  vertical-align: middle;
  white-space: nowrap;
}
