@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --sg-bg: #f2f0eb;
  --sg-surface: #ffffff;
  --sg-ink: #1e2a22;
  --sg-muted: #7a817a;
  --sg-accent: #1f5c3a;
  --sg-accent-soft: #e6f2ea;
  --sg-accent-deep: #174a2e;
  --sg-border: #e0ddd5;
  --sg-line: #d4d0c6;
  --sg-shadow: 0 4px 18px rgba(30, 42, 34, 0.06);
  --el-color-primary: #1f5c3a;
  --el-color-primary-light-3: #45825f;
  --el-color-primary-light-5: #74a88a;
  --el-color-primary-light-7: #a7cbb8;
  --el-color-primary-light-8: #c8dfd2;
  --el-color-primary-light-9: #e8f3ec;
  --el-color-primary-dark-2: #174a2e;
  --el-color-success: #1f5c3a;
  font-family: "DM Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--sg-ink);
  background: var(--sg-bg);
}

* { box-sizing: border-box; }
html, body, #app { margin: 0; min-height: 100%; }
body {
  background-color: var(--sg-bg);
  background-image:
    radial-gradient(rgba(30, 42, 34, 0.03) 0.7px, transparent 0.7px);
  background-size: 14px 14px;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--sg-muted); }

/* ===== Top bar — mockup exact ===== */
.studio-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.studio-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sg-border);
}
.studio-top-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.studio-menu-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--sg-ink);
  padding: 0;
}
.studio-menu-btn:hover { background: var(--sg-accent-soft); }
.studio-menu-btn svg { width: 20px; height: 20px; }
.studio-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--sg-muted);
  white-space: nowrap;
}
.studio-crumb .dim { color: var(--sg-muted); }
.studio-crumb .sep { opacity: 0.5; }
.studio-crumb .now {
  color: var(--sg-accent-deep);
  font-weight: 600;
}
.studio-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.studio-top-search {
  width: min(280px, 32vw);
}
.studio-top-search .el-input__wrapper {
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: 0 0 0 1px var(--sg-border) inset !important;
  padding-left: 14px !important;
}
.studio-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--sg-border);
  background: #fff;
  color: var(--sg-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.studio-icon-btn:hover {
  color: var(--sg-accent-deep);
  border-color: #b7d0c1;
  background: var(--sg-accent-soft);
}
.studio-icon-btn svg { width: 16px; height: 16px; }
.studio-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
}
.studio-user:hover { background: rgba(31, 92, 58, 0.06); }
.studio-user .el-avatar {
  background: var(--sg-accent) !important;
  color: #fff !important;
  font-weight: 700;
}
.studio-user .uname {
  font-size: 14px;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-user .chev { color: var(--sg-muted); font-size: 12px; }

.studio-main {
  width: min(1080px, calc(100% - 56px));
  margin: 0 auto;
  padding: 40px 0 28px;
  flex: 1;
}
.studio-main.wide {
  width: min(1360px, calc(100% - 32px));
  padding-top: 24px;
}

.studio-footer {
  width: min(1080px, calc(100% - 56px));
  margin: 8px auto 28px;
  padding-top: 16px;
  border-top: 1px solid var(--sg-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--sg-muted);
}
.studio-footer .pipe {
  margin: 0 8px;
  opacity: 0.55;
}

/* ===== Hero — potato + cucumber ===== */
.gallery-hero {
  text-align: center;
  margin: 4px 0 34px;
}
.gallery-veggies {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  height: 78px;
}
.gallery-veggies svg {
  width: 70px;
  height: 70px;
  filter: drop-shadow(0 6px 10px rgba(30, 42, 34, 0.08));
}
.gallery-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: #1a3d2a;
  letter-spacing: 0.04em;
}
.gallery-kicker {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  color: #8a918a;
  font-weight: 500;
}
.gallery-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 12px;
  max-width: 360px;
}
.gallery-rule::before,
.gallery-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #cfcabe;
}
.gallery-rule .diamond {
  width: 7px;
  height: 7px;
  background: var(--sg-accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.gallery-slogan {
  margin: 0;
  font-size: 14px;
  color: #7d857d;
  letter-spacing: 0.12em;
}

/* ===== Cards ===== */
.conn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.conn-tile {
  position: relative;
  background: var(--sg-surface);
  border: 1px solid #ebe7df;
  border-radius: 18px;
  padding: 20px 18px 16px;
  min-height: 216px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sg-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.conn-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(30, 42, 34, 0.1);
  border-color: #c9d9cf;
}
.conn-tile .tile-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.conn-tile .tile-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #f4f7f4;
  color: var(--sg-accent-deep);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.conn-tile .tile-icon svg { width: 30px; height: 30px; }
.conn-tile .tile-titles { min-width: 0; flex: 1; padding-top: 2px; }
.conn-tile .tile-name {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--sg-ink);
  line-height: 1.35;
}
.conn-tile .tile-sub {
  margin: 0;
  font-size: 12px;
  color: var(--sg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conn-tile .tile-more {
  position: absolute;
  top: 12px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}
.conn-tile:hover .tile-more { opacity: 1; }
.conn-tile .tile-stats {
  display: grid;
  grid-template-columns: 1.35fr 0.7fr 0.95fr;
  gap: 8px;
  padding: 12px 0 14px;
  border-top: 1px solid #efece5;
  margin-bottom: 4px;
}
.conn-tile .stat-label {
  display: block;
  font-size: 11px;
  color: #939a93;
  margin-bottom: 5px;
}
.conn-tile .stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--sg-ink);
  word-break: break-all;
  line-height: 1.35;
}
.conn-tile .stat-value.host {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  font-weight: 500;
}
.conn-tile .tile-foot {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}
.enter-btn.el-button {
  border-radius: 10px !important;
  font-weight: 600 !important;
  padding: 8px 16px !important;
  background: var(--sg-accent) !important;
  border-color: var(--sg-accent) !important;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.status-pill.on {
  background: var(--sg-accent-soft);
  color: var(--sg-accent-deep);
}
.status-pill.off {
  background: #efeee9;
  color: #7a7468;
}
.status-pill .check {
  font-size: 11px;
  line-height: 1;
}

.gallery-pager {
  margin-top: 22px;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Workspace keep usable */
.page-card {
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  border-radius: 16px;
  box-shadow: var(--sg-shadow);
  padding: 20px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }
.workspace-split {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  min-height: 640px;
}
.db-list {
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  padding: 12px;
  max-height: 720px;
  overflow: auto;
  background: #f7f5f0;
}
.db-item {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
}
.db-item:hover { background: var(--sg-accent-soft); }
.db-item.active {
  background: var(--sg-accent-soft);
  color: var(--sg-accent-deep);
  font-weight: 600;
}
.sql-box textarea {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}
.result-wrap { overflow: auto; max-height: 520px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }

/* Login (keep previous dynamic left) */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
  background: var(--sg-bg);
}
.login-hero {
  position: relative;
  overflow: hidden;
  color: #ecfdf5;
  background: linear-gradient(155deg, #0d2818 0%, #14532d 38%, #1b5e3b 68%, #0f2f1f 100%);
  padding: 56px 48px;
  display: flex;
  align-items: center;
}
.login-hero-aurora {
  position: absolute;
  inset: -20%;
  background: conic-gradient(from 120deg at 40% 40%, rgba(52, 211, 153, 0.18), transparent 35%, rgba(74, 222, 128, 0.12), transparent 70%, rgba(16, 185, 129, 0.16));
  filter: blur(40px);
  animation: login-aurora 14s linear infinite;
  pointer-events: none;
}
.login-hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}
.login-hero-glow.g1 {
  width: 420px; height: 420px; right: -100px; top: -90px;
  background: radial-gradient(circle, rgba(110, 231, 183, 0.35), transparent 68%);
  animation: login-float 9s ease-in-out infinite;
}
.login-hero-glow.g2 {
  width: 280px; height: 280px; left: -80px; bottom: 8%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.22), transparent 70%);
  animation: login-float 11s ease-in-out infinite reverse;
}
.login-hero-glow.g3 {
  width: 180px; height: 180px; right: 18%; bottom: 18%;
  background: radial-gradient(circle, rgba(187, 247, 208, 0.2), transparent 70%);
  animation: login-pulse 5.5s ease-in-out infinite;
}
.login-hero-beam {
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(105deg, transparent 36%, rgba(255,255,255,0.08) 48%, rgba(167,243,208,0.16) 50%, rgba(255,255,255,0.06) 52%, transparent 64%);
  animation: login-beam 7.5s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}
