/**
 * Syflow 游戏库 — Steam 风格（强制左右分栏，避免挤成一列）
 */
:root {
  --bg: #1b2838;
  --bg-deep: #171a21;
  --sidebar: #101822;
  --text: #c7d5e0;
  --text-strong: #ffffff;
  --muted: #8f98a0;
  --accent: #66c0f4;
  --green-1: #75b022;
  --green-2: #588a1b;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

/* ===== 登录 ===== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 10%, rgba(102, 192, 244, 0.16), transparent 40%),
    linear-gradient(180deg, #1b2838, #0e141b);
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  background: rgba(23, 26, 33, 0.95);
  border: 1px solid rgba(102, 192, 244, 0.18);
  border-radius: 6px;
  padding: 28px 26px 30px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.steam-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #66c0f4, #1b2838);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
}

.steam-mark.sm {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.brand-row h1 {
  font-size: 22px;
  color: #fff;
}

.brand-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  color: var(--accent);
}

.login-panel input {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 3px;
  padding: 0 12px;
  background: #323e4c;
  color: #fff;
  outline: none;
}

.login-panel button {
  margin-top: 20px;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green-1), var(--green-2));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.err {
  background: rgba(193, 87, 87, 0.15);
  border: 1px solid rgba(193, 87, 87, 0.4);
  color: #f0b4b4;
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 8px;
}

.ok {
  background: rgba(164, 208, 7, 0.12);
  border: 1px solid rgba(164, 208, 7, 0.35);
  color: #d5ef7a;
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 8px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tabs a {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}

.auth-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-tabs a.disabled-link {
  pointer-events: none;
  opacity: 0.45;
}

.login-shell {
  position: relative;
}

.login-panel.blurred {
  filter: blur(1.5px);
  pointer-events: none;
  user-select: none;
}

.lock-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 18, 0.72);
  border-radius: 6px;
  z-index: 5;
}

.lock-mask[hidden] {
  display: none !important;
}

.lock-box {
  text-align: center;
  padding: 20px;
  color: #fff;
}

.lock-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.lock-box h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.lock-box p {
  color: #b7c6d4;
  font-size: 13px;
  line-height: 1.6;
}

.lock-box .countdown {
  margin-top: 12px;
  color: #66c0f4;
  font-size: 15px;
}

.lock-box .countdown strong {
  font-size: 22px;
  color: #fff;
}

body.is-locked {
  overflow: hidden;
}

.auth-form button:disabled,
.auth-form input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== 顶栏：左导航 / 右用户 ===== */
.lib-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}

.topbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #171a21;
  border-bottom: 1px solid #000;
  gap: 24px;
}

.top-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.top-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 22px;
}

.top-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.top-nav a.active,
.top-nav a:hover {
  color: #fff;
}

.top-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.user-pill {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: #2a3f54;
  padding: 5px 12px 5px 5px;
  border-radius: 3px;
  font-size: 13px;
  color: #fff;
}

.user-pill i {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  display: inline-block;
}

.logout {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.logout:hover {
  color: #e28b8b;
}

/* ===== 主体：左游戏库 / 右详情 ===== */
.library-layout {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 0;
  width: 100%;
}

.game-list {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  background: var(--sidebar);
  border-right: 1px solid #000;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.list-head {
  padding: 14px 12px 10px;
  position: sticky;
  top: 0;
  background: var(--sidebar);
  z-index: 2;
}

.list-head .list-title {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.list-head input {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 3px;
  background: #316282;
  color: #fff;
  padding: 0 12px;
  opacity: 0.85;
}

.game-list ul {
  list-style: none;
  padding: 4px 0 24px;
}

.game-list li a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-left: 3px solid transparent;
}

.game-list li a:hover {
  background: rgba(102, 192, 244, 0.08);
}

.game-list li.active a {
  background: rgba(102, 192, 244, 0.16);
  border-left-color: var(--accent);
}

.thumb {
  width: 42px;
  height: 42px;
  border-radius: 3px;
  flex-shrink: 0;
}

.meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta strong {
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.meta small {
  font-size: 11px;
  color: var(--muted);
}

.game-main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  overflow-y: auto;
}

.hero {
  min-height: 320px;
  padding: 48px 48px 40px;
  display: flex;
  align-items: flex-end;
  position: relative;
}

.hero-content {
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.genre {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 42px;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.15;
  font-weight: 700;
}

.sub {
  color: #d7e4ef;
  margin-bottom: 24px;
  font-size: 16px;
}

.actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
}

.play {
  border: 0;
  border-radius: 3px;
  padding: 14px 36px;
  background: linear-gradient(90deg, var(--green-1), var(--green-2));
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(88, 138, 27, 0.35);
}

.play:hover {
  filter: brightness(1.08);
}

.ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  border-radius: 3px;
  padding: 14px 24px;
  cursor: pointer;
  font-size: 15px;
}

.detail-grid {
  display: flex;
  flex-direction: row;
  gap: 28px;
  padding: 28px 48px 12px;
  align-items: flex-start;
}

.about {
  flex: 1;
  min-width: 0;
}

.about h2 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 12px;
}

.about p {
  line-height: 1.75;
  color: var(--text);
  font-size: 14px;
  max-width: 680px;
}

