/* SkyTree Theme - 天空树科技有限公司
   统一色彩、字体、间距、层级、交互反馈与响应式优化 */
:root{
  /* Brand palette */
  --brand-50:#e7f1ff;
  --brand-100:#d0e3ff;
  --brand-200:#a8ceff;
  --brand-300:#7db8ff;
  --brand-400:#52a2ff;
  --brand-500:#0d6efd;  /* Primary */
  --brand-600:#0a5cd1;
  --brand-700:#084aa6;
  --brand-800:#063a80;
  --brand-900:#042a59;

  --accent:#0aa2ff;
  --success:#22c55e;
  --warning:#f59e0b;
  --danger:#ef4444;

  /* Grays tuned for UI */
  --text-strong:#111827;
  --text:#374151;
  --text-muted:#6b7280;
  --border:#e5e7eb;
  --bg:#ffffff;
  --bg-muted:#f8fafc;

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;

  /* Layout scales */
  --radius-sm:6px;
  --radius:10px;
  --radius-lg:14px;
  --shadow-sm:0 1px 3px rgba(0,0,0,.08);
  --shadow:0 6px 18px rgba(0,0,0,.08);
  --shadow-lg:0 12px 28px rgba(0,0,0,.12);
  --space-1:.25rem; /*4*/
  --space-2:.5rem;  /*8*/
  --space-3:.75rem; /*12*/
  --space-4:1rem;   /*16*/
  --space-5:1.25rem;/*20*/
  --space-6:1.5rem; /*24*/
  --space-8:2rem;   /*32*/
  --space-10:2.5rem;/*40*/
  --space-12:3rem;  /*48*/
}

body.brand-skt{
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-muted);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container max-widths refinement */
@media (min-width: 1400px){
  .container, .container-lg, .container-xl, .container-xxl{ max-width: 1180px; }
}

/* Navbar */
.navbar.brand-nav{
  background: linear-gradient(90deg, var(--brand-500), var(--accent)) !important;
  box-shadow: var(--shadow);
}
.navbar.brand-nav .navbar-brand{
  color:#fff !important;
  letter-spacing:.3px;
}
.navbar.brand-nav .nav-link{
  color:#eaf3ff !important;
  margin: 0 var(--space-2);
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  transition: background .2s, color .2s, transform .12s ease-out;
}
.navbar.brand-nav .nav-link:hover{
  background: rgba(255,255,255,.12);
  color:#fff !important;
}
.navbar.brand-nav .nav-link.active{
  background: rgba(0,0,0,.15);
  color:#fff !important;
}

/* Cards & panels */
.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card .card-title{ color: var(--brand-600); }

/* Buttons */
.btn-primary{
  background: var(--brand-500);
  border-color: var(--brand-500);
  box-shadow: 0 2px 0 rgba(0,0,0,.04);
}
.btn-primary:hover{
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.btn-outline-primary{
  color: var(--brand-600);
  border-color: var(--brand-300);
  background: #fff;
}
.btn-outline-primary:hover{
  color:#fff;
  background: var(--brand-500);
  border-color: var(--brand-500);
}
/* Button states */
.btn .spinner-border{
  width:1rem;height:1rem;border-width:.15em;
}
.btn-loading{
  position: relative;
  pointer-events: none;
  opacity: .85;
}
.btn-loading .btn-label{
  visibility: hidden;
}
.btn-loading .btn-spinner{
  position: absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
}

/* Links */
a.link-primary, a, .stretched-link{
  color: var(--brand-600);
  text-decoration: none;
}
a:hover{
  color: var(--brand-700);
  text-decoration: underline;
}

/* Lists & list-group */
.list-group-item{
  border-color: var(--border);
}
.list-group-item:hover{
  background: #fcfdff;
}

/* Forms */
.form-control, .form-select{
  border-radius: var(--radius-sm);
  border-color: #dbe2ea;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus{
  border-color: var(--brand-400);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}
.form-check-input:checked{
  background-color: var(--brand-500);
  border-color: var(--brand-500);
}

/* Sections spacing */
section{ padding-top: var(--space-8); padding-bottom: var(--space-8); }
section .container > h2{ letter-spacing:.2px; }

/* Utilities */
.text-primary{ color: var(--brand-600) !important; }
.bg-brand-50{ background: var(--brand-50); }
.rounded{ border-radius: var(--radius) !important; }

/* Footer */
footer.footer{
  background:#fff;
}
footer.footer .container{
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  color: var(--text-muted);
}

/* Empty states */
.empty-state{
  border:1px dashed var(--brand-200);
  background: linear-gradient(180deg, #fafcff, #fff);
  border-radius: var(--radius);
  padding: var(--space-6);
  text-align:center;
  color: var(--text-muted);
}
.empty-state .icon{
  width:56px;height:56px;margin:0 auto var(--space-3);
  border-radius: 50%;
  background: var(--brand-50);
  display:flex;align-items:center;justify-content:center;
  border:1px solid var(--brand-100);
  color: var(--brand-600);
}

/* Toasts */
.toast-container{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1080;
}
.toast{
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border-color: var(--border);
}

/* Focus visibility (a11y) */
:focus-visible{
  outline: 3px solid rgba(13,110,253,.35);
  outline-offset: 2px;
  transition: outline .05s ease-in;
}

/* Hero refinement for home */
.display-5.fw-bold{ letter-spacing:.2px; }
.lead{ color: var(--text); }

/* Responsive tweaks */
@media (max-width: 991.98px){
  .navbar.brand-nav .nav-link{ margin: var(--space-1) 0; }
  .card{ border-radius: var(--radius-sm); }
  section{ padding-top: var(--space-6); padding-bottom: var(--space-6); }
}

/* Dark theme */
body[data-theme="dark"]{
  --bg:#0b1220;
  --bg-muted:#0f172a;
  --text-strong:#e5e7eb;
  --text:#cfd6e4;
  --text-muted:#94a3b8;
  --surface:#0f172a;
  --surface-2:#111827;
  --border:#1f2937;
}
body[data-theme="dark"] .brand-skt{
  background: var(--bg-muted);
  color: var(--text);
}
body[data-theme="dark"] .navbar.brand-nav{
  background: linear-gradient(90deg, #0b5ed7, #0a8ad1) !important;
}
body[data-theme="dark"] .navbar.brand-nav .nav-link{ color:#dbe7ff !important; }
body[data-theme="dark"] .navbar.brand-nav .nav-link.active{ background: rgba(255,255,255,.08); color:#fff !important; }
body[data-theme="dark"] .card{ background: var(--surface); border-color: var(--border); }
body[data-theme="dark"] .list-group-item{ background: var(--surface); border-color: var(--border); }
body[data-theme="dark"] .list-group-item:hover{ background:#0b1220; }
body[data-theme="dark"] .form-control, 
body[data-theme="dark"] .form-select{
  background: var(--surface);
  color: var(--text);
  border-color:#23324a;
}
body[data-theme="dark"] a{ color:#8ab6ff; }
body[data-theme="dark"] a:hover{ color:#b9d0ff; }
body[data-theme="dark"] footer.footer{ background: var(--surface); }
body[data-theme="dark"] .empty-state{
  border-color:#23324a;
  background: linear-gradient(180deg, #0f172a, #0b1220);
}