.login-hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 35% 40%, #000 15%, transparent 72%);
  animation: login-grid 18s linear infinite;
  pointer-events: none;
}
.login-hero-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.login-hero-particles span {
  position: absolute; bottom: -12px; border-radius: 50%;
  background: rgba(236, 253, 245, 0.75);
  box-shadow: 0 0 10px rgba(167, 243, 208, 0.55);
  animation-name: login-particle;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  opacity: 0;
}
.login-hero-rings {
  position: absolute; right: -40px; top: 50%; width: 340px; height: 340px;
  transform: translateY(-50%); pointer-events: none;
}
.login-hero-rings i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(167, 243, 208, 0.22);
  animation: login-ring 8s ease-out infinite;
}
.login-hero-rings i:nth-child(2) { inset: 28px; animation-delay: 1.2s; border-color: rgba(167, 243, 208, 0.16); }
.login-hero-rings i:nth-child(3) { inset: 56px; animation-delay: 2.4s; border-color: rgba(167, 243, 208, 0.12); }
.login-hero-inner {
  position: relative; z-index: 1; max-width: 460px;
  padding: 28px 26px; border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  border: 1px solid rgba(236, 253, 245, 0.16);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
  animation: login-rise 0.7s ease-out both;
}
.login-hero-logo {
  width: 64px; height: 64px; border-radius: 18px; object-fit: cover;
  box-shadow: 0 12px 30px rgba(0,0,0,0.22); margin-bottom: 28px;
  animation: login-logo-bob 4.8s ease-in-out infinite;
}
.login-hero h1 {
  margin: 0 0 10px; font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 750; letter-spacing: 0.03em; line-height: 1.15;
}
.login-hero .login-kicker {
  margin: 0 0 18px; font-size: 12px; letter-spacing: 0.36em;
  color: rgba(236, 253, 245, 0.72);
}
.login-hero p {
  margin: 0 0 28px; font-size: 16px; line-height: 1.65;
  color: rgba(236, 253, 245, 0.86); max-width: 34em;
}
.login-hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.login-hero-points li {
  display: flex; align-items: center; gap: 10px; font-size: 14px;
  color: rgba(236, 253, 245, 0.92);
}
.login-hero-points li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #86efac; box-shadow: 0 0 0 4px rgba(134, 239, 172, 0.18); flex-shrink: 0;
}
.login-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px clamp(28px, 5vw, 72px); background: #fff;
  animation: login-rise 0.7s ease-out 0.08s both;
}
.login-panel-head h2 {
  margin: 0 0 8px; font-size: 28px; font-weight: 700; color: var(--sg-accent-deep);
}
.login-panel-head .desc { margin: 0 0 28px; color: var(--sg-muted); font-size: 15px; }
.login-tabs .el-tabs__header { margin-bottom: 22px; }
.login-tabs .el-tabs__item { font-size: 15px; padding: 0 18px; }
.login-form .el-form-item { margin-bottom: 18px; }
.login-form .el-input__wrapper {
  border-radius: 12px; box-shadow: 0 0 0 1px var(--sg-border) inset; padding: 4px 14px;
}
.login-submit {
  margin-top: 6px; height: 46px; border-radius: 12px; font-weight: 600; letter-spacing: 0.04em;
}
.login-wechat {
  text-align: center; padding: 28px 8px 12px; display: grid; gap: 14px; justify-items: center;
}
.login-link { color: var(--sg-accent); text-decoration: underline; text-underline-offset: 3px; }
.full { width: 100%; }
.row { display: flex; gap: 8px; width: 100%; }

