/* 知识段位操控台样式
 *
 * 只承载新增的首页主区域（.console）、段位窗口（.rankpanel）和紧凑操控台读数条（.logic-grid.compact）。
 * 颜色全部复用 index.html 里已有的设计变量（--panel/--line/--ink/--muted/--accent/--soft 等），
 * 因此深色与浅色主题自动生效；段位能量色由 --tier 在组件内联样式给出。
 *
 * 注意：本文件在 index.html 的内联样式之后加载。为避免覆盖内联样式中已有的断点规则，
 * 这里只声明现有规则没有声明过的属性。
 */

/* ---------- 首页主区域：知识探索入口 与 段位窗口 是两个独立板块 ---------- */

.console {
  display: grid;
  grid-template-columns: minmax(0, 65fr) minmax(288px, 35fr);
  gap: var(--space-md);
  align-items: stretch;
}

/* 知识探索入口（左侧板块）保留自己的圆角与背景，与右侧段位窗口完全分开。 */
.console .hero {
  border-radius: 18px;
}

/* 操控台读数条：复用逻辑格组件，改成不旋转的三格横向读数。 */
.logic-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  transform: none;
  margin-top: 20px;
}

.logic-grid.compact .logic-cell {
  height: auto;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid #0d35201f;
  border-radius: 11px;
  background: #0d35200f;
  color: inherit;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .6px;
}

.logic-grid.compact .logic-cell:first-child {
  grid-column: auto;
  height: auto;
  background: #0d35200f;
  color: inherit;
}

.logic-grid.compact .logic-cell:last-child {
  background: #0d35200f;
}

.logic-grid.compact .logic-cell strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.4px;
}

.logic-grid.compact .logic-cell:first-child strong {
  font-size: 17px;
  letter-spacing: -.4px;
}

/* ---------- 段位窗口（独立板块） ---------- */

.rankpanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 26px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.rankpanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rankpanel-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rankpanel-ident {
  text-align: center;
  min-width: 0;
}

.rankpanel-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
}

.rankpanel-points {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.rankpanel-points b {
  color: var(--ink);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
}

.rankpanel-progress {
  display: grid;
  gap: 9px;
}

.rankbar {
  height: 8px;
  border-radius: 8px;
  background: var(--hover);
  overflow: hidden;
}

.rankbar i {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), var(--tier, var(--accent)));
  transition: width .45s ease;
}

.rankpanel-next {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

.rankpanel-next b {
  color: var(--ink);
  font-weight: 700;
}

.rankpanel-week {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.rankpanel-week b {
  color: var(--accent);
  font-size: 17px;
  font-weight: 800;
}

.rankpanel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rankpanel .note {
  margin: 0;
  font-size: 11px;
}

.rankpanel .link {
  min-height: 44px;
  padding: 0 4px;
  white-space: nowrap;
}

/* ---------- 段位徽章：抽象能量核心 ---------- */

.rankbadge {
  width: 104px;
  height: 104px;
  flex-shrink: 0;
}

.rankbadge svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.rankhalo {
  fill: var(--tier, var(--accent));
  opacity: .16;
}

.rankring {
  fill: none;
  stroke: var(--tier, var(--accent));
  stroke-width: 2;
  opacity: .38;
}

.rankring-outer {
  opacity: .85;
  stroke-width: 2.4;
}

.rankspin {
  fill: none;
  stroke: var(--tier, var(--accent));
  stroke-width: 1.6;
  stroke-dasharray: 3 10;
  opacity: .45;
  transform-box: view-box;
  transform-origin: 60px 60px;
  animation: rankspin 26s linear infinite;
}

.rankcore {
  fill: var(--tier, var(--accent));
}

.rankglyph {
  fill: #0b1410;
  font-size: 30px;
  font-weight: 700;
  text-anchor: middle;
  font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", sans-serif;
}

@keyframes rankspin {
  to { transform: rotate(360deg); }
}

/* ---------- 平板：主区域上下排列，段位窗口横排紧凑显示 ---------- */

@media (max-width: 1150px) {
  .rankpanel { padding: 22px; }
  .rankpanel-name { font-size: 23px; }
  .rankpanel-points b { font-size: 28px; }
  .rankbadge { width: 88px; height: 88px; }
}

@media (max-width: 900px) {
  .console { grid-template-columns: 1fr; }
  .rankpanel { padding: 20px 22px; }
  .rankpanel-body {
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }
  .rankpanel-ident { text-align: left; }
  .rankpanel-points { justify-content: flex-start; }
}

/* ---------- 手机：段位窗口紧凑版，主区域保持单栏上下排列 ---------- */

@media (max-width: 600px) {
  .console { border-radius: 16px; }
  .logic-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
  .logic-grid.compact .logic-cell:first-child { grid-column: span 2; }
  .logic-grid.compact .logic-cell { min-height: 50px; padding: 8px 10px; font-size: 10px; }
  .logic-grid.compact .logic-cell strong { font-size: 15px; }
  .logic-grid.compact .logic-cell:first-child strong { font-size: 15px; }
  .rankpanel { gap: 11px; padding: 18px; }
  .rankpanel-body { gap: 14px; }
  .rankbadge { width: 76px; height: 76px; }
  .rankpanel-name { font-size: 22px; }
  .rankpanel-points b { font-size: 26px; }
  .rankpanel-week { padding-top: 11px; }
  .rankpanel-foot { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .rankspin { animation: none; }
}
