:root {
  color-scheme: dark;
  --bg: #10161a;
  --panel: #171f23;
  --text: #edf4f3;
  --muted: #a0b0af;
  --line: #344447;
  --cyan: #54e4e4;
  --blue: #54a9d6;
  --lime: #c5f06b;
  --white: #fff;
  font-family: Inter, "Noto Sans SC", "Microsoft Yahei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 85% 0, #183235 0, transparent 35rem), var(--bg);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--cyan); }
.shell { min-height: 100vh; }

.nav {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(5vw, 24px);
  border-bottom: 1px solid #26383a;
  background: #101619eF;
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-weight: 800; display: flex; align-items: center; gap: 10px; }
.brand b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #06101d;
}
.brand small { display: block; color: var(--muted); font-size: 9px; }
.navlinks { display: flex; gap: 25px; align-items: center; font-size: 14px; color: var(--muted); }
.navlinks a { transition: color .2s ease, transform .2s ease; }
.navlinks a:hover, .navlinks a.active { color: var(--white); transform: translateY(-2px); }
.btn {
  border: 1px solid transparent;
  padding: 11px 17px;
  border-radius: 6px;
  background: var(--cyan);
  color: #071314;
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px #54e4e440; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.menu { display: none; background: none; border: 0; color: white; font-size: 24px; }

.hero, .wrap { width: min(1180px, 90vw); margin: auto; }
.hero {
  padding: 100px 0 78px;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 42px;
  align-items: center;
  min-height: 620px;
}
.kicker { color: var(--cyan); font-size: 12px; text-transform: uppercase; }
.hero h1 { font-size: 68px; line-height: 1.08; margin: 20px 0; white-space: pre-line; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero p, .lead { color: var(--muted); font-size: 17px; max-width: 580px; }
.actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-visual { height: 390px; position: relative; display: grid; place-items: center; }
.orb {
  width: 330px;
  height: 290px;
  border: 1px solid #4c8887;
  border-radius: 4px;
  background: repeating-linear-gradient(0deg, transparent 0 27px, #54e4e418 28px),
    repeating-linear-gradient(90deg, transparent 0 27px, #54e4e418 28px);
  box-shadow: 0 0 0 14px #54e4e410, 0 0 55px #54e4e420;
  transform: rotate(-7deg);
  animation: float 7s ease-in-out infinite;
}
.terminal {
  position: absolute;
  width: 82%;
  padding: 18px;
  border: 1px solid #4c8887;
  background: #111b1ddd;
  backdrop-filter: blur(12px);
  border-radius: 8px;
  box-shadow: 0 30px 70px #0008;
}
.dots { color: var(--cyan); }
.terminal pre { white-space: pre-wrap; font-size: 13px; color: #cce8e7; line-height: 2.1; }
.terminal strong { color: var(--lime); }
@keyframes float { 50% { transform: rotate(-5deg) translateY(-12px); } }
.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #cce3df;
  padding: 16px 5vw;
  display: flex;
  gap: 40px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
}

.section { padding: 95px 0; }
.section.alt { background: #141e21; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 40px; }
.heading h2 { font-size: 42px; margin: 8px 0 0; line-height: 1.15; }
.heading p { color: var(--muted); max-width: 380px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: linear-gradient(145deg, #1b292b, #141d20);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 25px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}
.card:hover, .card:focus-within { transform: translateY(-5px); border-color: var(--cyan); box-shadow: 0 14px 36px #0003; }
.card .num { color: var(--cyan); font-size: 12px; }
.card h3 { font-size: 21px; margin: 28px 0 8px; }
.card p, .meta { color: var(--muted); font-size: 14px; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 20px; }
.tag { font-size: 12px; border: 1px solid #46605f; border-radius: 4px; padding: 4px 9px; color: #c6d9d7; }
.arrow { color: var(--cyan); font-size: 22px; position: absolute; right: 22px; bottom: 18px; }
.case { padding: 0; }
.case-visual {
  height: 210px;
  background: linear-gradient(135deg, #17505a, #172b32 55%, #53683e);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 24px;
  transition: transform .35s ease;
}
.case:nth-child(2) .case-visual { background: linear-gradient(135deg, #283d50, #4c5666); }
.case:nth-child(3) .case-visual { background: linear-gradient(135deg, #174b42, #268977); }
.case .inner { padding: 22px; }
.case-image { height: 240px; object-fit: cover; width: 100%; transition: transform .35s ease; }
.case:hover .case-visual, .case:hover .case-image { transform: scale(1.025); }

.page-hero { padding: 80px 0 45px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: 56px; margin: 10px 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 34px; }
.filter {
  background: #1a292c;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 4px;
  cursor: pointer;
}
.filter.active { background: var(--cyan); color: #06111e; border-color: var(--cyan); }
.detail { width: min(840px, 90vw); margin: auto; padding: 70px 0; }
.detail h1 { font-size: 50px; line-height: 1.2; }
.detail .body { font-size: 17px; color: #c4d4e4; white-space: pre-line; }
.detail-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 6px; margin: 22px 0; }

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 45px; }
.form { padding: 27px; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; }
.form label { display: block; color: #cce1df; font-size: 13px; margin-top: 16px; }
.form input, .form textarea, .form select {
  width: 100%;
  padding: 11px;
  background: #10191b;
  border: 1px solid #344b4b;
  border-radius: 4px;
  color: white;
  margin-top: 5px;
}
.form textarea { min-height: 112px; resize: vertical; }
.message { margin-top: 12px; color: var(--lime); font-size: 14px; }
.error { color: #ff9c9c; }
.footer {
  padding: 30px 5vw;
  background: #0b1012;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.chat-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  border: 0;
  border-radius: 50%;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  font-size: 24px;
  box-shadow: 0 10px 35px #54e4e455;
  cursor: pointer;
  transition: transform .2s ease;
}
.chat-toggle:hover { transform: translateY(-3px) scale(1.04); }
.chat {
  position: fixed;
  z-index: 31;
  right: 24px;
  bottom: 92px;
  width: min(370px, calc(100vw - 32px));
  border: 1px solid #4c8887;
  border-radius: 8px;
  background: #111b1df2;
  backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 20px 80px #0009;
}
.chat header { padding: 15px 17px; background: #1b3031; font-weight: 700; }
.chatlog { height: 300px; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: 6px; background: #263b3d; color: #d9eae8; font-size: 14px; }
.bubble.me { align-self: end; background: #246c72; color: white; }
.chat form { display: flex; padding: 11px; border-top: 1px solid var(--line); gap: 8px; }
.chat input { min-width: 0; flex: 1; padding: 10px; background: #10191b; border: 1px solid #344b4b; color: white; border-radius: 4px; }

.admin { background: #f4f7f6; color: #18282b; min-height: 100vh; color-scheme: light; }
.admin header { padding: 16px 4vw; background: #152528; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.admin main { width: min(1250px, 94vw); margin: 28px auto; }
.admin-grid { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.admin-side, .admin-card {
  background: white;
  border-radius: 6px;
  padding: 10px;
  height: max-content;
  box-shadow: 0 3px 15px #18304a16;
}
.admin-side button { border: 0; background: none; width: 100%; text-align: left; padding: 11px; border-radius: 4px; cursor: pointer; }
.admin-side button.active { background: #e3f3f1; color: #006b70; }
.admin-card { padding: 22px; }
.admin-card h2 { margin-top: 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 7px; border-bottom: 1px solid #e6edf0; }
.admin-table td:last-child { white-space: nowrap; }
.tiny { padding: 6px 9px; font-size: 12px; margin-right: 4px; }
.modal { position: fixed; inset: 0; background: #0008; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal .form { width: min(600px, 100%); max-height: 90vh; overflow: auto; }
.login { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login .form { width: min(400px, 90vw); }
.settings-form { max-width: 850px; }
.settings-form h3 { margin: 30px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); color: #b9eaff; }
.settings-form h3:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.settings-form input[type=checkbox] { width: auto; accent-color: #1597a0; }
.settings-form textarea[name=navigation] { font-family: ui-monospace, Consolas, monospace; font-size: 13px; min-height: 170px; }
.settings-form .meta { margin: 14px 0; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
@media (max-width: 760px) {
  .navlinks { display: none; }
  .navlinks.open {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: #10191b;
    flex-direction: column;
    align-items: stretch;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
  }
  .navlinks a { padding: 7px 0; }
  .menu { display: block; }
  .hero { grid-template-columns: 1fr; padding-top: 60px; gap: 12px; }
  .hero h1 { font-size: 46px; }
  .hero-visual { height: 280px; }
  .orb { width: min(300px, 80vw); height: 230px; }
  .grid { grid-template-columns: 1fr; }
  .heading { display: block; }
  .heading h2 { font-size: 34px; }
  .heading p { margin-top: 14px; }
  .contact { grid-template-columns: 1fr; }
  .page-hero { padding: 56px 0 34px; }
  .page-hero h1 { font-size: 40px; }
  .detail h1 { font-size: 36px; overflow-wrap: anywhere; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-side { display: flex; overflow: auto; }
  .admin-side button { width: auto; min-width: max-content; }
  .admin-table { font-size: 12px; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }
  .admin-card { min-width: 0; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
