@charset "UTF-8";

:root {
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  color: #202322;
  background: #f7f8f6;
  --accent: #d9ee80;
  --muted: #777d77;
  --line: #e4e7e1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-image: linear-gradient(#dbe0d72e 1px, transparent 1px), linear-gradient(90deg, #dbe0d72e 1px, transparent 1px);
  background-size: 28px 28px;
}
a { color: inherit; text-decoration: none; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
a, button, textarea, input { outline-offset: 4px; }
main:focus { outline: none; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.header-inner {
  max-width: 1240px;
  height: 100%;
  margin: auto;
  padding: 0 36px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.brand { font-weight: 750; letter-spacing: -.5px; font-size: 19px; justify-self: start; }
.site-header nav { height: 100%; display: flex; align-items: stretch; gap: 32px; }
.site-header nav a { position: relative; display: grid; place-items: center; font-size: 14px; color: var(--muted); }
.site-header nav a:hover { color: #202322; }
.site-header nav a[aria-current="page"] { color: #202322; font-weight: 650; }
.site-header nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 10px; width: 26px; height: 3px; background: var(--accent); }
.home-page { max-width: 1168px; margin: 0 auto; padding: 0 36px; }
.home-title { text-align: center; padding: 78px 0 70px; }
.home-title h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); font-weight: 750; letter-spacing: -1.5px; }
.tool-directory h2 { font-size: 20px; margin: 0 0 22px; font-weight: 650; }
.tool-directory h2::after { display: block; content: ""; width: 26px; height: 3px; background: var(--accent); margin-top: 10px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tool-card { display: block; padding: 28px; background: white; border: 1px solid #ecefe8; border-radius: 3px; box-shadow: 0 9px 25px #23312209; transition: border-color .2s, box-shadow .2s, transform .2s; }
.tool-card:hover { border-color: #a1b662; box-shadow: 0 12px 30px #23312212; transform: translateY(-2px); }
.tool-card h3 { margin: 0 0 13px; font-size: 18px; font-weight: 650; }
.tool-card p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--muted); }
footer { text-align: center; font-size: 12px; color: #8a8f87; line-height: 1.8; padding: 55px 0 30px; }
.tool-sidebar { position: fixed; top: 64px; bottom: 0; left: 0; width: 190px; border-right: 1px solid var(--line); background: #ffffffed; padding: 28px 15px; }
.tool-sidebar p { margin: 0 12px 14px; font-size: 12px; color: var(--muted); }
.tool-sidebar a { display: block; padding: 13px 12px; border-left: 3px solid var(--accent); background: #f6f9e9; font-size: 14px; font-weight: 600; }
.tool-page { margin-left: 190px; padding: 0 5%; }
.page-heading { text-align: center; padding: 36px 0 30px; }
.page-heading h1 { font-size: 28px; margin: 0; font-weight: 700; }
.page-heading h1::after { content: ""; display: block; width: 38px; height: 3px; background: var(--accent); margin: 15px auto 0; }
.tool { max-width: 960px; margin: auto; background: white; border: 1px solid #ecefe8; border-radius: 3px; padding: 30px; box-shadow: 0 10px 32px #2331220a; }
.workspace { display: grid; grid-template-columns: 1.08fr 1fr; gap: 28px; }
.label-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 12px; font-weight: 600; }
.label-row span { color: var(--muted); font-weight: 400; }
textarea { width: 100%; display: block; resize: vertical; min-height: 200px; max-height: 450px; border: 1px solid #dde2d8; border-radius: 3px; padding: 15px; line-height: 1.85; background: #fcfdfb; color: #273a32; }
textarea::placeholder { color: #929b90; }
textarea:focus, input:focus { border-color: #829b47; outline: 2px solid #eaf1d4; }
.input-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 11px 0 22px; color: var(--muted); font-size: 12px; }
.text-button { padding: 3px 0; border: 0; background: transparent; color: #657741; font-size: 14px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.settings { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.settings>div { display: flex; align-items: center; gap: 12px; }
input[type="number"] { width: 66px; border: 1px solid #dde2d8; border-radius: 3px; padding: 8px; background: white; }
input[type="checkbox"] { accent-color: #6d8745; width: 17px; height: 17px; }
.check { display: flex; align-items: center; gap: 5px; color: #697561; }
.error { min-height: 18px; font-size: 13px; line-height: 1.5; color: #b23f36; margin: 9px 0; }
.primary { border: 1px solid #c7d88f; background: #eff6d9; width: 100%; padding: 14px 20px; border-radius: 3px; display: flex; align-items: center; justify-content: center; gap: 13px; font-weight: 700; color: #354724; min-height: 52px; }
.primary:hover { background: #e3edc1; }
.primary span { font-size: 23px; }
.result-panel { background: #f7f9f1; border: 1px solid #e7ecdb; border-radius: 3px; display: flex; flex-direction: column; overflow: hidden; color: #45532e; min-height: 370px; }
.result-top { display: flex; justify-content: space-between; padding: 20px; font-size: 14px; }
.result-top>span:last-child { font-size: 24px; line-height: 18px; color: #8d9d6c; }
.result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; overflow-wrap: anywhere; }
.ticket { width: 65px; height: 80px; display: grid; place-items: center; border: 1px solid #c5d3a7; border-radius: 3px; transform: rotate(-9deg); font-family: Georgia, serif; font-size: 43px; color: #83985c; background: #fffffa; box-shadow: 6px 6px 0 #e7eddc; margin-bottom: 20px; }
.result h3 { font-size: 21px; margin: 8px 0; }
.result p { font-size: 14px; color: #8b957a; margin: 4px 0; }
.result .winner { font-size: 32px; font-weight: 700; line-height: 1.6; margin: 4px 0; }
.result .winner-multi { font-size: 23px; }
.result .result-label { font-size: 14px; color: #8b957a; margin-bottom: 16px; }
.result-bottom { text-align: center; font-size: 12px; color: #8b957a; padding: 17px; border-top: 1px solid #e7ecdb; }
.history { max-width: 960px; margin: auto; padding: 28px 0 0; }
.history-heading { display: flex; align-items: center; justify-content: space-between; }
.history h2 { font-size: 16px; margin: 0; }
.history>p { color: #87917d; font-size: 14px; margin: 22px 0 0; }
#history-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
#history-list:empty { display: none; }
#history-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 14px 16px; background: white; border: 1px solid var(--line); border-radius: 3px; overflow-wrap: anywhere; }
#history-list time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
  .tool-sidebar { width: 155px; }
  .tool-page { margin-left: 155px; padding: 0 4%; }
  .tool { padding: 24px; }
  .settings { flex-direction: column; align-items: flex-start; gap: 14px; }
  .workspace { gap: 22px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .header-inner { display: flex; justify-content: space-between; padding: 0 20px; }
  .site-header { height: 60px; }
  .site-header nav { gap: 25px; }
  .brand { font-size: 17px; }
  .home-page { padding: 0 24px; }
  .home-title { padding: 62px 0 54px; }
  .home-title h1 { font-size: 28px; letter-spacing: -1px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { padding: 25px; }
  .tool-sidebar { position: static; width: auto; padding: 14px 20px; border-right: 0; border-bottom: 1px solid var(--line); background: white; }
  .tool-sidebar p { display: none; }
  .tool-sidebar a { display: inline-block; padding: 7px 12px; }
  .tool-page { margin: 0; padding: 0 20px; }
  .page-heading { padding: 26px 0; }
  .page-heading h1 { font-size: 25px; }
  .tool { padding: 20px 16px; }
  .workspace { grid-template-columns: 1fr; gap: 24px; }
  .settings { flex-direction: row; align-items: center; font-size: 13px; }
  .settings>div { gap: 8px; }
  .check { gap: 3px; }
  .input-meta { font-size: 11px; }
  .result-panel { min-height: 300px; }
  .result .winner { font-size: 28px; }
  .result .winner-multi { font-size: 22px; }
  footer { padding: 40px 0 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-card { transition: none; }
  .tool-card:hover { transform: none; }
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid #e8e8e2; }
.site-header nav { gap: 28px; }
.category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.category-grid .tool-card { padding: 32px; }
.tool-sidebar { width: 214px; padding: 23px 12px; overflow-y: auto; }
.tool-sidebar a { background: transparent; border-left: 2px solid transparent; font-weight: 400; padding: 12px; line-height: 1.6; }
.tool-sidebar a:hover { background: #f7f9f2; }
.tool-sidebar a[aria-current="page"] { border-left-color: #abc55b; background: #f1f6e1; font-weight: 600; }
.tool-sidebar .category-home { display: block; color: #5c694d; font-weight: 650; margin-bottom: 16px; }
.tool-page { margin-left: 214px; padding: 0 4%; }
.catalog-grid { max-width: 1120px; margin: 0 auto; }
.tool-card h2 { margin: 0 0 10px; font-size: 18px; font-weight: 650; line-height: 1.6; }
.tool-symbol { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 9px; margin-bottom: 20px; background: #f1f5e8; color: #667d38; border-radius: 5px; font-weight: 700; font-size: 18px; }
.page-description { font-size: 14px; color: var(--muted); margin: 17px auto 0; line-height: 1.8; max-width: 650px; }
.back-link { display: inline-block; margin-top: 27px; font-size: 13px; color: var(--muted); }
.back-link + .page-heading { padding-top: 23px; }
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 24px; max-width: 1120px; margin: 0 auto; }
.input-panel, .output-panel { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 4px; padding: 25px; box-shadow: 0 8px 28px #23312206; }
.calc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
.field { min-width: 0; }
.field label { display: block; font-size: 14px; font-weight: 550; margin-bottom: 9px; line-height: 1.6; }
.field input:not([type="checkbox"]), .field select { width: 100%; min-width: 0; padding: 11px 12px; min-height: 44px; background-color: #fcfdfb; border: 1px solid #dce2d6; border-radius: 3px; color: #273a32; font-size: 16px; }
.field select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6d785f 50%), linear-gradient(135deg, #6d785f 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.field select:focus { outline: 2px solid #d8e7b5; }
.field textarea { font-size: 16px; min-height: 150px; }
.field-help { margin: 9px 0 0; color: #7c8574; font-size: 12px; line-height: 1.8; }
.form-full { grid-column: 1 / -1; }
.field-checkbox { display: flex; gap: 8px; align-items: center; }
.field-checkbox label { margin: 0; font-weight: 400; }
.field-checkbox input { flex-shrink: 0; margin: 0; }
.form-actions { display: flex; gap: 12px; align-items: stretch; }
.form-actions .primary { flex: 1; width: auto; font-size: 15px; }
.secondary-button { padding: 11px 16px; background: white; color: #65734c; border: 1px solid #dce2d6; border-radius: 3px; font-size: 14px; }
.secondary-button:hover { background: #f5f8ee; }
.calc-form .error { margin: -8px 0 -6px; min-height: 0; }
.calc-form .error:empty { display: none; }
.output-panel { background: #fffffc; min-height: 220px; }
.output-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-bottom: 17px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.output-header h2 { margin: 0; font-size: 16px; font-weight: 600; }
.text-button:disabled { cursor: default; opacity: .4; text-decoration: none; }
.empty-output { margin: 0; color: #8b9381; font-size: 14px; line-height: 1.8; }
.result-rows { margin: 0; display: grid; gap: 20px; }
.result-row dt { font-size: 12px; color: #7c8571; line-height: 1.6; margin-bottom: 6px; }
.result-row dd { font-size: 17px; margin: 0; color: #334227; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.result-note { color: #7c8571; font-size: 12px; line-height: 1.9; margin: 22px 0 0; overflow-wrap: anywhere; }
.copy-status { font-size: 12px; color: #657741; margin: 16px 0 0; }
.copy-status:empty { display: none; }
.group-result { border: 1px solid #e2e9d3; padding: 16px; margin-bottom: 14px; background: #f9fbf4; }
.group-result h3 { margin: 0 0 10px; color: #5c7040; font-size: 14px; font-weight: 600; }
.group-result ul { display: flex; gap: 8px 14px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.group-result li { font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.lots-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 12px; }
.lot-card { min-height: 92px; padding: 14px 8px; background: #edf3dc; border: 1px solid #cbd9a5; border-radius: 4px; font-size: 15px; color: #5c7136; overflow-wrap: anywhere; }
.lot-card:hover { background: #e4edca; }
.lot-card.revealed { background: #fff; color: #3c4c2e; opacity: 1; cursor: default; }
.teacher-desk { width: 140px; margin: 0 auto 20px; padding: 9px; text-align: center; background: #eef2e5; color: #667b47; border: 1px solid #e0e6d3; font-size: 14px; }
.seats-scroll { overflow-x: auto; }
.seats-table { border-collapse: separate; border-spacing: 5px; min-width: 100%; font-size: 13px; text-align: center; }
.seats-table td { min-width: 86px; max-width: 160px; padding: 11px 7px; background: #f3f7e8; border: 1px solid #e0e6d3; overflow-wrap: anywhere; }
.seats-table th { font-weight: 400; font-size: 12px; color: #8a9480; padding: 5px; white-space: nowrap; }
.seats-table .empty-seat { color: #9fa791; background: #fafbf7; border-style: dashed; }
.resistor-preview { display: flex; justify-content: space-evenly; align-items: stretch; width: 190px; height: 52px; margin: 10px auto 28px; border: 1px solid #c0ad88; border-radius: 15px; background: #eaddbe; padding: 0 18px; }
.resistor-preview span { display: block; width: 12px; border-left: 1px solid #0000000a; border-right: 1px solid #0000000a; }

@media (max-width: 1200px) {
  .tool-sidebar { width: 185px; }
  .tool-page { margin-left: 185px; padding: 0 3%; }
  .input-panel, .output-panel { padding: 20px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; max-width: 650px; }
}
@media (max-width: 720px) {
  .header-inner { padding: 11px 16px; gap: 12px; flex-wrap: wrap; }
  .site-header { height: auto; min-height: 62px; }
  .site-header nav { height: 36px; gap: 18px; }
  .site-header nav a { font-size: 12px; }
  .site-header nav a[aria-current="page"]::after { bottom: 0; }
  .brand { gap: 8px; font-size: 16px; }
  .brand img { width: 29px; height: 29px; }
  .home-title h1 { font-size: 27px; }
  .tool-sidebar { position: static; width: 100%; padding: 8px 14px; overflow: visible; border-bottom: 1px solid var(--line); }
  .tool-sidebar .category-home { display: none; }
  .tool-sidebar nav { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 3px; }
  .tool-sidebar nav a { flex-shrink: 0; font-size: 12px; padding: 9px 11px; border-left: 0; border-bottom: 2px solid transparent; }
  .tool-sidebar nav a[aria-current="page"] { border-left: 0; border-bottom-color: #abc55b; }
  .tool-page { margin: 0; padding: 0 20px; }
  .catalog-grid { gap: 13px; }
  .catalog-grid .tool-card { padding: 19px 16px; }
  .catalog-grid .tool-card h2 { font-size: 16px; }
  .catalog-grid .tool-card p { font-size: 12px; }
  .tool-symbol { margin-bottom: 14px; }
  .category-grid { grid-template-columns: 1fr; }
  .category-grid .tool-card { padding: 26px; }
  .calc-layout { gap: 18px; }
  .page-description { font-size: 13px; }
  .page-heading h1 { font-size: 25px; }
  .calc-form { gap: 19px 13px; }
  .input-panel, .output-panel { padding: 20px 17px; }
  .back-link { margin-top: 22px; }
}
@media (max-width: 500px) {
  .calc-form { grid-template-columns: 1fr; }
}
@media (max-width: 370px) {
  .header-inner { justify-content: center; }
  .brand { margin-right: auto; }
  .site-header nav { width: 100%; justify-content: center; }
  .catalog-grid { grid-template-columns: 1fr; }
}
