:root {
  --bg: #0f1221;
  --card: #171a2b;
  --muted: #8b92b2;
  --text: #e6e8f2;
  --primary: #6c8cff;
  --accent: #8bffcb;
  --danger: #ff6b6b;
  --border: #232743;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 10% -10%, #1a1f3c 0%, var(--bg) 40%),
              radial-gradient(1200px 800px at 90% 10%, #1a243f 0%, var(--bg) 40%),
              var(--bg);
  color: var(--text);
}

.container { width: min(1100px, 92vw); margin: 0 auto; }

.site-header { padding: 32px 0 12px; border-bottom: 1px solid var(--border); backdrop-filter: blur(4px); }
.site-header h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: 0.5px; }
.site-header p { margin: 6px 0 0; color: var(--muted); }

.site-footer { padding: 24px 0 40px; color: var(--muted); text-align: center; }

main { padding: 28px 0 20px; display: grid; gap: 20px; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.0));
  border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.upload-card { display: grid; gap: 16px; }

.dropzone {
  border: 2px dashed #2a2f55; border-radius: 14px; padding: 24px; text-align: center; color: var(--muted);
  display: grid; gap: 10px; place-items: center; outline: none; transition: all .2s ease;
  background: rgba(108, 140, 255, 0.06);
}
.dropzone:focus, .dropzone.dragover { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,140,255,.15); }
.dz-icon { font-size: 40px; }
.dz-text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dz-text strong { color: var(--text); }
.dz-hint { font-size: 12px; color: var(--muted); }

.disabled { opacity: .6; pointer-events: none; }

.file-info { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.02); }

.actions { display: flex; gap: 12px; }
.actions .btn + .btn { margin-left: 6px; }

.btn {
  appearance: none; border: 1px solid transparent; border-radius: 12px;
  padding: 10px 14px; font-weight: 600; cursor: pointer; color: #0e1327;
  transition: transform .05s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: linear-gradient(135deg, var(--primary), #a0b6ff); box-shadow: 0 6px 18px rgba(108,140,255,.35); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #c9ffe9); box-shadow: 0 6px 18px rgba(139,255,203,.3); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #ff9b9b); box-shadow: 0 6px 18px rgba(255,107,107,.3); }
.btn.tiny { padding: 6px 8px; border-radius: 10px; font-size: 12px; }

.progress { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: #fff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none; }

#resultSection h2 { margin: 0 0 10px; }
.summary { color: var(--muted); margin-bottom: 6px; }
.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.section-pill { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,0.02); display: flex; justify-content: space-between; align-items: center; }
.section-pill .name { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-pill .count { color: var(--primary); font-weight: 700; }

/* 答案展示区域 */
.answers-block { margin-top: 12px; }
.answers-grid { display: grid; gap: 12px; }
/* 大屏固定 10 列；向下自适应缩减列数，确保小屏可读性 */
@media (min-width: 1200px) { .answers-grid { grid-template-columns: repeat(10, 1fr); } }
@media (min-width: 992px) and (max-width: 1199px) { .answers-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 768px) and (max-width: 991px) { .answers-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 520px) and (max-width: 767px) { .answers-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 519px) { .answers-grid { grid-template-columns: 1fr; } }

.answer-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: rgba(255,255,255,0.02); display: grid; gap: 6px; }
.answer-head { display: flex; justify-content: space-between; align-items: center; }
.answer-id { font-weight: 700; color: var(--text); }
.answer-type { color: var(--muted); font-size: 12px; }
.answer-pill { display: inline-block; padding: 6px 10px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), #c9ffe9); color: #0e1327; font-weight: 800; letter-spacing: 1px; }
.answer-status { color: var(--muted); font-size: 12px; }

/* 运行提示条 */
.running-notice { position: fixed; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; pointer-events: none; }
.rn-inner { pointer-events: all; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(108,140,255,.25), rgba(139,255,203,.25)); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.rn-icon { font-size: 16px; }
.rn-text { color: var(--text); font-weight: 700; }

/* 确保与 .running-notice 同时存在时，隐藏优先生效 */
.running-notice.hidden { display: none !important; }

/* 链接样式 */
.link { color: var(--accent); text-decoration: none; border-bottom: 1px dashed rgba(139,255,203,.6); padding-bottom: 2px; }
.link:hover { opacity: .85; }

/* 使用方法页面样式 */
.guide { display: grid; gap: 18px; }
.guide-steps { margin: 0; padding-left: 20px; }
.guide-step { margin: 4px 0 12px; }
.guide-step h3 { margin: 0 0 6px; }
.guide-img-wrap { margin-top: 8px; }
.guide-img { width: 100%; max-height: 360px; object-fit: contain; border: 1px dashed var(--border); border-radius: 10px; background: rgba(255,255,255,0.03); }

/* 表单与管理后台样式 */
.form { display: grid; gap: 12px; }
.form-row { display: grid; gap: 6px; }
.form-label { color: var(--muted); font-size: 12px; }
.form-input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--text); }
.form-input.small { width: 120px; }

.admin-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.admin-inline { display: flex; gap: 8px; align-items: center; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px 8px; text-align: left; }
.table th { color: var(--muted); font-weight: 600; }

.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-success { background: linear-gradient(135deg, #7cf4bf, #aef7d7); color: #0e1327; }
.badge-muted { background: linear-gradient(135deg, #aab2d7, #cdd2ea); color: #0e1327; }

/* 代码与复制按钮排版 */
.code-cell { display: inline-flex; gap: 8px; align-items: center; }
.code-cell code { border: 1px solid var(--border); border-radius: 8px; padding: 2px 6px; background: rgba(255,255,255,0.03); }

@media (max-width: 520px) {
  .dz-text span { display: none; }
}

/* 购买提示框样式 */
.notice-box {
  background: linear-gradient(135deg, rgba(108, 140, 255, 0.15), rgba(139, 255, 203, 0.1));
  border: 2px solid rgba(108, 140, 255, 0.3);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(108, 140, 255, 0.15);
  animation: fadeIn 0.5s ease-in-out;
}

.notice-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-content {
  margin: 0;
  line-height: 1.8;
  color: var(--text);
  font-size: 15px;
}

.purchase-link {
  display: inline-block;
  margin: 8px 0;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary), #5a7aef);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(108, 140, 255, 0.3);
}

.purchase-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 140, 255, 0.4);
  background: linear-gradient(135deg, #5a7aef, var(--primary));
}

.notice-thanks {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-style: italic;
  font-size: 14px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
