/* 教学工具箱 · 深色网格主题（参考 teacherlab.cn 的视觉语言） */
:root {
  --bg: #070c11;
  --panel: rgba(16, 24, 31, .82);
  --panel-solid: #101820;
  --panel-2: rgba(22, 33, 42, .9);
  --line: rgba(122, 226, 170, .16);
  --line-soft: rgba(190, 220, 210, .09);
  --ink: #e9f5ef;
  --ink-2: #9ab2aa;
  --ink-3: #6d8880;
  --green: #43e08a;
  --green-2: #9dffb8;
  --green-deep: #159d63;
  --violet: #a98bff;
  --amber: #f5c25b;
  --shadow: 0 14px 40px rgba(0, 0, 0, .38);
  --r: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
/* 细网格 + 霓虹光晕 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(180, 235, 205, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 235, 205, .045) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .75) 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .75) 55%, transparent 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(680px 340px at 16% -8%, rgba(46, 224, 132, .16), transparent 72%),
    radial-gradient(560px 320px at 88% 4%, rgba(150, 100, 255, .12), transparent 70%),
    radial-gradient(520px 380px at 50% 60%, rgba(30, 130, 110, .06), transparent 75%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; position: relative; z-index: 1; }

/* ---------- 顶部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(8, 14, 19, .78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { display: flex; align-items: center; gap: 14px; height: 66px; }
.logo {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #1a7a55, #43e08a);
  color: #07140e; font-size: 17px; font-weight: 800;
  box-shadow: 0 0 18px rgba(67, 224, 138, .35);
}
.brand-name { font-weight: 750; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.brand-sub { color: var(--ink-3); font-size: 12px; margin-left: 2px; white-space: nowrap; }
.header-spacer { flex: 1; }
.header-link {
  color: var(--ink-2); font-size: 13px; padding: 8px 12px; border-radius: 10px; transition: .16s;
  display: inline-flex; align-items: center; gap: 6px;
}
.header-link:hover { background: rgba(67, 224, 138, .08); color: var(--green-2); }
.header-link svg { width: 15px; height: 15px; }
.btn {
  border: 1px solid var(--line); background: rgba(22, 34, 42, .7); color: var(--ink);
  padding: 9px 15px; border-radius: 11px; font-size: 13px; font-weight: 650;
  display: inline-flex; align-items: center; gap: 7px; transition: .16s;
}
.btn:hover { border-color: rgba(67, 224, 138, .45); box-shadow: 0 0 18px rgba(67, 224, 138, .12); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #2ec97c, #57ec9b); border-color: transparent; color: #06160e;
  box-shadow: 0 6px 20px rgba(46, 201, 124, .22);
}
.btn-primary:hover { background: linear-gradient(135deg, #43e08a, #8bffb6); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-ghost { background: transparent; }

/* ---------- Hero ---------- */
.hero { padding: 58px 0 26px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(15, 30, 25, .8); border: 1px solid var(--line);
  color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .6px;
  padding: 6px 13px; border-radius: 999px;
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.hero h1 {
  font-size: clamp(32px, 5.2vw, 54px); line-height: 1.2; margin: 20px 0 12px;
  letter-spacing: 1px; font-weight: 850;
  background: linear-gradient(100deg, #43e08a 10%, #a8ff9e 55%, #7de3ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(67, 224, 138, .35));
}
.hero p { color: var(--ink-2); max-width: 620px; margin: 0 auto; font-size: 14.5px; }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 26px 0 26px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 18px; min-width: 128px; text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.stat b { display: block; color: var(--green-2); font-size: 22px; line-height: 1.2; letter-spacing: -.5px; }
.stat span { color: var(--ink-3); font-size: 11.5px; }
.stat .dots { display: flex; gap: 3px; margin-top: 7px; }
.stat .dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--green); opacity: .85; }
.stat .dots i.off { background: rgba(120, 180, 155, .2); }
.search-box {
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  background: rgba(17, 27, 34, .9); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 6px 4px 16px; box-shadow: var(--shadow);
}
.search-box:focus-within { border-color: rgba(67, 224, 138, .5); box-shadow: 0 0 0 3px rgba(67, 224, 138, .1), var(--shadow); }
.search-box span { color: var(--ink-3); font-size: 17px; }
.search-box input {
  flex: 1; border: 0; outline: 0; padding: 10px 0; font-size: 14px; color: var(--ink); background: transparent;
}
.search-box input::placeholder { color: #5c756d; }
.search-box .clear-search { border: 0; background: transparent; color: var(--ink-3); font-size: 18px; padding: 4px 9px; display: none; }
.search-box .clear-search.show { display: block; }

/* ---------- 区块 ---------- */
.section-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 34px 0 16px; }
.section-head h2 { font-size: 19px; margin: 0; letter-spacing: -.2px; }
.section-head .sub { color: var(--ink-3); font-size: 12.5px; }
.section-head .grow { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.chip {
  border: 1px solid var(--line); background: rgba(16, 26, 32, .7); color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; transition: .16s;
}
.chip:hover { border-color: rgba(67, 224, 138, .4); color: var(--ink); }
.chip.active {
  background: rgba(67, 224, 138, .14); border-color: rgba(67, 224, 138, .55);
  color: var(--green-2); box-shadow: 0 0 16px rgba(67, 224, 138, .1);
}
.chip .n { opacity: .6; font-size: 11.5px; margin-left: 5px; }

/* ---------- 工具卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex; flex-direction: column;
}
/* 卡片由云端数据异步插入，不用 opacity 入场动画：避免渲染时机导致卡片发暗或不可见 */
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(0, 0, 0, .5); border-color: rgba(67, 224, 138, .38); }
.thumb {
  height: 154px; position: relative; overflow: hidden;
  background: linear-gradient(140deg, var(--c1, #1b4d3e), var(--c2, #2f8f6b));
  display: grid; place-items: center;
}
.thumb::before {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  right: -70px; top: -110px; background: rgba(255, 255, 255, .09);
}
.thumb::after {
  content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%;
  left: -52px; bottom: -92px; border: 22px solid rgba(255, 255, 255, .07);
}
.thumb-icon { font-size: 62px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); z-index: 1; transition: transform .25s; }
.card:hover .thumb-icon { transform: scale(1.08) rotate(-4deg); }
.thumb-label {
  position: absolute; left: 14px; bottom: 13px; z-index: 2;
  color: rgba(255, 255, 255, .82); font-size: 11.5px; font-weight: 650; letter-spacing: .4px;
}
.badge {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  background: rgba(8, 16, 14, .72); color: var(--green-2);
  border: 1px solid rgba(160, 255, 200, .25);
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.card-body { padding: 17px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-title-row { display: flex; align-items: center; gap: 9px; }
.card-title-row h3 { font-size: 16.5px; margin: 0; letter-spacing: -.2px; flex: 1; }
.cat-dot {
  font-size: 11px; color: var(--green-2); background: rgba(67, 224, 138, .1);
  border: 1px solid rgba(67, 224, 138, .18); padding: 3px 9px; border-radius: 7px;
  white-space: nowrap; font-weight: 650;
}
.tagline { color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.card-desc { color: var(--ink-2); font-size: 13px; line-height: 1.7; margin: 11px 0 14px; min-height: 66px; }
/* 登录 / 数据归属提示：一眼看清这个工具要不要登录、数据存在哪 */
.access-tag {
  display: inline-block; margin-top: 9px; padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 650; letter-spacing: .1px;
}
.access-tag.login { color: #ffd28a; background: rgba(224, 160, 60, .12); border: 1px solid rgba(224, 160, 60, .3); }
.access-tag.demo  { color: #ffb4b4; background: rgba(224, 90, 90, .10); border: 1px solid rgba(224, 90, 90, .28); }
.access-tag.local { color: var(--green-2); background: rgba(67, 224, 138, .09); border: 1px solid rgba(67, 224, 138, .24); }
.card-note {
  color: var(--ink-3); font-size: 11.5px; line-height: 1.6;
  border-left: 2px solid rgba(67, 224, 138, .35); padding-left: 9px; margin: -6px 0 14px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag { background: rgba(120, 180, 160, .08); border: 1px solid rgba(120, 180, 160, .12); color: var(--ink-2); font-size: 11.5px; padding: 3px 9px; border-radius: 6px; }
.card-foot { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 13px; display: flex; gap: 8px; align-items: center; }
.card-foot .btn-primary { flex: 1; justify-content: center; }
.icon-btn {
  width: 36px; height: 36px; border: 1px solid var(--line); background: rgba(22, 34, 42, .6); border-radius: 10px;
  display: grid; place-items: center; font-size: 15px; color: var(--ink-2); flex: 0 0 36px;
}
.icon-btn:hover { background: rgba(67, 224, 138, .1); color: var(--green-2); }
.empty { text-align: center; padding: 56px 20px; color: var(--ink-2); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r); }
.empty .big { font-size: 38px; margin-bottom: 8px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); }

/* ---------- 最近打开 / 提示 ---------- */
.recent-list { display: flex; gap: 10px; flex-wrap: wrap; }
.recent-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 13px; display: flex; align-items: center; gap: 9px; font-size: 13px;
  transition: .16s;
}
.recent-item:hover { border-color: rgba(67, 224, 138, .4); transform: translateY(-2px); }
.recent-item .e { font-size: 18px; }
.recent-item .t { color: var(--ink-3); font-size: 11.5px; margin-left: 6px; }
.cloud-note {
  margin-top: 14px; padding: 11px 15px; border-radius: 12px;
  background: rgba(245, 194, 91, .07); border: 1px solid rgba(245, 194, 91, .22);
  color: #e4c98d; font-size: 12.5px; line-height: 1.7;
}
.site-footer { border-top: 1px solid var(--line-soft); margin-top: 46px; padding: 22px 0 34px; color: var(--ink-3); font-size: 12.5px; }
.site-footer .wrap { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.site-footer .grow { flex: 1; }

/* ---------- 弹窗 / 表单 / toast ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(2, 7, 9, .76);
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.overlay.show { display: flex; }
.modal { background: #101a21; border: 1px solid var(--line); border-radius: 18px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(0, 0, 0, .6); }
.modal-head { padding: 20px 22px 12px; display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-head .x { border: 0; background: rgba(120, 180, 160, .1); width: 30px; height: 30px; border-radius: 9px; font-size: 16px; color: var(--ink-2); }
.modal-body { padding: 4px 22px 20px; }
.modal-foot { border-top: 1px solid var(--line-soft); padding: 14px 22px; display: flex; justify-content: flex-end; gap: 9px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 650; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font-size: 13.5px; color: var(--ink); outline: 0; background: rgba(8, 15, 19, .8); transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(67, 224, 138, .6); box-shadow: 0 0 0 3px rgba(67, 224, 138, .1); }
.field textarea { resize: vertical; min-height: 62px; }
.field-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.field-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px);
  background: #16251e; color: var(--green-2); border: 1px solid rgba(67, 224, 138, .35);
  padding: 10px 18px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none;
  transition: .25s; z-index: 80; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 内嵌浏览页 ---------- */
body.viewer { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
body.viewer::before, body.viewer::after { display: none; }
.viewer-bar {
  height: 58px; flex: 0 0 58px; display: flex; align-items: center; gap: 14px;
  padding: 0 16px; border-bottom: 1px solid var(--line); background: #0d171c; color: var(--ink); z-index: 2;
}
.viewer-back { font-size: 13px; font-weight: 650; color: var(--green-2); white-space: nowrap; }
.viewer-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title span { color: var(--ink-3); font-weight: 400; font-size: 12px; margin-left: 8px; }
.viewer-bar .grow { flex: 1; }
.viewer-bar .btn { background: rgba(22, 34, 42, .8); }
.viewer-note {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 7px 16px; font-size: 12px; color: var(--ink-2);
  background: #122019; border-bottom: 1px solid var(--line-soft);
}
.viewer-note i { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.viewer-note b { color: var(--green-2); font-weight: 650; }
.viewer-frame { flex: 1; width: 100%; border: 0; display: block; background: #fff; }
.viewer-error { padding: 40px; text-align: center; color: var(--ink-2); }

@media (max-width: 720px) {
  .wrap { width: min(100% - 28px, 1180px); }
  .brand-sub, .header-link span { display: none; }
  .hero { padding: 38px 0 20px; }
  .stats { gap: 7px; }
  .stat { padding: 8px 12px; min-width: 106px; }
  .stat b { font-size: 18px; }
  .grid { grid-template-columns: 1fr; }
  .viewer-title span { display: none; }
}
