/* 星界课件助手：老师端和后台共用的基础样式 */
:root {
  --paper: #f6f5f2;
  --paper-2: #efede8;
  --card: #ffffff;
  --ink: #1d1c1a;
  --ink-2: #5f5b55;
  --ink-3: #9a958d;
  --line: #e7e4de;
  --line-2: #d6d2ca;
  --red: #a93226;
  --red-2: #c0392b;
  --red-soft: #f7ebe9;
  --green: #2e7d5b;
  --green-soft: #e6f2ec;
  --amber: #9a650f;
  --amber-soft: #f8f0e0;
  --blue: #2f5e91;
  --blue-soft: #e8eff7;
  --shadow: 0 1px 2px rgba(20, 18, 15, .04), 0 2px 10px rgba(20, 18, 15, .04);
  --shadow-lg: 0 2px 6px rgba(20, 18, 15, .05), 0 14px 40px rgba(20, 18, 15, .10);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141413; --paper-2: #1e1d1b; --card: #1a1918; --ink: #edebe6; --ink-2: #b5b0a8; --ink-3: #7f7a72; --line: #2c2b28; --line-2: #3a3834;
    --red: #e06c5e; --red-2: #ef8579; --red-soft: #3a2220; --green: #6cc49b; --green-soft: #1d3329; --amber: #e0aa55; --amber-soft: #3a2f1c;
    --blue: #8db7e0; --blue-soft: #1f2c3b; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 14px 40px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141413; --paper-2: #1e1d1b; --card: #1a1918; --ink: #edebe6; --ink-2: #b5b0a8; --ink-3: #7f7a72; --line: #2c2b28; --line-2: #3a3834;
  --red: #e06c5e; --red-2: #ef8579; --red-soft: #3a2220; --green: #6cc49b; --green-soft: #1d3329; --amber: #e0aa55; --amber-soft: #3a2f1c;
  --blue: #8db7e0; --blue-soft: #1f2c3b; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 14px 40px rgba(0,0,0,.45); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: .01em; color: var(--ink); }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--red-soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 14px; color: var(--ink);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: var(--line-2); background: var(--paper); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--card); }
.btn.primary:hover { background: #33312d; border-color: #33312d; }
.btn.accent { background: var(--red); border-color: var(--red); color: #fff; }
.btn.accent:hover { background: var(--red-2); border-color: var(--red-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.small { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.big { height: 46px; padding: 0 26px; font-size: 15px; border-radius: 12px; }

.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

input[type=text], input[type=password], input[type=tel], input[type=number], input:not([type]), textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:hover, textarea:hover, select:hover { border-color: var(--line-2); }
input:focus, textarea:focus, select:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(169, 50, 38, .10); }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-2); margin: 0 0 6px; font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 10px 18px;
  border-radius: 12px; font-size: 14px; z-index: 100; box-shadow: var(--shadow-lg); max-width: min(90vw, 640px); }

.modal-back { position: fixed; inset: 0; background: rgba(20, 18, 15, .38); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px 28px; box-shadow: var(--shadow-lg); border-radius: 18px; }
.modal h2 { font-size: 19px; margin-bottom: 6px; }
.modal .row:last-child { margin-top: 18px; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--ink-2); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.dropzone { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--ink-3); font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--ink-3); background: var(--paper); color: var(--ink-2); }

.md h1 { font-size: 18px; margin: 0 0 10px; } .md h2 { font-size: 15px; margin: 18px 0 6px; } .md ul { margin: 4px 0; padding-left: 20px; } .md p { margin: 6px 0; } .md li { margin: 3px 0; }
.banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; margin-bottom: 18px; border-radius: 12px; background: var(--amber-soft); color: var(--ink); border: 1px solid transparent; }
.banner.green { background: var(--green-soft); }
.banner.red { background: var(--red-soft); }
.banner.plain { background: var(--card); border-color: var(--line); }
.banner .grow { flex: 1; }
.banner b { font-weight: 600; }

/* 弹窗、提示条：进来和离开都有过渡（老师端、后台共用） */
.modal-back { animation: xjFade .2s ease both; }
.modal-back .modal { animation: xjPop .28s cubic-bezier(.2, .7, .2, 1) both; }
.modal-back.leaving { animation: xjFadeOut .2s ease both; pointer-events: none; }
.modal-back.leaving .modal { animation: xjPopOut .2s ease both; }
.toast { animation: xjToastIn .32s cubic-bezier(.2, .7, .2, 1) both; }
.toast.leaving { animation: xjToastOut .26s ease both; }
@keyframes xjFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes xjFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes xjPop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes xjPopOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes xjToastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes xjToastOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .modal-back, .modal-back .modal, .toast { animation: none !important; } }

/* 弹窗右上角的关闭按钮、提示条里的按钮（老师端、后台共用；老师端的深色样式在 teacher/next/theme.css） */
.modal { position: relative; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.modal-x:hover { background: var(--paper-2); color: var(--ink); }
.modal-x svg { width: 18px; height: 18px; }
.toast { display: inline-flex; align-items: center; gap: 10px; }
.toast .ta { border: 0; background: rgba(255, 255, 255, .16); color: inherit; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-weight: 600; font: inherit; }
