/* ============================================================
   用户系统样式(登录注册弹窗 + nav 入口 + 评论区)
   复用 style.css 既有玻璃变量(--glass-* / --brand-main / --text-*),
   与全站暗底粉调玻璃质感保持一致。独立文件,不污染 style.css。
   ============================================================ */

/* ---------- nav 右侧用户入口(注入进 .nav-links 末尾) ---------- */
.user-nav { display: inline-flex; align-items: center; gap: 0.6rem; }
.user-nav-login {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; line-height: 1.2;
  color: var(--text-main); cursor: pointer; white-space: nowrap;
  padding: 0.46rem 1rem; border-radius: 12px;
  background: rgba(255,46,126,0.16);
  border: 1px solid rgba(255,46,126,0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.user-nav-login i, .user-nav-login svg { width: 15px; height: 15px; color: var(--brand-main); flex-shrink: 0; transition: color var(--transition-fast); }
.user-nav-login:hover { background: var(--brand-main); color: #fff; border-color: var(--brand-main); box-shadow: 0 8px 24px rgba(255,46,126,0.4); transform: translateY(-1px); }
.user-nav-login:hover i, .user-nav-login:hover svg { color: #fff; }
.user-nav-me { display: inline-flex; align-items: center; gap: 0.55rem; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-heading); font-size: 0.9rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand-duotone-2), var(--brand-duotone-1));
  box-shadow: 0 0 0 1px var(--border-glass);
  text-transform: uppercase;
}
.user-name { font-size: 0.95rem; color: var(--text-main); max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-logout {
  font-size: 0.8rem; color: var(--text-muted);
  background: none; border: 1px solid var(--border-glass); border-radius: 999px;
  padding: 0.24rem 0.7rem; cursor: pointer; transition: var(--transition-fast);
}
.user-logout:hover { color: var(--brand-main); border-color: var(--brand-main); }

/* ---------- 登录注册弹窗 ---------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; place-items: center;
  background: rgba(3, 2, 6, 0.62);
  backdrop-filter: blur(6px);
  padding: 5vh 1rem;
}
.auth-overlay.open { display: grid; }
.auth-modal {
  position: relative;
  width: 100%; max-width: 400px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
  padding: 2.2rem 1.9rem 2rem;
  animation: authPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes authPop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.auth-close {
  position: absolute; top: 0.9rem; right: 0.9rem;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: none; border: none; color: var(--text-muted); cursor: pointer; border-radius: 8px;
  transition: var(--transition-fast);
}
.auth-close:hover { color: var(--brand-main); background: rgba(255,255,255,0.05); }
.auth-logo { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.12em; color: var(--brand-main); margin-bottom: 0.3rem; }
.auth-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.4rem; }
.auth-tabs { display: flex; gap: 0.4rem; margin-bottom: 1.4rem; background: rgba(255,255,255,0.04); border-radius: 999px; padding: 0.25rem; }
.auth-tab {
  flex: 1; text-align: center; font-size: 0.9rem; color: var(--text-muted);
  background: none; border: none; border-radius: 999px; padding: 0.5rem 0; cursor: pointer; transition: var(--transition-fast);
}
.auth-tab.active { background: var(--brand-main); color: #fff; }
.auth-field { margin-bottom: 0.95rem; }
.auth-field label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.auth-input {
  width: 100%; font-family: var(--font-body); font-size: 0.98rem; color: var(--text-main);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-glass); border-radius: 10px;
  padding: 0.7rem 0.85rem; transition: var(--transition-fast); outline: none;
}
.auth-input:focus { border-color: var(--brand-main); background: rgba(255,255,255,0.06); }
.auth-input::placeholder { color: rgba(255,255,255,0.3); }
.auth-row-nick { display: none; }
.auth-mode-signup .auth-row-nick { display: block; }
.auth-submit {
  width: 100%; margin-top: 0.6rem; font-family: var(--font-heading); font-size: 1rem; color: #fff; font-weight: 600;
  background: linear-gradient(135deg, var(--brand-duotone-2), var(--brand-duotone-1));
  border: none; border-radius: 10px; padding: 0.8rem 0; cursor: pointer; transition: var(--transition-fast);
}
.auth-submit:hover { filter: brightness(1.1); }
.auth-submit:disabled { opacity: 0.6; cursor: default; }
.auth-error { min-height: 1.1rem; margin-top: 0.7rem; font-size: 0.82rem; color: #ff6b8a; text-align: center; }
.auth-note { margin-top: 1rem; font-size: 0.72rem; color: rgba(255,255,255,0.35); text-align: center; line-height: 1.5; }

/* ---------- 评论区 ---------- */
#ptg-comments {
  max-width: 860px; margin: 0 auto; padding: 6vh 4vw 12vh;
}
.cmt-head { display: flex; align-items: baseline; gap: 0.7rem; margin-bottom: 1.6rem; border-top: 1px solid var(--border-glass); padding-top: 5vh; }
.cmt-title { font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2rem); }
.cmt-count { color: var(--text-muted); font-size: 0.95rem; }