@keyframes login-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-22px, 26px) scale(1.06); }
}
@keyframes login-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.18); }
}
@keyframes login-beam {
  0% { transform: translateX(-18%); opacity: 0.35; }
  50% { transform: translateX(10%); opacity: 0.85; }
  100% { transform: translateX(28%); opacity: 0.35; }
}
@keyframes login-aurora {
  from { transform: rotate(0deg) scale(1.05); }
  to { transform: rotate(360deg) scale(1.05); }
}
@keyframes login-grid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 44px, 44px 0; }
}
@keyframes login-particle {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  12% { opacity: 0.85; }
  100% { transform: translateY(-110vh) scale(1); opacity: 0; }
}
@keyframes login-ring {
  0% { transform: scale(0.86); opacity: 0; }
  25% { opacity: 0.55; }
  100% { transform: scale(1.18); opacity: 0; }
}
@keyframes login-logo-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-hero-aurora,
  .login-hero-glow,
  .login-hero-beam,
  .login-hero-grid,
  .login-hero-particles span,
  .login-hero-rings i,
  .login-hero-logo { animation: none !important; }
}

@media (max-width: 1100px) {
  .conn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { min-height: 280px; padding: 36px 28px 28px; }
  .login-hero h1 { font-size: 34px; }
  .login-panel { padding: 32px 24px 40px; }
  .studio-top { flex-wrap: wrap; }
  .studio-top-search { width: 100%; order: 3; }
}
@media (max-width: 720px) {
  .studio-main, .studio-footer { width: calc(100% - 28px); }
  .conn-grid { grid-template-columns: 1fr; }
  .gallery-hero h1 { font-size: 32px; }
  .workspace-split { grid-template-columns: 1fr; }
}
