:root {
  color-scheme: dark;
  --bg: #071017;
  --panel: #101922;
  --panel-2: #0b141d;
  --line: #233341;
  --line-soft: rgba(107, 132, 153, 0.24);
  --text: #eef7f3;
  --muted: #8fa2ad;
  --soft: #c6d4d6;
  --cyan: #5fe3d0;
  --cyan-2: #8af7e8;
  --danger: #ff5d72;
  --amber: #f2c15a;
  --green: #78e08f;
  --ink: #020609;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(95, 227, 208, 0.12), transparent 34%),
    linear-gradient(180deg, #071017 0%, #050a0f 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
}
body.browser-blocked .phone-app {
  display: none;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.browser-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(95,227,208,.18), transparent 34%),
    linear-gradient(180deg, #071017 0%, #04080d 100%);
}
.browser-gate[hidden] {
  display: none;
}
.gate-card {
  width: min(100%, 390px);
  border: 1px solid rgba(95,227,208,.28);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18,30,40,.97), rgba(8,15,22,.97));
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  padding: 22px 18px;
  text-align: center;
}
.gate-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--cyan), var(--amber));
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
}
.gate-card h1 {
  margin-bottom: 10px;
  font-size: 25px;
}
.gate-copy {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.75;
}
.gate-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 18px 0 12px;
}
.gate-actions a {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(95,227,208,.45);
  border-radius: 10px;
  color: var(--cyan-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  background: rgba(95,227,208,.08);
}
.gate-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.phone-app {
  width: 100%;
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  background: linear-gradient(180deg, #0a131c 0%, #05090d 100%);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.05);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(7, 16, 23, 0.94);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.brandmark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  border-radius: 10px;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(95, 227, 208, .24);
}
.brandcopy { flex: 1; min-width: 0; }
.brandcopy strong { display: block; font-size: 14px; }
.brandcopy span { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.language-pill {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 138px;
  border: 1px solid rgba(242, 193, 90, .42);
  border-radius: 999px;
  padding: 5px 8px 5px 6px;
  background: linear-gradient(135deg, rgba(242,193,90,.14), rgba(95,227,208,.08));
  color: var(--text);
}
.language-pill span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber), #ff9d56);
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}
.language-pill select {
  min-width: 0;
  width: 86px;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.16);
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 3px 0 3px 7px;
  font-size: 12px;
  font-weight: 900;
}
.language-pill option {
  color: #111827;
  background: #fff;
}
.chain-pill {
  border: 1px solid rgba(95, 227, 208, .45);
  background: rgba(95, 227, 208, .08);
  color: var(--cyan-2);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 800;
}
#google_translate_element {
  position: fixed;
  left: -1000px;
  top: -1000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget-icon,
.goog-logo-link,
.goog-te-gadget span {
  display: none !important;
}
.goog-te-gadget {
  height: 0 !important;
  overflow: hidden !important;
}
body {
  top: 0 !important;
}

.viewport {
  padding: 14px 12px 96px;
}
.view { display: none; animation: rise .22s ease-out; }
.view.active { display: block; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-panel,
.title-card,
.score-card,
.search-panel,
.feed-card,
.list-card,
.guide-card,
.report-card,
.result-card,
.badge-card {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(18, 30, 40, .96), rgba(10, 18, 26, .96));
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .24);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  padding: 16px;
  min-height: 166px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--cyan);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 23px; line-height: 1.12; }
h2 { margin-bottom: 0; font-size: 14px; }
h3 { margin-bottom: 7px; font-size: 16px; line-height: 1.28; }
.lead, .title-card p, .score-card p {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.65;
  margin-bottom: 0;
}
.radar {
  position: relative;
  min-height: 112px;
  display: grid;
  place-items: center;
  align-self: center;
}
.radar span {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(95,227,208,.26);
}
.radar span:nth-child(2) { inset: 26px; border-color: rgba(242,193,90,.32); }
.radar span:nth-child(3) { inset: 44px; border-color: rgba(255,93,114,.30); }
.radar b { position: relative; color: var(--cyan-2); font-size: 23px; z-index: 1; }
.radar small { position: absolute; top: 70px; color: var(--muted); font-size: 10px; }

.search-panel { margin-top: 12px; padding: 13px; }
.search-panel label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
}
.input-row, .scan-box, .chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #061019;
  color: var(--text);
  outline: none;
  padding: 11px 10px;
  font-size: 12px;
  font-family: Consolas, "Courier New", monospace;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(95,227,208,.11); }
