/* 全局基础 */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #333;
  background: #f7f8fa;
  line-height: 1.6;
}
a {
  color: #2563eb;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1, h2, h3, h4 {
  line-height: 1.3;
}
[v-cloak] {
  display: none;
}

/* 布局容器 */
.page {
  min-height: 100vh;
}
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.container.narrow {
  max-width: 720px;
}
.container.wide {
  max-width: 1180px;
}

/* 导航 */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #1f2937;
  padding: 14px 24px;
}
.site-nav .brand {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}
.site-nav .brand:hover {
  text-decoration: none;
  opacity: 0.85;
}
.site-nav .nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.site-nav .nav-links a {
  color: #d1d5db;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.site-nav .nav-links a:hover {
  color: #fff;
  background: #374151;
  text-decoration: none;
}

/* 首页 hero */
.hero {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border-radius: 12px;
  padding: 40px 32px;
  margin: 24px 0;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
}
.hero p {
  margin: 0;
  opacity: 0.92;
}

/* 区块 */
.section {
  margin-bottom: 28px;
}
.section h2 {
  font-size: 20px;
  border-left: 4px solid #2563eb;
  padding-left: 10px;
  margin: 28px 0 16px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 640px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* 文章卡片 */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.post-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  transition: box-shadow 0.2s;
}
.post-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.post-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.post-card h3 a {
  color: #111827;
}
.post-card h3 a:hover {
  color: #2563eb;
  text-decoration: none;
}
.post-card .excerpt {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .cover {
  display: block;
  margin: -18px -18px 12px;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}
.post-card .cover img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}
.post-card .meta {
  color: #9ca3af;
  font-size: 13px;
  display: flex;
  gap: 12px;
}
.post-card.row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}
.post-card.row .cover {
  flex: 0 0 140px;
  margin: 0;
  border-radius: 8px;
}
.post-card.row .cover img {
  width: 140px;
  height: 90px;
  border-radius: 8px;
}
.post-card.row .body {
  flex: 1;
  min-width: 0;
}

/* 列表页 */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 20px;
}
.page-head h1 {
  margin: 0;
  font-size: 26px;
}
.page-head .sub {
  color: #6b7280;
  margin: 4px 0 0;
}
.search-form {
  display: flex;
  gap: 8px;
}
.search-form input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  width: 220px;
}
.search-form button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.filter-label {
  color: #6b7280;
  font-size: 14px;
}
.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 13px;
}
.chip:hover {
  background: #e0e7ff;
  text-decoration: none;
}
.chip.active {
  background: #2563eb;
  color: #fff;
}
.more {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
}
.empty {
  color: #9ca3af;
  padding: 24px 0;
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}
.pagination a {
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}
.page-info {
  color: #6b7280;
  font-size: 14px;
}
.pager {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* 卡片网格（分类页） */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  color: #111827;
}
.card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}
.card h3 {
  margin: 0 0 6px;
}
.card p {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 10px;
}
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
}

/* 标签云 */
.tag-cloud {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-cloud li .chip {
  font-size: 15px;
  padding: 8px 16px;
}

/* 文章详情 */
.article {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
}
.article-head h1 {
  margin: 0 0 10px;
  font-size: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.article-head .meta {
  color: #9ca3af;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.article-cover {
  margin: 20px 0;
}
.article-cover img {
  width: 100%;
  border-radius: 10px;
}
.article-content {
  font-size: 16px;
  color: #374151;
}
.article-content h1, .article-content h2, .article-content h3 {
  margin-top: 24px;
}
.article-content img {
  max-width: 100%;
  border-radius: 8px;
}
.article-content pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
}
.article-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.article-content pre code {
  background: none;
  padding: 0;
}
.article-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}
.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.tag-label {
  color: #6b7280;
  font-size: 14px;
}

/* 登录框 */
.login-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  margin-top: 40px;
}
.login-box h1 {
  margin: 0 0 20px;
  font-size: 22px;
}
.login-box .hint {
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  margin: 16px 0 0;
}

