:root {
  color-scheme: light;
  --bg: #f4f9fb;
  --card: #ffffff;
  --ink: #102a37;
  --muted: #66808d;
  --line: #d7e6eb;
  --teal: #009b83;
  --shadow: 0 18px 55px rgba(22, 62, 76, 0.11);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071923;
  --card: #0d2430;
  --ink: #ecfbff;
  --muted: #91aeb9;
  --line: #25434f;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 35%, rgba(42, 193, 174, 0.1), transparent 30%),
    radial-gradient(circle at 100% 70%, rgba(91, 130, 255, 0.09), transparent 32%),
    var(--bg);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  transition: color 0.25s ease, background 0.25s ease;
}

.circuit-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(68, 130, 149, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 130, 149, 0.1) 1px, transparent 1px);
  background-size: 42px 42px;
}

.portal-shell {
  position: relative;
  width: min(1440px, calc(100% - 48px));
  min-height: 100vh;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink);
  text-decoration: none;
}

.cvte-logo {
  color: var(--teal);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -3px;
}

.brand-divider { width: 1px; height: 42px; background: var(--line); }
.brand-copy strong { display: block; font-size: 15px; letter-spacing: 2px; }
.brand-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.tool-status,
.theme-switch {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  color: var(--muted);
  font: inherit;
}

.tool-status i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(0, 155, 131, 0.1);
}

.theme-switch {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-switch:hover { transform: translateY(-1px); border-color: rgba(0, 155, 131, 0.55); }
.theme-icon { margin-right: 6px; }

.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 68px 0 88px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.section-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 155, 131, 0.35);
  border-radius: 15px;
  background: rgba(0, 155, 131, 0.07);
  color: var(--teal);
}

.section-icon svg,
.card-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-title p {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
}

.section-title h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -2px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.tool-card {
  --accent: #009b83;
  position: relative;
  min-height: 390px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: color-mix(in srgb, var(--card) 95%, transparent);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.tool-card[data-accent="blue"] { --accent: #397cf2; }
.tool-card[data-accent="amber"] { --accent: #cc7000; }
.tool-card[data-accent="violet"] { --accent: #7857d9; }

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 76px;
  height: 3px;
  background: var(--accent);
}

.tool-card::after {
  content: "";
  position: absolute;
  right: -105px;
  bottom: -120px;
  width: 230px;
  height: 230px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 46px color-mix(in srgb, var(--accent) 4%, transparent),
    0 0 0 92px color-mix(in srgb, var(--accent) 2%, transparent);
}

.tool-card:hover {
  transform: translateY(-9px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 28px 70px color-mix(in srgb, var(--accent) 16%, rgba(0, 0, 0, 0.08));
}

.card-top { display: flex; justify-content: space-between; align-items: flex-start; }

.card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  color: var(--accent);
}

.card-number { color: #9babb3; font: 12px ui-monospace, monospace; letter-spacing: 3px; }

.eyebrow {
  margin: 46px 0 18px;
  color: var(--accent);
  font: 800 13px ui-monospace, monospace;
  letter-spacing: 2px;
}

.tool-card h2 { margin: 0 0 18px; font-size: 31px; line-height: 1.15; letter-spacing: -1px; }

.card-description {
  min-height: 86px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 23px 0; }
.tags span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.enter { position: relative; z-index: 1; margin-top: auto; color: var(--accent); }
.enter span { display: inline-block; transition: transform 0.2s ease; }
.tool-card:hover .enter span { transform: translateX(5px); }

.site-footer {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .portal-shell { width: min(980px, calc(100% - 38px)); }
  .portal-main { justify-content: flex-start; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .portal-shell { width: min(520px, calc(100% - 24px)); }
  .site-header { height: 92px; }
  .brand-copy, .tool-status { display: none; }
  .header-actions { margin-left: auto; }
  .portal-main { padding: 48px 0 60px; }
  .section-title h1 { font-size: 35px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 350px; }
  .site-footer { flex-direction: column; justify-content: center; gap: 8px; text-align: center; }
}