button {
  border: 0;
  border-radius: 9px;
  background: var(--cyan);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  min-height: 38px;
}
.link-button {
  width: auto;
  min-height: 0;
  margin-top: 8px;
  padding: 0;
  background: transparent;
  color: var(--amber);
  font-size: 11px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 1px 9px;
}
.section-head span {
  color: var(--cyan);
  font-size: 11px;
  font-family: Consolas, "Courier New", monospace;
}
.compact { margin: 0 0 10px; }

.feature-card {
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
}
.feature-card img {
  width: 100%;
  height: 168px;
  object-fit: cover;
}
.feature-body { padding: 13px; }
.tag {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}
.feature-body p, .feed-list p, .guide-card span, .approval-meta, .result-card p {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.65;
}
.feature-body button { width: 100%; margin-top: 4px; }
.danger { border-color: rgba(255,93,114,.45); }
.danger .tag, .danger-border { color: var(--danger); border-color: rgba(255,93,114,.44); }
.danger button, .wide-danger, .report-card button { background: var(--danger); color: white; }
.amber { border-color: rgba(242,193,90,.45); }
.amber .tag { color: var(--amber); background: rgba(242,193,90,.12); }
.amber button { background: var(--amber); }
.cyan { border-color: rgba(95,227,208,.42); }
.cyan .tag, .cyan-border { color: var(--cyan); border-color: rgba(95,227,208,.42); }

.feed-card, .list-card, .guide-card, .report-card, .result-card, .badge-card { padding: 13px; margin-top: 12px; }
.feed-list { display: grid; gap: 9px; }
.feed-list article, .approval-item, .guide-card li, .chat-message, .quick-prompts button {
  border: 1px solid var(--line-soft);
  background: #07111a;
  border-radius: 10px;
}
.feed-list article { padding: 11px; }
.feed-list b {
  color: var(--danger);
  font-size: 10px;
  font-family: Consolas, "Courier New", monospace;
}
.feed-list h3 { margin: 5px 0; font-size: 13px; }
.feed-list small { color: var(--muted); font-size: 10px; }

.title-card, .score-card { padding: 15px; margin-bottom: 12px; }
.score-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 12px;
  align-items: center;
}
.scorebox {
  border: 1px solid rgba(242,193,90,.42);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  color: var(--amber);
  background: rgba(242,193,90,.08);
}
.scorebox b { display: block; font-size: 24px; }
.scorebox span { font-size: 10px; font-family: Consolas, "Courier New", monospace; }
.scan-box { margin-bottom: 9px; }
.preset-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.preset-row::-webkit-scrollbar, .drill-tabs::-webkit-scrollbar { display: none; }
.preset-row button, .drill-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
}
.preset-row button.active, .drill-tabs button.active {
  border-color: var(--cyan);
  background: rgba(95,227,208,.12);
  color: var(--cyan-2);
}
.risk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
}
.risk-score { font-size: 32px; font-weight: 900; font-family: Consolas, "Courier New", monospace; }
.risk-badge {
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
}
.risk-critical { color: var(--danger); background: rgba(255,93,114,.12); }
.risk-safe { color: var(--cyan); background: rgba(95,227,208,.12); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag-row span {
  padding: 5px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--soft);
  font-size: 10px;
  font-family: Consolas, "Courier New", monospace;
}
.check-grid { display: grid; gap: 7px; }
.check-grid div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: #061019;
  color: var(--soft);
  font-size: 11px;
}
.ask-ai { width: 100%; margin-top: 12px; background: transparent; border: 1px solid rgba(95,227,208,.5); color: var(--cyan-2); }

.drill-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 7px;
  scrollbar-width: none;
}
.drill-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.drill-cover { position: relative; height: 180px; }
.drill-cover img { width: 100%; height: 100%; object-fit: cover; }
.drill-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(16,25,34,.96));
}
.drill-title {
  position: absolute;
  z-index: 1;
  left: 13px;
  right: 13px;
  bottom: 12px;
}
.drill-title h2 { font-size: 17px; margin-bottom: 5px; }
.drill-title p { margin: 0; color: var(--soft); font-size: 12px; }
.drill-body { padding: 13px; }
.scenario, pre {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #061019;
  padding: 11px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}
