:root {
  color-scheme: dark;
  --bg: #070914;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f7f8ff;
  --muted: rgba(247, 248, 255, 0.68);
  --faint: rgba(247, 248, 255, 0.45);
  --accent: #7c5cff;
  --accent-2: #20d6ff;
  --danger: #ff5c7a;
  --success: #54f0a8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(124, 92, 255, 0.32), transparent 34rem),
    radial-gradient(circle at 80% 0%, rgba(32, 214, 255, 0.22), transparent 30rem),
    linear-gradient(135deg, #070914 0%, #0d1022 50%, #090b15 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at top, black, transparent 75%);
  pointer-events: none;
}

.bg-orb {
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(54px);
  opacity: .42;
  pointer-events: none;
  animation: float 9s ease-in-out infinite alternate;
}
.orb-a { left: -8rem; top: 16rem; background: #7c5cff; }
.orb-b { right: -9rem; top: 8rem; background: #20d6ff; animation-delay: -2s; }
.orb-c { left: 40%; bottom: -12rem; background: #ff4ecd; animation-delay: -5s; }
@keyframes float { to { transform: translate3d(24px, -28px, 0) scale(1.08); } }

.shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.glass {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
}

.topbar, .toolbar { border-radius: 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 18px;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark, .app-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 32px rgba(124, 92, 255, .38);
}
.brand-title { font-size: 18px; font-weight: 800; }
.brand-subtitle { color: var(--faint); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

.hero-card {
  min-height: 330px;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: .16em;
}
h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 8vw, 84px);
  line-height: .98;
  letter-spacing: -0.07em;
}
.hero-desc {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

button, a { font: inherit; }
button { cursor: pointer; }
.primary-btn, .secondary-btn, .ghost-btn, .open-link, .danger-ghost, .icon-btn, .tab {
  border: 0;
  text-decoration: none;
  color: var(--text);
  transition: transform .2s ease, border-color .2s ease, background .2s ease, opacity .2s ease;
}
.primary-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 38px rgba(32, 214, 255, .22);
}
.secondary-btn, .ghost-btn, .danger-ghost, .tab, .icon-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .07);
}
.danger-ghost { color: #ff9caf; border-color: rgba(255, 92, 122, .35); }
.icon-btn { width: 42px; padding: 0; font-size: 24px; }
.full { width: 100%; }
button:hover, a:hover { transform: translateY(-2px); }

.toolbar {
  margin: 22px 0;
  padding: 14px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}
.search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.08);
}
.search-wrap input {
  width: 100%;
  height: 46px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab.active { background: rgba(124, 92, 255, .35); border-color: rgba(124, 92, 255, .7); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.project-card {
  position: relative;
  min-height: 270px;
  border-radius: 28px;
  padding: 24px;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: auto -30% -45% 15%;
  height: 160px;
  background: radial-gradient(circle, rgba(124,92,255,.26), transparent 68%);
}
.card-top, .list-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--success);
  background: rgba(84,240,168,.1);
  border: 1px solid rgba(84,240,168,.22);
}
.badge.cloud { color: #9fdcff; background: rgba(32,214,255,.1); border-color: rgba(32,214,255,.25); }
.badge.ddnsv6 { color: #ffc98f; background: rgba(255, 176, 86, .1); border-color: rgba(255, 176, 86, .25); }
.project-card h2 { margin: 24px 0 10px; font-size: 24px; letter-spacing: -0.03em; }
.project-card p { min-height: 54px; margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.url-line {
  margin: 0 0 20px;
  color: var(--faint);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.open-link {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 800;
}

.empty { text-align: center; border-radius: 28px; padding: 48px; }
.empty-icon { font-size: 48px; color: var(--faint); }
.hidden { display: none !important; }

.dialog {
  width: min(1040px, calc(100% - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}
.dialog::backdrop { background: rgba(2, 3, 10, .72); backdrop-filter: blur(10px); }
.dialog-card { border-radius: 30px; padding: clamp(20px, 4vw, 34px); }
.dialog h2, .dialog h3 { margin: 0; letter-spacing: -0.03em; }
.panel { margin-top: 24px; }
.field { display: grid; gap: 8px; margin-bottom: 14px; }
.field span { color: var(--muted); font-size: 14px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  outline: 0;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(0,0,0,.24);
}
textarea { resize: vertical; }
select option { background: #111526; }
.hint { color: var(--faint); font-size: 13px; line-height: 1.6; }
.error { color: var(--danger); font-weight: 800; }
.settings-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.form-card, .list-card, .security-card, .base-config-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  padding: 18px;
  background: rgba(0,0,0,.18);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-actions, .password-row { display: flex; gap: 10px; }
.settings-list { display: grid; gap: 10px; margin-top: 14px; max-height: 430px; overflow: auto; padding-right: 4px; }
.setting-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
}
.setting-item strong { display: block; margin-bottom: 4px; }
.setting-item small { display: block; color: var(--faint); word-break: break-all; }
.item-actions { display: flex; gap: 8px; align-items: center; }
.item-actions button { min-height: 34px; padding: 0 10px; }
.base-config-card { margin-bottom: 18px; }
.security-card { margin-top: 18px; }

@media (max-width: 900px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .projects-grid { grid-template-columns: 1fr; }
  .topbar { padding-bottom: 16px; }
  .brand-subtitle { display: none; }
  .tabs, .hero-actions, .form-actions, .password-row { flex-direction: column; }
  .tab, .secondary-btn, .primary-btn, .danger-ghost { width: 100%; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}
