/*! rana：应用自身样式（布局/表格/画布尺寸等），来自原版 taez/tools/rana/index.html 的 <style>。
 * metro.css 负责外层外观（面板、按钮、页头），本文件只补应用结构与几何，勿随意删减。 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f7f7f7; color: #222; padding: 24px 16px;
}
.wrap { max-width: 900px; margin: 0 auto; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
.sub { color: #888; font-size: 13px; margin: 0 0 20px; }
.panel {
  background: #fff; border: 1px solid #ddd; border-radius: 2px;
  padding: 16px; margin-bottom: 16px;
}
.hidden { display: none !important; }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 10px; color: #333; }
textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 2px;
  font-size: 13px; font-family: inherit; min-height: 100px; resize: vertical;
  background: #fff; color: #222;
}
input[type="text"], input[type="number"] {
  padding: 5px 8px; border: 1px solid #ccc; border-radius: 2px;
  font-size: 13px; font-family: inherit; background: #fff; color: #222;
}
input[type="number"] { width: 80px; }
.btn {
  padding: 7px 16px; border: 1px solid #bbb; border-radius: 2px;
  background: #fff; color: #222; font-size: 13px; cursor: pointer; font-family: inherit;
  text-decoration: none; display: inline-block;
}
.btn:hover { background: #f0f0f0; }
.btn.primary { background: #2c5fa8; border-color: #2c5fa8; color: #fff; }
.btn.primary:hover { background: #244d8a; border-color: #244d8a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.big {
  padding: 14px 36px; font-size: 16px; font-weight: 600;
}
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hint { font-size: 12px; color: #888; }
.status { font-size: 13px; margin-top: 8px; min-height: 18px; }
.status.err { color: #c62828; white-space: pre-wrap; }
.status.ok { color: #2e7d32; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid #ddd; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 10px 20px; cursor: pointer; font-size: 14px; color: #666;
  border: 1px solid transparent; border-bottom: none; border-radius: 2px 2px 0 0;
  margin-bottom: -1px; background: transparent; font-family: inherit;
}
.tab.active { background: #fff; border-color: #ddd; color: #222; font-weight: 600; }

/* 点名 */
.draw-display {
  font-size: 64px; font-weight: 700; text-align: center;
  padding: 40px 16px; min-height: 180px;
  background: #fafafa; border: 1px solid #e5e5e5; border-radius: 2px;
  color: #2c5fa8; letter-spacing: 2px;
  display: flex; align-items: center; justify-content: center;
  word-break: break-all; user-select: none;
  transition: color .1s, background .1s;
}
.draw-display.hot { background: #eef3fb; color: #2c5fa8; }
.draw-display.done { background: #f4f8f4; color: #2e7d32; border-color: #cfe3cf; }
.draw-display.empty { color: #aaa; font-size: 22px; font-weight: 400; }
.draw-actions { display: flex; justify-content: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.options-row {
  display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid #eee; font-size: 13px;
}
.options-row label {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.history {
  font-size: 12px; color: #666; margin-top: 12px;
  max-height: 100px; overflow-y: auto;
  padding: 8px 10px; background: #fafafa; border: 1px solid #eee; border-radius: 2px;
  line-height: 1.7; word-break: break-all;
}
.history .h-label { color: #999; margin-right: 6px; }
.history .h-name {
  display: inline-block; padding: 1px 6px; margin: 1px 3px 1px 0;
  background: #eef3fb; color: #2c5fa8; border-radius: 2px;
}
.history .h-name.removed { background: #fde8e8; color: #c62828; }

/* 分组 */
.group-controls {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px;
  font-size: 13px;
}
.group-controls label {
  display: flex; align-items: center; gap: 6px;
}
.group-result {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.group-card {
  background: #fafafa; border: 1px solid #e5e5e5; border-radius: 2px;
  padding: 12px;
}
.group-card h3 {
  font-size: 13px; font-weight: 600; margin: 0 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid #eee; color: #2c5fa8;
}
.group-card ul {
  margin: 0; padding: 0; list-style: none;
}
.group-card li {
  font-size: 13px; padding: 3px 0;
  display: flex; gap: 6px; align-items: baseline;
}
.group-card li .idx {
  color: #aaa; font-size: 11px; min-width: 18px; text-align: right;
}

/* 抽签 */
.lottery-result {
  font-size: 48px; font-weight: 700; text-align: center;
  padding: 36px 16px; min-height: 140px;
  background: #fafafa; border: 1px solid #e5e5e5; border-radius: 2px;
  color: #2c5fa8; display: flex; align-items: center; justify-content: center;
  word-break: break-all; user-select: none; margin-top: 12px;
}
.lottery-result.hot { background: #eef3fb; }
.lottery-result.done { background: #f4f8f4; color: #2e7d32; border-color: #cfe3cf; }
.lottery-result.empty { color: #aaa; font-size: 22px; font-weight: 400; }

/* 转盘 */
.wheel-stage {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 12px 0;
}
.wheel-wrap {
  position: relative;
  width: 500px; max-width: 100%;
  aspect-ratio: 1 / 1;
}
.wheel-wrap canvas {
  display: block; width: 100%; height: 100%;
}
.wheel-pointer {
  position: absolute; top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid #c62828;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
  z-index: 2;
  pointer-events: none;
}
.wheel-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 76px; height: 76px; border-radius: 50%;
  background: #fff; border: 2px solid #2c5fa8;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #2c5fa8;
  z-index: 1; user-select: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.wheel-result {
  font-size: 22px; color: #2e7d32; font-weight: 600; text-align: center;
  min-height: 30px;
}
.wheel-result.hot { color: #2c5fa8; }