.cmt-composer {
  background: var(--bg-glass); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass); border-radius: var(--glass-radius); box-shadow: var(--glass-rim);
  padding: 1.1rem 1.2rem; margin-bottom: 2.2rem;
}
.cmt-textarea {
  width: 100%; min-height: 84px; resize: vertical; font-family: var(--font-body); font-size: 1rem; line-height: 1.5;
  color: var(--text-main); background: rgba(255,255,255,0.03); border: 1px solid var(--border-glass);
  border-radius: 10px; padding: 0.7rem 0.85rem; outline: none; transition: var(--transition-fast);
}
.cmt-textarea:focus { border-color: var(--brand-main); }
.cmt-textarea::placeholder { color: rgba(255,255,255,0.3); }
.cmt-composer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0.7rem; }
.cmt-counter { font-size: 0.78rem; color: var(--text-muted); }
.cmt-submit {
  font-family: var(--font-heading); font-size: 0.95rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--brand-duotone-2), var(--brand-duotone-1));
  border: none; border-radius: 999px; padding: 0.55rem 1.5rem; cursor: pointer; transition: var(--transition-fast);
}
.cmt-submit:hover { filter: brightness(1.1); }
.cmt-submit:disabled { opacity: 0.5; cursor: default; }

.cmt-login-hint {
  background: var(--bg-glass); backdrop-filter: var(--glass-blur);
  border: 1px dashed var(--border-glass); border-radius: var(--glass-radius);
  padding: 1.4rem; text-align: center; margin-bottom: 2.2rem; color: var(--text-muted);
}
.cmt-login-hint button {
  margin-left: 0.5rem; font-size: 0.95rem; color: var(--brand-main);
  background: none; border: none; cursor: pointer; text-decoration: underline; font-family: var(--font-body);
}

.cmt-list { display: flex; flex-direction: column; gap: 1.3rem; }
.cmt-item { display: flex; gap: 0.9rem; }
.cmt-avatar {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-heading); font-weight: 700; color: #fff; text-transform: uppercase;
  background: linear-gradient(135deg, var(--brand-duotone-2), var(--brand-duotone-1));
}
.cmt-body { flex: 1; min-width: 0; }
.cmt-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; }
.cmt-name { font-weight: 600; color: var(--text-main); font-size: 0.95rem; }
.cmt-time { font-size: 0.78rem; color: var(--text-muted); }
.cmt-del {
  margin-left: auto; font-size: 0.76rem; color: var(--text-muted);
  background: none; border: none; cursor: pointer; transition: var(--transition-fast);
}
.cmt-del:hover { color: #ff6b8a; }
.cmt-text { color: rgba(255,255,255,0.82); font-size: 1rem; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.cmt-empty { color: var(--text-muted); text-align: center; padding: 3rem 0; }

@media (max-width: 768px) {
  .user-name { max-width: 5em; }
  .cmt-head { flex-direction: column; gap: 0.2rem; align-items: flex-start; }
}

/* 加入用户区(登录/昵称/退出)后 nav 变宽,中等宽度(769~1100px)桌面横排 nav 会装不下、
   把用户区挤出视口。故把汉堡菜单触发点从 768 提前到 1100:此区间 nav-links(含用户区)
   收进下拉面板,nav 栏只剩 logo+特色入口+汉堡按钮,不再溢出。
   样式与 style.css 的 768px 汉堡完全一致,>1100px 仍是完整桌面 nav。 */
@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem); right: 1.2rem;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.3rem 1.7rem;
    background: rgba(10, 8, 16, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
    min-width: 190px;
  }
  .nav-links.open { display: flex; }
  /* 用户区在竖排面板里单独成行,与导航链接留出间距 */
  .user-nav { padding-top: 0.2rem; }
}