/* 后台表单 */
.post-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.quill-editor {
  width: 100%;
  min-height: 260px;
}
/* 修复 Quill 在 Element Plus 表单内的布局塌缩：
   .el-form-item__content 是 flex 容器（align-items:center），
   Quill 容器默认 flex:0 1 auto 会把宽度收缩成竖向细条（占位符竖排）。
   强制工具栏与容器 flex-basis:100%，配合 flex-wrap:wrap 各占满一整行。 */
.el-form-item__content .ql-toolbar,
.el-form-item__content .quill-editor {
  width: 100%;
  flex: 0 0 100%;
}
.quill-editor .ql-editor {
  min-height: 260px;
}
/* 封面图实时预览 */
.cover-preview {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}
.cover-preview img {
  max-width: 320px;
  max-height: 180px;
  border-radius: 6px;
  border: 1px solid #e4e7ed;
  object-fit: cover;
  background: #f5f7fa;
}
.cover-preview-error {
  color: #f56c6c;
  font-size: 13px;
  line-height: 32px;
}
.mb-3 {
  margin-bottom: 12px;
}

/* 后台文章预览页 */
.preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #f5f7fa;
  border: 1px solid #e4e7ed;
  border-radius: 6px;
}
.preview-label {
  font-weight: 600;
  color: #409eff;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 18px;
}
.badge-draft {
  background: #f4f4f5;
  color: #909399;
  border: 1px solid #e9e9eb;
}
.badge-private {
  background: #fdf6ec;
  color: #e6a23c;
  border: 1px solid #faecd8;
}
.preview-bar .spacer {
  flex: 1;
}
.btn-plain,
.btn-primary {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
  border: 1px solid #dcdfe6;
  color: #606266;
  background: #fff;
}
.btn-primary {
  color: #fff;
  background: #409eff;
  border-color: #409eff;
}
.btn-primary:hover {
  background: #66b1ff;
  border-color: #66b1ff;
}

/* ==================== 游戏中心 ==================== */
.hero-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
}
.hero-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.game-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 26px 22px;
  color: #111827;
  transition: box-shadow 0.2s, transform 0.2s;
}
.game-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
  text-decoration: none;
}
.game-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.game-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.game-card p {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 14px;
  line-height: 1.6;
}
.game-play {
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
}

