:root {
  --bg: #f3f4f6;
  --panel: #f8fafc;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --blue: #1d4ed8;
  --blue2: #2563eb;
  --red: #dc2626;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --radius: 12px;
  --hl: #ffd325;
  --hl-blue: #1e5eff;
  --hl-red: #d93025;
  --border-soft: #eeeeee;
  --bg-soft: #fafafa;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 17px; }
.hl-blue { color: var(--hl-blue); font-weight: 700; }
.hl-red { color: var(--hl-red); font-weight: 800; }
.wrap { width: min(900px, calc(100vw - 24px)); max-width: 900px; margin: 0 auto; padding: 12px 0 80px; }
.wrap.layout-double { width: 95vw; max-width: 95vw; }
.nav-panel { position: sticky; top: 0; z-index: 40; background: #fff; padding: 12px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 15px; }
select, input, button { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; }
button { cursor: pointer; background: #fff; font-weight: 700; }
.layout-btn { display: none; }
.drawer-btn { display: inline-flex; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 79; }
.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 28px rgba(0,0,0,.18);
  z-index: 80;
  display: flex;
  flex-direction: column;
}
.settings-drawer.hidden { display: none !important; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); background: var(--panel); }
.drawer-close {
  min-width: 42px;
  height: 42px;
  padding: 0;
}
.drawer-body { padding: 16px 18px 24px; display: grid; grid-template-columns: 1fr; gap: 12px; overflow: auto; }
.settings-drawer label { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card-h { padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.card-h h2 { font-size: 17px; margin: 0; font-weight: 800; }
.card-b { padding: 16px; }
.content-grid.single-column { display: block; }
.content-grid.single-column .column-left, .content-grid.single-column .column-right { width: 100%; }
.content-grid.double-column { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.content-grid.double-column .column-left, .content-grid.double-column .column-right { min-width: 0; }
.vocab-table { width: 100%; border-collapse: collapse; font-size: 15px; table-layout: fixed; word-wrap: break-word; }
.vocab-table th, .vocab-table td { border: 1px solid var(--border-soft); padding: 10px 8px; text-align: left; vertical-align: middle; }
.col-word { width: 25%; }
.col-audio { width: 12%; text-align: center; }
.col-kk { width: 23%; }
.col-zh { width: 40%; }
.image-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }

.ratioWrap { width: 100%; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.ratio { position: relative; width: 100%; padding-top: 56.25%; }
.ratio iframe, .ratio img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.qtext-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 15px; }
.qtext { font-weight: 900; font-size: 18px; flex: 1; }
.drag-container { display: flex; gap: 15px; width: 100%; align-items: flex-start; }
.drag-col { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #fff; }
.drag-col h3 { font-size: 15px; color: var(--hl-blue); margin-top: 0; border-bottom: 1px solid var(--border-soft); padding-bottom: 5px; }
.opt { border: 1px solid var(--border); border-radius: 10px; padding: 10px; gap: 10px; margin-bottom: 8px; align-items: flex-start; white-space: normal; word-wrap: break-word; max-width: 100%; }
.opt.correct { background: #ceedd0; border-color: #1b5a38; }
.speak-btn { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 12px; white-space: nowrap; }
mark.vhl { background: var(--hl); border-radius: 4px; padding: 0 2px; font-weight: 800; display: inline; }
.hidden { display: none !important; }
.analysis-text { display: block; line-height: 1.7; width: 100%; }
.analysis-option-block { display: block; width: 100%; margin-bottom: 15px; }
.analysis-option-content { width: 100%; min-width: 0; }
.analysis-option-content ul { margin: 5px 0 0 0; padding-left: 18px; list-style-type: disc; }
.analysis-option-content li { display: list-item !important; margin-bottom: 4px; }
.analysis-option-content p, .analysis-option-content div { margin: 0; }
@media (min-width: 1100px) { .layout-btn { display: inline-flex; } }
@media (max-width: 1099px) {
  .wrap.layout-double { width: min(900px, calc(100vw - 24px)); max-width: 900px; }
  .content-grid.double-column { display: block; }
}
@media (max-width: 600px) {
  .drag-container { flex-direction: column; }
  
}
.cmd-block{
  background:#f5f5f5;
  padding:8px;
  border-radius:4px;
}
.box-ok {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid #86c59a;
  border-radius: 12px;
  background: #edf9f0;
  line-height: 1.95;
  color: #1f2937;
  font-size: 15px;
}

.box-warn {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid #f2b766;
  border-radius: 12px;
  background: #fff7ed;
  line-height: 1.95;
  color: #1f2937;
  font-size: 15px;
}

.box-bad {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid #e59a9a;
  border-radius: 12px;
  background: #fef2f2;
  line-height: 1.95;
  color: #1f2937;
  font-size: 15px;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 15px;
  line-height: 1.75;
  table-layout: fixed;
  word-break: break-word;
  overflow-wrap: anywhere;
  border: 2px solid #5b84c4;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.analysis-table th,
.analysis-table td {
  border: 1px solid #8fa8cf;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.analysis-table th {
  background: #5f8fdc;
  color: #fff;
  font-weight: 800;
}

.analysis-table tr:nth-child(even) td {
  background: #f5f9ff;
}

.analysis-table tr:hover td {
  background: #eaf2ff;
}
.disable-highlight mark.vhl { background: transparent; padding: 0; font-weight: inherit; }
