/* ===== layout.css — 页面骨架与视图布局 ===== */

/* ===== 头部与标题区域 ===== */
.header-section {
  position: relative;
  width: 100%;
  background: #130E18;
  border-radius: 8px 8px 0 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.header-section::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  pointer-events: none;
  z-index: 50;
}
.header-covers {
  position: absolute; inset: 0;
  display: flex;
  z-index: 0;
}
.header-covers img {
  width: 33.33333%; height: 100%;
  object-fit: cover; flex-shrink: 0;
  display: block;
}
.header-gradient {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, var(--theme-grad-start, rgba(19, 14, 24, 0.3)) 0%, var(--theme-grad-end, rgba(19, 14, 24, 1)) 100%);
}
.header-ratio {
  padding-top: 33.33333%;
  position: relative; z-index: 10;
  pointer-events: none;
}
.header-content {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 0px;
  pointer-events: none;
}
#titleInput {
  width: 100%; background: transparent; border: none; outline: none;
  color: #fff; font-size: 32px; font-weight: 800; text-align: center;
  line-height: 1.4; padding: 4px 16px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  pointer-events: auto;
}
#titleInput::placeholder { color: rgba(255,255,255,.4); text-shadow: none; }

/* 悬浮视图切换按钮 */
.btn-view-toggle {
  position: absolute; top: 12px; right: 12px; z-index: 20;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #dfe3f5;
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-view-toggle:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .btn-view-toggle:hover { background: rgba(255,255,255,.16); } }
.btn-view-toggle svg { width: 18px; height: 18px; fill: currentColor; }

/* ===== 视图隔离与卡片容器 ===== */
#viewQuickStart {
  background: linear-gradient(to bottom, var(--theme-vqs-start, #130E18) 0%, #130E18 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 30px 20px 40px;
  flex: 1; display: flex; flex-direction: column;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  margin-top: -1px;
  position: relative; z-index: 2;
}
#viewBracket { display: none; }

/* ===== 视图1：快速开始页布局 ===== */
.qs-state-1 { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; }
.qs-emojis { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.qs-emojis span { font-size: 40px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }
.qs-emojis .emoji-lg { font-size: 70px; transform: translateY(-4px); }

/* 状态 2 与 3 */
.qs-state-2 { display: none; flex-direction: column; }

.qs-r-header { display: flex; flex-direction: column; margin-bottom: 16px; gap: 12px; }
.qs-r-header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.qs-r-progress { font-size: 14px; color: rgba(255,255,255,.8); font-weight: 600; }
.qs-r-progress-bar { height: 2px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; width: 100%; }
#qsProgressFill2 { height: 100%; background: var(--theme-progress, #5b6fc4); width: 0%; transition: width 0.3s; }

.qs-r-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 90px; }
.qs-group-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; overflow: hidden;}
.qs-item-line { font-size: 14px; color: #eef0f8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px;}
.qs-item-idx { color: rgba(255,255,255,.3); font-variant-numeric: tabular-nums; flex: 0 0 22px; text-align: left; }
.qs-item-idx.emoji { color: rgba(255,255,255,1); opacity: 1; }
.qs-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }

#qsActionsWrap { display: none; }

