/* 主题变量与全局配色 */
:root {
  color-scheme: dark;
  --bg: #0f1116;
  --panel: #181c24;
  --panel-border: #2a3040;
  --text: #e8ebf2;
  --muted: #a6afc4;
  --btn: #2a3142;
  --btn-hover: #36415a;
  --btn-active: #435074;
  --accent: #7aa2ff;
}

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 页面基础布局 */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 左上角控制面板 */
#panel {
  position: fixed;
  top: 12px;
  left: 12px;
  width: min(520px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
}

#panel h1 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* 转面按钮网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

/* 通用按钮样式 */
button {
  border: 1px solid #3a435b;
  background: var(--btn);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 34px;
}

button:hover {
  background: var(--btn-hover);
}

button:active {
  background: var(--btn-active);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 功能按钮行：打乱/自动还原/复位 */
.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

/* 速度控制区域 */
.speed {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

input[type="range"] {
  width: 190px;
  accent-color: var(--accent);
}

/* 状态文本 */
#status {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  min-height: 20px;
}

/* Three.js 渲染区域 */
#canvas-wrap {
  width: 100%;
  height: 100%;
}