/* =========================================================================
   桥源雅礼 · 典雅新中式黛青鎏金风 (Neo-Chinese Indigo-Jade & Antique Gold)
   ========================================================================= */

:root {
  --bg-void: #071519;
  --bg-deep: #0c2128;
  --bg-panel: rgba(10, 29, 35, 0.8);
  --bg-panel-strong: rgba(9, 25, 31, 0.94);
  --border-cyan: rgba(221, 190, 122, 0.34);
  --border-bright: rgba(235, 206, 138, 0.72);
  --jade: #6bc8b0;
  --jade-deep: #25685d;
  --cyan: #72cbb4;        /* Legacy alias -> Celadon Jade */
  --blue: #7ab8c9;        /* 天青 */
  --indigo: #8c9ec9;      /* 黛蓝 */
  --violet: #b993c7;      /* 藕荷紫 */
  --magenta: #d97a82;     /* 胭脂粉 */
  --gold: #e7c67c;        /* 温润古金 */
  --gold-deep: #b88b3a;   /* 沉金 */
  --cinnabar: #c63d2b;    /* 朱砂红 */
  --cinnabar-deep: #962316;
  --green: #69c7a8;       /* 翡翠青 */
  --danger: #e26d62;      /* 丹红 */
  --ivory: #f6efe2;       /* 宣纸暖白 */
  --text-main: #f3ede0;
  --text-dim: #aec4be;
  --text-muted: #6c8882;
  --font-serif: 'Songti SC', 'STSong', 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', Georgia, serif;
  --font-display: 'Songti SC', 'STSong', 'Noto Serif SC', 'PingFang SC', Georgia, serif;
  --font-ui: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'PingFang SC', 'Microsoft YaHei', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 78% 54% at 50% 42%, rgba(45, 118, 108, 0.2), transparent 68%),
    radial-gradient(ellipse 65% 45% at 15% 12%, rgba(221, 190, 122, 0.08), transparent 62%),
    radial-gradient(ellipse 60% 48% at 86% 88%, rgba(30, 82, 78, 0.22), transparent 65%);
}

/* Disable legacy sci-fi grid & scanlines completely */
.bg-grid-overlay,
.scanline-overlay {
  display: none !important;
}

#starfield-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
}

/* Custom Oriental Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 21, 25, 0.72);
}
::-webkit-scrollbar-thumb {
  background: rgba(221, 190, 122, 0.34);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(231, 198, 124, 0.62);
}

/* App Shell */
.app-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Oriental Gallery Header */
.hud-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: linear-gradient(180deg, rgba(8, 24, 29, 0.94), rgba(10, 29, 35, 0.86));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(221, 190, 122, 0.36);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(221, 190, 122, 0.14);
}

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

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(231, 198, 124, 0.28), rgba(18, 52, 54, 0.94));
  border: 1.5px solid rgba(231, 198, 124, 0.72);
  box-shadow: 0 0 18px rgba(221, 190, 122, 0.22), inset 0 0 10px rgba(107, 200, 176, 0.22);
  position: relative;
}

.brand-emblem svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(180deg, #fff8e7 0%, #e7c67c 68%, #c79a44 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #b7ccc5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(231, 198, 124, 0.75);
  animation: beacon 2.4s ease-in-out infinite;
}

.ticker-wrap {
  flex: 1;
  max-width: 520px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(7, 21, 25, 0.7);
  border: 1px solid rgba(221, 190, 122, 0.28);
  font-size: 12.5px;
}

.ticker-tag {
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #f6e3b0;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(198, 61, 43, 0.32);
  border: 1px solid rgba(231, 198, 124, 0.45);
  white-space: nowrap;
}

.ticker-content {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 12.5px;
}

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

/* Neo-Chinese Jade-Glass Framed Panel (Delicate Antique Gold Corners) */
.cyber-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(13, 36, 43, 0.84), rgba(9, 25, 31, 0.88));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(221, 190, 122, 0.34);
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 1px rgba(231, 198, 124, 0.08),
    inset 0 1px 0 rgba(255, 245, 220, 0.12),
    0 14px 36px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  contain: layout style;
}

/* Delicate antique-gold oriental corner filigree */
.cyber-panel::before,
.cyber-panel::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 3;
}

.cyber-panel::before {
  top: 5px;
  left: 5px;
  border-top: 1.5px solid rgba(231, 198, 124, 0.72);
  border-left: 1.5px solid rgba(231, 198, 124, 0.72);
  border-top-left-radius: 3px;
}

