:root {
  --bg: #080808;
  --panel: #11100e;
  --panel-2: #15120d;
  --gold: #F5A623;
  --gold-soft: #FFD369;
  --gold-dim: #8A5A06;
  --green: #2ee58f;
  --blue: #4da3ff;
  --red: #ff4d5f;
  --pink: #f044a6;
  --text: #F0EDE8;
  --muted: rgba(240, 237, 232, 0.58);
  --faint: rgba(240, 237, 232, 0.36);
  --border: rgba(245, 166, 35, 0.18);
  --line: rgba(245, 166, 35, 0.35);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background:
    linear-gradient(90deg, rgba(245, 166, 35, 0.024) 1px, transparent 1px),
    linear-gradient(180deg, rgba(245, 166, 35, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 10% 0%, rgba(245, 166, 35, 0.15), transparent 30%),
    #080808;
  background-size: 6px 6px, 6px 6px, auto, auto;
}

a { color: inherit; }

.support-shell {
  min-height: 100vh;
  padding: 44px 72px 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.support-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.support-brand {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.support-brand:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}

.support-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  margin-bottom: 18px;
  padding: 0 16px;
  border: 1px solid rgba(245, 166, 35, 0.28);
  color: var(--gold-soft);
  background: rgba(12, 10, 8, 0.58);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  transition: border-color .2s ease, background .2s ease;
}

.support-back-link:hover,
.support-back-link:focus-visible {
  border-color: var(--gold);
  background: rgba(245, 166, 35, 0.08);
}

.support-logo {
  width: 82px;
  height: 82px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.76);
  box-shadow: 0 0 32px rgba(245, 166, 35, 0.16);
}

.support-title {
  margin: 0;
  font-family: Georgia, "Cormorant Garamond", serif;
  font-size: clamp(38px, 4.8vw, 76px);
  line-height: 0.9;
  color: var(--gold);
  letter-spacing: 0;
}

.support-title .zh {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-weight: 900;
}

.support-subtitle {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
  font-size: clamp(16px, 1.6vw, 24px);
  letter-spacing: 0;
}

.support-free-note {
  margin: -12px 0 2px;
  color: rgba(255, 211, 105, 0.9);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 700;
}

.support-kicker {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(12, 10, 8, 0.82);
  padding: 0 16px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
}

.support-meta {
  margin-top: 28px;
  color: var(--faint);
  text-align: right;
  font-size: 12px;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
  width: min(1420px, 100%);
  align-self: center;
}

.module-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  cursor: pointer;
}

.module-card:hover {
  border-color: rgba(245, 166, 35, 0.48);
  background: rgba(245, 166, 35, 0.055);
}

.module-card:focus-visible {
  outline: 2px solid rgba(245, 166, 35, 0.72);
  outline-offset: 3px;
}

.module-card.relation { border-left: 3px solid var(--gold); }
.module-card.ops { border-left: 3px solid var(--green); }
.module-card.money { border-left: 3px solid var(--red); }
.module-card.urgent { border-left: 3px solid var(--pink); }

.module-icon {
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 166, 35, 0.48);
  border-radius: 6px;
  color: var(--gold);
  background: rgba(245, 166, 35, 0.08);
}

.module-icon svg {
  width: 29px;
  height: 29px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.module-code {
  font-family: Georgia, serif;
  color: var(--gold-soft);
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 3px;
}

.module-title {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
  color: var(--text);
}

.module-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.support-footer-bar {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.live-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  border: 1px solid rgba(46, 229, 143, 0.42);
  color: #74f2ae;
  padding: 0 16px;
  font-weight: 900;
  font-size: 13px;
  background: rgba(46, 229, 143, 0.06);
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.7);
}