/* ==================== 21 点对战 ==================== */
.mode-select {
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 40px 32px;
  margin-top: 8px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.game-logo {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}
.mode-select h1 {
  margin: 0 0 12px;
  font-size: 30px;
  letter-spacing: 1px;
  background: linear-gradient(120deg, #1e3a8a, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mode-select .sub {
  color: #64748b;
  line-height: 1.9;
  margin: 0 0 28px;
  font-size: 14px;
}
.mode-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.mode-btn:hover {
  transform: translateY(-2px);
}
.mode-btn[data-tone="blue"] {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.mode-btn[data-tone="green"] {
  background: linear-gradient(135deg, #10b981, #059669);
}
.mode-btn[data-tone="amber"] {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.mode-ico {
  font-size: 22px;
}
.online-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.share-code {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 14px;
  color: #1e3a8a;
  background: linear-gradient(160deg, #eef2ff, #e0e7ff);
  border: 2px dashed #a5b4fc;
  border-radius: 14px;
  padding: 18px 26px;
  margin: 16px auto 14px;
  max-width: 320px;
}
.copy-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.copy-btn:hover {
  filter: brightness(1.08);
}
.err {
  color: #ef4444;
  font-size: 14px;
  margin: 8px 0 0;
}

/* 赌桌 */
.table {
  border-radius: 22px;
  padding: 6px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.35);
  margin-top: 8px;
}
.table-felt {
  background: radial-gradient(ellipse at 50% 30%, #15803d 0%, #14532d 55%, #0f3d24 100%);
  border-radius: 18px;
  padding: 22px 22px 20px;
  border: 2px solid rgba(255, 255, 255, 0.12);
}
.player-row {
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.player-row.active {
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18), 0 8px 20px rgba(0, 0, 0, 0.25);
}
.player-row.me {
  background: rgba(255, 255, 255, 0.06);
}
.player-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.p-name {
  color: #f1f5f9;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.you-tag {
  font-size: 11px;
  color: #fde68a;
  font-weight: 400;
  background: rgba(251, 191, 36, 0.15);
  padding: 1px 8px;
  border-radius: 999px;
}
.badge-status {
  font-size: 12px;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.badge-status.turn {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.18);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.p-sum {
  color: #f8fafc;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.p-sum .sum-unit {
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  margin-left: 2px;
}
.p-sum.bust {
  color: #fca5a5;
}
.bust-tag {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #dc2626;
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 8px;
  animation: pulse 1s infinite;
}

/* 扑克牌 */
.cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 74px;
}
.pcard {
  position: relative;
  width: 52px;
  height: 72px;
  background: linear-gradient(160deg, #ffffff, #f1f5f9);
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid #e2e8f0;
  color: #1e293b;
}
.pcard .ptop {
  position: absolute;
  top: 5px;
  left: 9px;
  font-size: 18px;
  font-weight: 800;
}
.pcard .pbot {
  position: absolute;
  bottom: 5px;
  right: 9px;
  font-size: 18px;
  font-weight: 800;
  transform: rotate(180deg);
}
.pcard.hidden {
  background: repeating-linear-gradient(45deg, #7c3aed, #7c3aed 7px, #8b5cf6 7px, #8b5cf6 14px);
  border: 2px solid #c4b5fd;
}
.pcard.hidden .ptop,
.pcard.hidden .pbot {
  display: none;
}
/* 暗牌翻面动画 */
.pcard.hcard {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, #7c3aed, #7c3aed 7px, #8b5cf6 7px, #8b5cf6 14px);
  border: 2px solid #c4b5fd;
}
.pcard.hcard .pfront {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  display: none;
}
.pcard.hcard .pback {
  font-size: 22px;
  color: #ede9fe;
  font-weight: 700;
}
.pcard.hcard.flipped {
  background: linear-gradient(160deg, #ffffff, #f1f5f9);
  border: 1px solid #e2e8f0;
}
.pcard.hcard.flipped .pfront {
  display: block;
  color: #1e293b;
}
.pcard.hcard.flipped .pback {
  display: none;
}
.card-note {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 6px;
}
.mini-actions {
  margin-top: 6px;
}
.tiny-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}
.tiny-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 操作区 */
.action-bar {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  margin-top: 4px;
}
.turn-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #fde68a;
  margin-bottom: 14px;
}
.turn-hint.dim {
  color: #cbd5e1;
  font-weight: 500;
  opacity: 0.9;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fbbf24;
  animation: pulse 1.2s infinite;
}
.dot.gray {
  background: #94a3b8;
  animation: none;
}
.action-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.act-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}
.act-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.act-btn.hit {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}
.act-btn.stand {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.act-ico {
  font-size: 20px;
}
.drawn-toast {
  margin-top: 12px;
  display: inline-block;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a;
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 14px;
}
.drawn-toast b {
  font-size: 18px;
}
.pop-enter-active {
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pop-leave-active {
  transition: all 0.3s ease;
}
.pop-enter-from,
.pop-leave-to {
  opacity: 0;
  transform: translateY(12px) scale(0.85);
}

/* 结算 */
.result h2 {
  margin: 0 0 12px;
  font-size: 28px;
  color: #fde68a;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.result-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 16px;
  margin-bottom: 18px;
  color: #e2e8f0;
}
.rs {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 18px;
  border-radius: 999px;
}
.rs b {
  color: #fff;
  margin-right: 6px;
}
.vs {
  color: #fbbf24;
  font-weight: 800;
  font-size: 14px;
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