.cyber-panel::after {
  bottom: 5px;
  right: 5px;
  border-bottom: 1.5px solid rgba(231, 198, 124, 0.72);
  border-right: 1.5px solid rgba(231, 198, 124, 0.72);
  border-bottom-right-radius: 3px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(221, 190, 122, 0.22);
  background: linear-gradient(90deg, rgba(221, 190, 122, 0.1), rgba(107, 200, 176, 0.04) 55%, transparent);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #f7eed9;
}

.panel-title .code-tag {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(231, 198, 124, 0.78);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(231, 198, 124, 0.1);
  border: 1px solid rgba(231, 198, 124, 0.24);
}

.panel-body {
  padding: 15px 16px;
}

/* Oriental Ceremonial Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  user-select: none;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-ghost {
  background: rgba(14, 38, 44, 0.78);
  color: #e9e2d2;
  border-color: rgba(221, 190, 122, 0.34);
}
.btn-ghost:hover:not(:disabled) {
  border-color: rgba(231, 198, 124, 0.78);
  background: rgba(34, 78, 76, 0.6);
  color: #fff8e7;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Primary CTA: Cinnabar Seal Red & Antique Gold Trim */
.btn-primary {
  background: linear-gradient(180deg, #cf4632 0%, #a5281a 100%);
  color: #fff6e5;
  border-color: rgba(238, 206, 134, 0.75);
  box-shadow:
    0 6px 20px rgba(150, 35, 22, 0.45),
    inset 0 1px 0 rgba(255, 232, 185, 0.42),
    inset 0 0 0 1px rgba(255, 215, 140, 0.18);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 240, 200, 0.26) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}
.btn-primary:hover:not(:disabled)::after {
  transform: translateX(120%);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #dc4f39 0%, #b32e1e 100%);
  box-shadow: 0 10px 26px rgba(198, 61, 43, 0.52), 0 0 18px rgba(231, 198, 124, 0.25);
}

/* Secondary Jade & Gold Button */
.btn-surge {
  background: linear-gradient(180deg, rgba(35, 96, 86, 0.85), rgba(20, 62, 58, 0.92));
  color: #f6ead0;
  border-color: rgba(231, 198, 124, 0.52);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(167, 243, 208, 0.2);
}
.btn-surge:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(44, 118, 105, 0.92), rgba(24, 76, 70, 0.96));
  border-color: rgba(238, 208, 140, 0.85);
  box-shadow: 0 8px 22px rgba(37, 104, 93, 0.45);
}

/* Antique Brushed Gold Button */
.btn-gold {
  background: linear-gradient(135deg, #c6993e 0%, #edd089 52%, #c39337 100%);
  color: #1f1609;
  border-color: rgba(255, 245, 214, 0.65);
  box-shadow: 0 6px 20px rgba(184, 139, 58, 0.36), inset 0 1px 0 rgba(255, 252, 238, 0.55);
}
.btn-gold:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(231, 198, 124, 0.48);
}

.btn-danger {
  background: rgba(198, 61, 43, 0.18);
  color: #f5b3a8;
  border-color: rgba(226, 109, 98, 0.45);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(198, 61, 43, 0.34);
  border-color: #e26d62;
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-lg {
  padding: 13px 26px;
  font-size: 15.5px;
  border-radius: 12px;
}

/* Inputs */
.cyber-input, .cyber-select {
  width: 100%;
  padding: 10px 13px;
  background: rgba(6, 19, 23, 0.86);
  border: 1px solid rgba(221, 190, 122, 0.34);
  border-radius: 9px;
  color: #faf5ea;
  font-family: var(--font-ui);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.cyber-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.cyber-input:focus, .cyber-select:focus {
  border-color: var(--gold);
  background: rgba(8, 24, 29, 0.96);
  box-shadow: 0 0 0 3px rgba(231, 198, 124, 0.16);
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.status-active {
  background: rgba(105, 199, 168, 0.16);
  color: #9ae3c9;
  border: 1px solid rgba(105, 199, 168, 0.48);
}
.status-completed {
  background: rgba(231, 198, 124, 0.16);
  color: #f3dca0;
  border: 1px solid rgba(231, 198, 124, 0.5);
}
.status-disabled {
  background: rgba(226, 109, 98, 0.16);
  color: #f4b2aa;
  border: 1px solid rgba(226, 109, 98, 0.45);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 74px;
  right: 22px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 370px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(9, 26, 32, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(231, 198, 124, 0.55);
  color: #f8f2e4;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.52);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast.error {
  border-color: var(--danger);
}
.toast.success {
  border-color: var(--green);
}
.toast.gold {
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 22px rgba(231, 198, 124, 0.28);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 13, 16, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  animation: popIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Animations */
@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes reverseSpin {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}
@keyframes beacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.93) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes floatPulse {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

@media (max-width: 900px) {
  .ticker-wrap {
    display: none;
  }
  .hud-header {
    padding: 10px 14px;
  }
}