/* ===== 视图2：原版对阵图工具栏及表格 ===== */
.toolbar {
  background: linear-gradient(to bottom, var(--theme-toolbar-start, #130E18) 0%, #130E18 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-top: none;
  border-bottom: none;
  border-radius: 0;
  padding: 8px 12px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  margin-top: -1px;
  position: relative; z-index: 2;
}
.toolbar .hint {
  font-size: 12px; color: rgba(255,255,255,.5); margin-right: auto;
  flex: 1 1 100%; order: 10; line-height: 1.6; margin-top: 6px; margin-bottom: 6px;
}
.toolbar .btn { flex: 0 0 auto; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid rgba(255,255,255,.12);
  border-left: 1px solid rgba(255,255,255,.14);
  border-right: 1px solid rgba(255,255,255,.14);
}
.bracket-wrap { position: relative; background: transparent; display: inline-block; min-width: 100%; }
table { border-collapse: collapse; width: 100%; table-layout: fixed; background: transparent; position: relative; z-index: 1; }
#connectorSvg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
col.c0 { width: 150px; } col.cw { width: 118px; } col.cc { width: 130px; }
thead th { background: transparent; color: #fff; font-size: 13px; font-weight: 700; padding: 7px 4px; border: none; border-bottom: 1px solid rgba(255,255,255,.16); }
tbody td { border: none; height: 36px; text-align: center; font-size: 13px; padding: 0; vertical-align: middle; background: transparent; }
td.seed-cell { background: transparent; padding: 3px 4px; }
.seed-wrap { display: flex; align-items: center; height: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 4px; overflow: hidden; }
.seed-idx { flex: 0 0 26px; font-size: 10px; color: rgba(255,255,255,.4); border-right: 1px dashed rgba(255,255,255,.18); height: 100%; display: flex; align-items: center; justify-content: center; }
.seed-wrap input { flex: 1; width: 100%; height: 100%; border: none; outline: none; text-align: center; font-size: 12.5px; background: transparent; color: #f0f1f8; padding: 0 4px; }
.seed-wrap input::placeholder { color: rgba(255,255,255,.35); }
.seed-wrap input:focus { background: rgba(255,255,255,.12); }
td.node { cursor: pointer; vertical-align: middle; padding: 0 10px; -webkit-tap-highlight-color: transparent; }
td.node[data-r="0"] { font-size: 13px; } td.node[data-r="1"] { font-size: 14.5px; } td.node[data-r="2"] { font-size: 16px; } td.node[data-r="3"] { font-size: 17.5px; } td.node[data-r="4"] { font-size: 19px; } td.node[data-r="5"] { font-size: 21px; }
td.node[data-r="5"] .placeholder { font-size: 12px; }
td.node.champion .node-card { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); flex-direction: column; padding: 6px; }
td.node.champion .champ-icon { display: block; font-size: 26px; line-height: 1.1; }
td.node.champion .champ-name { display: block; margin-top: 2px; }

/* ===== 进度条 ===== */
.progress-line {
  background: rgba(30, 32, 56, 0.7); border: 1px solid rgba(255,255,255,.12);
  border-top: none; border-radius: 0 0 8px 8px; padding: 8px 12px; font-size: 12px;
  color: rgba(255,255,255,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  margin-bottom: 80px;
}
.progress-track { height: 6px; background: rgba(255,255,255,.12); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--theme-progress, #5b6fc4); width: 0%; transition: width .25s; }

/* ===== 悬浮按钮 (FAB) ===== */
.fab-review {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--theme-btn-primary, #5b6fc4); color: #fff; padding: 12px 32px; border-radius: 999px; font-size: 16px; font-weight: 700;
  box-shadow: 0 8px 24px var(--theme-primary-shadow, rgba(10, 20, 60, .4)); cursor: pointer; opacity: 0; pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28), background-color 0.15s, opacity 0.3s; z-index: 1000;
}
.fab-review.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.fab-review:active { transform: translateX(-50%) scale(0.96); }
@media (hover: hover) and (pointer: fine) { .fab-review:hover { background: var(--theme-btn-primary-hover, #6e81d6); } }

/* ===== 移动端布局适配 ===== */
@media (max-width: 640px) {
  #titleInput { font-size: 26px !important; padding-bottom: 4px; }
  .toolbar { gap: 6px; padding: 8px; }
  .toolbar .hint { order: 0; margin-right: 0; margin-bottom: 8px; margin-top: 4px; }
  #btnMore { display: block; }
  .toolbar .more-item { display: none; }
  .toolbar.expanded .more-item { display: block; }
  input, textarea, select { font-size: 16px !important; }
  .seed-wrap input { font-size: 16px; }
  #batchArea { font-size: 16px; }

  .qs-r-list { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 80px; }
  .qs-group-card { padding: 12px 10px; gap: 8px; border-radius: 8px; }
  .qs-item-line { font-size: 14px; gap: 4px; }
  .qs-item-idx { flex: 0 0 18px; font-size: 12.5px; text-align: left; }
}