.support-cta {
  min-width: 430px;
  min-height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid rgba(255, 211, 105, 0.7);
  background: linear-gradient(180deg, #FFD369 0%, #F5A623 48%, #C47F0A 100%);
  color: #050505;
  text-decoration: none;
  font-size: 24px;
  font-weight: 950;
  box-shadow: 0 16px 48px rgba(245, 166, 35, 0.18);
}

.support-danger {
  justify-self: end;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  border: 1px solid rgba(255, 77, 95, 0.72);
  background: linear-gradient(180deg, rgba(255, 77, 95, 0.72), rgba(160, 22, 38, 0.84));
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.support-reset-link {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(245, 166, 35, 0.28);
  color: var(--gold-soft);
  background: rgba(12, 10, 8, 0.58);
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.support-reset-link:hover,
.support-reset-link:focus-visible {
  border-color: var(--gold);
  background: rgba(245, 166, 35, 0.08);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 0.95fr);
  gap: 64px;
  align-items: stretch;
}

.chat-title {
  margin: 16px 0 24px;
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: clamp(34px, 3vw, 48px);
}

.chat-panel,
.workbench {
  border: 1px solid var(--border);
  background: rgba(12, 12, 12, 0.62);
  border-radius: 8px;
}

.chat-panel {
  min-height: 660px;
  padding: 38px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 16px;
  align-items: center;
}

.message-row.agent {
  grid-template-columns: 1fr 48px;
  margin-left: 34%;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 950;
  border: 1px solid var(--border);
  background: #f5f1e9;
  color: #050505;
}

.avatar.m {
  color: var(--gold);
  background: rgba(0, 0, 0, 0.55);
  border-color: var(--gold);
  font-family: Georgia, serif;
  font-size: 28px;
}

.bubble {
  width: fit-content;
  max-width: 100%;
  padding: 18px 22px;
  border-radius: 7px;
  font-size: 21px;
  line-height: 1.55;
  font-weight: 800;
}

.bubble.customer {
  color: #050505;
  background: #f7f2e8;
  border: 1px solid rgba(245, 166, 35, 0.62);
}

.bubble.agent {
  color: #050505;
  background: linear-gradient(180deg, #FFD369, #F5A623);
}

.message-meta {
  grid-column: 2;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.message-row.agent .message-meta {
  grid-column: 1;
  text-align: left;
}

.workbench {
  padding: 28px;
  display: flex;
  flex-direction: column;
  min-height: 660px;
}

.workbench h2 {
  margin: 0 0 24px;
  font-size: 30px;
  color: var(--text);
}

.support-select,
.support-textarea {
  width: 100%;
  border: 1px solid rgba(245, 166, 35, 0.34);
  border-radius: 6px;
  color: var(--text);
  background: #090909;
  font-family: inherit;
  font-size: 15px;
}

.support-select {
  height: 54px;
  padding: 0 16px;
  font-weight: 800;
}

.draft-box {
  flex: 1;
  margin-top: 18px;
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: 6px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.34);
}

.draft-label {
  color: #9fc5ff;
  margin-bottom: 12px;
  font-weight: 850;
}

.support-textarea {
  min-height: 280px;
  resize: vertical;
  padding: 16px;
  line-height: 1.7;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.quick-chip {
  min-height: 48px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(245, 166, 35, 0.045);
  font-family: inherit;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
}

.quick-chip:hover {
  color: var(--gold-soft);
  border-color: rgba(245, 166, 35, 0.5);
}

.send-button {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #FFD369, #F5A623);
  color: #050505;
  font-size: 22px;
  font-weight: 950;
  font-family: inherit;
  cursor: pointer;
}

.send-note {
  margin-top: 10px;
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.module-map {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(360px, 0.9fr);
  gap: 36px;
}

.module-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.module-group {
  border: 1px solid var(--border);
  border-top-width: 3px;
  background: rgba(12, 12, 12, 0.66);
  border-radius: 8px;
  padding: 24px;
}

.module-group.relation { border-color: rgba(245, 166, 35, 0.65); }
.module-group.ops { border-color: rgba(46, 229, 143, 0.65); }
.module-group.money { border-color: rgba(255, 77, 95, 0.65); }
.module-group.urgent { border-color: rgba(240, 68, 166, 0.65); }

.module-group h2 {
  margin: 0;
  font-size: 28px;
}

.module-group .tier {
  color: var(--muted);
  margin: 8px 0 18px;
  font-size: 13px;
  font-weight: 800;
}

.module-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  border-top: 1px solid rgba(240, 237, 232, 0.08);
  font-weight: 900;
}

.module-row code {
  color: var(--gold-soft);
  font-family: Georgia, serif;
  font-size: 16px;
}

.tier-badge {
  border: 1px solid rgba(245, 166, 35, 0.36);
  color: var(--text);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
}

.stack-panel {
  border: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.7);
  border-radius: 8px;
  padding: 26px;
}

.stack-panel h2 {
  margin: 0 0 22px;
  font-family: Georgia, serif;
  color: var(--gold);
  font-size: 34px;
}

.stack-layer {
  border: 1px solid rgba(245, 166, 35, 0.28);
  background: rgba(245, 166, 35, 0.06);
  border-radius: 7px;
  padding: 20px;
}

.stack-layer + .stack-layer {
  margin-top: 18px;
  position: relative;
}

.stack-layer + .stack-layer::before {
  content: "↓";
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 22px;
}

.stack-layer h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.stack-layer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 750;
}

.stack-rules {
  margin-top: 26px;
  display: grid;
  gap: 12px;
}

.stack-rule {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 850;
}

.stack-rule strong {
  color: var(--gold-soft);
}

@media (max-width: 980px) {
  .support-shell { padding: 22px 16px 30px; }
  .support-header,
  .chat-layout,
  .module-map { grid-template-columns: 1fr; }
  .support-kicker,
  .support-meta { justify-self: start; text-align: left; margin-top: 0; }
  .support-free-note { margin-top: -8px; }
  .support-grid,
  .module-groups { grid-template-columns: 1fr; }
  .support-footer-bar { grid-template-columns: 1fr; }
  .support-cta,
  .support-reset-link,
  .support-danger,
  .live-badge { justify-self: stretch; min-width: 0; width: 100%; }
  .message-row,
  .message-row.agent { grid-template-columns: 42px minmax(0, 1fr); margin-left: 0; }
  .message-row.agent .avatar { grid-column: 1; grid-row: 1; }
  .message-row.agent .bubble { grid-column: 2; }
  .message-row.agent .message-meta { grid-column: 2; }
  .chat-panel,
  .workbench { min-height: auto; padding: 20px; }
  .quick-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .support-back-link { width: 100%; }
  .support-brand { grid-template-columns: 62px minmax(0, 1fr); gap: 12px; }
  .support-logo { width: 60px; height: 60px; padding: 7px; }
  .support-title { font-size: 34px; }
  .support-subtitle { font-size: 15px; }
  .module-card { grid-template-columns: 48px minmax(0, 1fr); padding: 16px; }
  .module-icon { width: 48px; }
  .module-title { font-size: 19px; }
  .bubble { font-size: 16px; padding: 14px 16px; }
  .module-row { grid-template-columns: 52px minmax(0, 1fr); }
  .tier-badge { grid-column: 2; width: fit-content; }
}
