:root {
  --bg: #07101d;
  --surface: rgba(14, 25, 42, 0.82);
  --surface-hover: rgba(21, 36, 58, 0.96);
  --line: rgba(148, 163, 184, 0.15);
  --line-strong: rgba(148, 163, 184, 0.3);
  --text: #edf4ff;
  --muted: #8ea0b8;
  --subtle: #5f7189;
  --green: #5ee095;
  --radius-lg: 18px;
  --ease: 220ms cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; }

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 520px at -8% -12%, rgba(21, 128, 61, 0.2), transparent 60%),
    radial-gradient(760px 460px at 108% 0%, rgba(14, 116, 144, 0.18), transparent 58%),
    linear-gradient(145deg, #08111f 0%, #050b14 100%);
  font-family: "Avenir Next", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.36;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

.page-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  left: 52%;
  top: -250px;
  border-radius: 50%;
  background: rgba(94, 224, 149, 0.2);
  filter: blur(90px);
  pointer-events: none;
}

a { color: inherit; }

.site-header,
.workspace,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(1380px, calc(100% - 44px));
  margin-inline: auto;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 224, 149, 0.42);
  border-radius: 13px;
  color: #06120b;
  background: linear-gradient(135deg, #8af0b5, #43ca7c);
  box-shadow: 0 12px 30px rgba(67, 202, 124, 0.18);
  font-size: 18px;
  font-weight: 900;
}

.brand-copy { display: grid; }
.brand-copy strong { font-size: 15px; letter-spacing: 0.01em; }
.brand-copy small {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.account-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px 0 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(15, 23, 42, .5);
  text-decoration: none;
  transition: border-color var(--ease), background var(--ease);
}
.account-button:hover { border-color: var(--line-strong); background: rgba(21, 36, 58, .78); }
.account-avatar {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #06120b;
  background: linear-gradient(135deg, #8af0b5, #43ca7c);
  font-size: 9px;
  font-weight: 900;
}
.account-copy { display: grid; }
.account-copy strong { font-size: 10px; line-height: 1.2; }
.account-copy small { color: var(--subtle); font-size: 8px; }
.logout-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(148, 163, 184, .05);
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.logout-icon:hover { color: var(--text); border-color: var(--line-strong); background: rgba(148, 163, 184, .1); }
.logout-icon svg { width: 17px; height: 17px; }

.access-chip,
.dsm-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 750;
}

.access-chip {
  gap: 8px;
  padding: 0 14px;
  color: #b9c7d9;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.5);
}

.access-chip b { font-weight: 750; }
.access-chip > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(94, 224, 149, 0.7);
}

.access-chip.is-external > span {
  background: #f6bd60;
  box-shadow: 0 0 12px rgba(246, 189, 96, 0.58);
}

.dsm-button {
  gap: 9px;
  padding: 0 16px;
  color: #07110b;
  background: linear-gradient(135deg, #7be8a9, #42cb7b);
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(66, 203, 123, 0.18);
  transition: transform var(--ease), box-shadow var(--ease);
}

.dsm-button svg { width: 17px; height: 17px; }
.dsm-button:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(66, 203, 123, 0.28); }
.workspace { padding: 42px 0 28px; }

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 36px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.intro h1 {
  font-size: clamp(34px, 4.3vw, 62px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.intro > p {
  max-width: 330px;
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 15px;
  text-align: right;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 { font-size: 18px; letter-spacing: -0.02em; }
.section-heading span { color: var(--subtle); font-size: 12px; }

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

.app-card {
  --tone: #22c55e;
  position: relative;
  min-height: 214px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(260px 180px at 0% 0%, color-mix(in srgb, var(--tone) 15%, transparent), transparent 68%),
    var(--surface);
  box-shadow: 0 16px 42px rgba(2, 6, 23, 0.22);
  text-decoration: none;
  transition: transform var(--ease), border-color var(--ease), background-color var(--ease), box-shadow var(--ease);
}

.app-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--tone), transparent);
  transition: opacity var(--ease);
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--tone) 42%, var(--line-strong));
  background-color: var(--surface-hover);
  box-shadow: 0 22px 54px rgba(2, 6, 23, 0.36);
}

.app-card:hover::after { opacity: 0.9; }
.app-card:hover .app-arrow { transform: translate(2px, -2px); color: var(--tone); }
.app-card__top { display: flex; align-items: center; justify-content: space-between; }

.app-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  border-radius: 13px;
  color: color-mix(in srgb, var(--tone) 82%, white);
  background: color-mix(in srgb, var(--tone) 13%, rgba(15, 23, 42, 0.7));
}

.app-icon svg { width: 22px; height: 22px; }
.app-arrow { color: var(--subtle); font-size: 20px; transition: transform var(--ease), color var(--ease); }
.app-card__body { margin-top: 22px; }

.app-number {
  display: block;
  margin-bottom: 4px;
  color: color-mix(in srgb, var(--tone) 72%, var(--muted));
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.app-card h3 {
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.app-card p { margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.app-port {
  margin-top: auto;
  padding-top: 16px;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.app-card[hidden] { display: none; }

.tone-teal { --tone: #2dd4bf; }
.tone-green { --tone: #5ee095; }
.tone-blue { --tone: #38bdf8; }
.tone-cyan { --tone: #22d3ee; }
.tone-amber { --tone: #f6bd60; }
.tone-slate { --tone: #a7b5c8; }
.tone-indigo { --tone: #8b9eff; }
.tone-coral { --tone: #fb7185; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 24px;
  color: var(--subtle);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-card:focus-visible,
.dsm-button:focus-visible,
.brand:focus-visible {
  outline: 2px solid #7be8a9;
  outline-offset: 4px;
}

@media (max-width: 1080px) {
  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .site-header, .workspace, .site-footer { width: min(100% - 30px, 1380px); }
  .site-header { min-height: 72px; }
  .brand-copy small, .access-chip { display: none; }
  .account-copy { display: none; }
  .account-button { padding: 0 6px; }
  .workspace { padding-top: 28px; }
  .intro { display: block; margin-bottom: 28px; }
  .intro > p { margin-top: 10px; padding: 0; text-align: left; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .app-card { min-height: 196px; padding: 15px; }
}

@media (max-width: 520px) {
  .brand-mark { width: 38px; height: 38px; }
  .brand-copy strong { font-size: 14px; }
  .dsm-button { min-height: 40px; padding: 0 13px; }
  .dsm-button svg { display: none; }
  .header-actions { gap: 7px; }
  .account-button, .logout-icon { min-height: 40px; height: 40px; }
  .intro h1 { font-size: 36px; }
  .section-heading { margin-bottom: 12px; }
  .app-grid { grid-template-columns: 1fr; }
  .app-card { min-height: 178px; }
  .app-card__body { margin-top: 15px; }
  .site-footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