.stats {
  width: 240px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.stat strong {
  color: #fff;
  font-size: 14px;
}

.shot-row {
  display: flex;
  flex-direction: row;
  gap: 14px;
  padding: 16px 48px 48px;
}

.shot {
  flex: 1;
  height: 140px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.empty-hero {
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 仅很窄屏幕才上下堆叠，桌面始终左右 */
@media (max-width: 760px) {
  .topbar {
    padding: 0 14px;
  }

  .library-layout {
    flex-direction: column;
  }

  .game-list {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    max-height: 240px;
  }

  .hero {
    min-height: 240px;
    padding: 28px 20px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .detail-grid,
  .shot-row {
    flex-direction: column;
    padding-left: 20px;
    padding-right: 20px;
  }

  .stats {
    width: 100%;
  }

  .friends-rail.is-open {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-left: none;
    border-top: 1px solid #000;
    max-height: 360px;
  }
}

/* ===== 顶栏消息 / 用户菜单 ===== */
.msg-btn {
  position: relative;
  border: 0;
  background: #2a3f54;
  color: #c7d5e0;
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
}

.msg-btn:hover {
  color: #fff;
}

.msg-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c44;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-menu {
  position: relative;
}

.user-pill-btn {
  border: 0;
  cursor: pointer;
}

.user-pill em {
  font-style: normal;
  color: #8f98a0;
  font-size: 11px;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 240px;
  background: #1b2838;
  border: 1px solid #3d556b;
  border-radius: 4px;
  padding: 12px;
  z-index: 30;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.dd-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
}

.dd-row span {
  color: #8f98a0;
}

.dd-row strong {
  color: #fff;
}

.dd-row .code {
  letter-spacing: 1px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: #66c0f4;
}

.copy-btn {
  width: 100%;
  border: 0;
  border-radius: 3px;
  padding: 8px;
  background: linear-gradient(90deg, #75b022, #588a1b);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.dd-logout {
  display: block;
  text-align: center;
  color: #e28b8b;
  font-size: 13px;
  padding: 6px;
}

/* ===== 右侧好友栏（默认收起，.is-open 展开） ===== */
.friends-rail {
  width: 0;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  background: #121820;
  border-left: 0 solid #000;
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease, min-width 0.22s ease, max-width 0.22s ease, opacity 0.18s ease;
}

.friends-rail.is-open {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  opacity: 1;
  pointer-events: auto;
  border-left: 1px solid #000;
}

.top-nav a.friends-active {
  color: #fff;
}

.friends-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 8px;
}

.friends-head h3 {
  color: #fff;
  font-size: 14px;
}

.friends-head span {
  background: #2a3f54;
  color: #66c0f4;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}

.friends-search {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}

.friends-search input {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 3px;
  background: #316282;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
}

.friends-search button {
  border: 0;
  border-radius: 3px;
  background: #66c0f4;
  color: #1b2838;
  padding: 0 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
}

.search-results {
  margin: 0 12px 8px;
  background: #1b2838;
  border: 1px solid #2a3f54;
  border-radius: 4px;
  max-height: 180px;
  overflow: auto;
}

.sr-empty {
  padding: 12px;
  color: #8f98a0;
  font-size: 12px;
}

.sr-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sr-item i,
.friends-list i,
.req-item i {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.sr-item div,
.friends-list div {
  flex: 1;
  min-width: 0;
}

.sr-item strong,
.friends-list strong {
  display: block;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-item small,
.friends-list small {
  color: #8f98a0;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.sr-item button {
  border: 0;
  background: #5c7e10;
  color: #fff;
  border-radius: 2px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

.friends-list-title {
  padding: 4px 14px 8px;
  color: #8f98a0;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.friends-list {
  list-style: none;
  overflow: auto;
  flex: 1;
  padding-bottom: 16px;
}

.friends-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}

.friends-empty {
  color: #8f98a0;
  font-size: 12px;
  padding: 12px 14px !important;
  display: block !important;
}

/* ===== 消息弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-mask[hidden] {
  display: none !important;
}

.modal-card {
  width: min(480px, 100%);
  background: #1b2838;
  border: 1px solid #3d556b;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #2a3f54;
}

.modal-head h3 {
  color: #fff;
  font-size: 16px;
}

.modal-close {
  border: 0;
  background: transparent;
  color: #8f98a0;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 12px 16px 18px;
  max-height: 360px;
  overflow: auto;
}

.modal-body .muted {
  color: #8f98a0;
  font-size: 13px;
  padding: 12px 0;
}

.req-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.req-text {
  flex: 1;
  min-width: 0;
}

.req-text strong {
  color: #fff;
  font-size: 13px;
}

.req-text small {
  display: block;
  margin-top: 4px;
  color: #8f98a0;
  font-size: 11px;
}

.req-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.req-actions .yes {
  border: 0;
  background: linear-gradient(90deg, #75b022, #588a1b);
  color: #fff;
  border-radius: 2px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.req-actions .no {
  border: 1px solid #666;
  background: transparent;
  color: #c7d5e0;
  border-radius: 2px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(20, 30, 42, 0.95);
  border: 1px solid #3d556b;
  color: #fff;
  padding: 10px 16px;
  border-radius: 4px;
  z-index: 80;
  font-size: 13px;
}

.toast[hidden] {
  display: none !important;
}