pre {
  max-height: 190px;
  overflow: auto;
  color: var(--amber);
  font-size: 10px;
  font-family: Consolas, "Courier New", monospace;
}
.option-list { display: grid; gap: 8px; margin-top: 10px; }
.option-list button {
  min-height: 0;
  padding: 11px;
  text-align: left;
  border: 1px solid var(--line-soft);
  background: #061019;
  color: var(--soft);
  line-height: 1.55;
}
.option-list button.correct { border-color: var(--cyan); color: var(--cyan-2); background: rgba(95,227,208,.1); }
.option-list button.wrong { border-color: var(--danger); color: #ffc3cb; background: rgba(255,93,114,.1); }
.feedback {
  margin-top: 10px;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: #061019;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.65;
}
.feedback button { width: 100%; margin-top: 8px; background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.badge-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.badge-card strong, .badge-card span { display: block; }
.badge-card span { color: var(--muted); font-size: 11px; margin-top: 3px; }
.badge-card b { color: var(--amber); font-size: 11px; white-space: nowrap; }

.wide-danger { width: 100%; margin-top: 12px; }
.approval-list { display: grid; gap: 9px; }
.approval-item { padding: 11px; }
.approval-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 9px;
}
.asset-name { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 900; }
.asset-name span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-family: Consolas, "Courier New", monospace;
}
.approval-meta { margin: 8px 0 0; font-family: Consolas, "Courier New", monospace; font-size: 10px; }
.revoke-btn { min-height: 32px; padding: 0 10px; background: rgba(255,93,114,.12); border: 1px solid rgba(255,93,114,.42); color: #ffc3cb; }
.risk-label { font-size: 10px; padding: 4px 6px; border-radius: 6px; font-family: Consolas, "Courier New", monospace; }
.level-HIGH { color: var(--danger); background: rgba(255,93,114,.12); }
.level-MEDIUM { color: var(--amber); background: rgba(242,193,90,.12); }
.level-LOW { color: var(--cyan); background: rgba(95,227,208,.1); }
.guide-card h2, .report-card h2 { font-size: 14px; margin-bottom: 10px; }
.guide-card ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.guide-card li { padding: 10px; }
.guide-card b { display: block; color: var(--amber); font-size: 12px; margin-bottom: 4px; }
.report-card { display: grid; gap: 8px; }

.quick-prompts { display: grid; gap: 7px; margin-bottom: 10px; }
.quick-prompts button {
  width: 100%;
  min-height: 0;
  padding: 11px;
  text-align: left;
  color: var(--soft);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  line-height: 1.45;
}
.chat-log {
  min-height: 300px;
  max-height: 430px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.chat-message {
  padding: 10px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.65;
}
.chat-message.user {
  margin-left: 28px;
  border-color: rgba(242,193,90,.34);
  background: rgba(242,193,90,.08);
}
.chat-message.ai { margin-right: 28px; }
.chat-message b {
  display: block;
  color: var(--cyan);
  font-size: 10px;
  font-family: Consolas, "Courier New", monospace;
  margin-bottom: 5px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  background: rgba(7,16,23,.96);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(16px);
}
.bottom-nav button {
  position: relative;
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
}
.bottom-nav span { font-size: 19px; line-height: 1; }
.bottom-nav b { font-size: 10px; line-height: 1; }
.bottom-nav button.active {
  color: var(--cyan-2);
  border-color: rgba(95,227,208,.32);
  background: rgba(95,227,208,.1);
}
.bottom-nav em {
  position: absolute;
  right: 7px;
  top: 5px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  font-style: normal;
  font-size: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
}
.bottom-nav button[data-tab="emergency"] em { background: var(--danger); color: white; }

.detail-modal {
  width: min(94vw, 410px);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}
.detail-modal::backdrop { background: rgba(0,0,0,.72); }
.modal-shell {
  position: relative;
  max-height: 82vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 15px;
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  min-height: 34px;
  background: #061019;
  color: var(--text);
  border: 1px solid var(--line);
}
.modal-shell h2 { margin-top: 6px; font-size: 19px; }
.modal-shell p, .modal-shell li { color: var(--soft); font-size: 12px; line-height: 1.7; }
.modal-shell img { border-radius: 10px; margin: 10px 0; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 70px;
  width: min(92vw, 390px);
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  border-radius: 11px;
  background: var(--cyan);
  color: var(--ink);
  padding: 11px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(0,0,0,.34);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .viewport { padding-left: 9px; padding-right: 9px; }
  h1 { font-size: 21px; }
  .hero-panel { grid-template-columns: 1fr; }
  .radar { display: none; }
  .input-row, .scan-box, .chat-form { grid-template-columns: 1fr 64px; }
  .topbar { flex-wrap: wrap; }
  .brandcopy { flex-basis: calc(100% - 48px); }
  .top-actions { width: 100%; justify-content: space-between; }
  .language-pill { max-width: 170px; }
  .language-pill select { width: 118px; }
}
