/* codnot-theme.css */
:root {
  color-scheme: dark;
  --bg-0: #12141d;
  --bg-1: #1a1f2c;
  --panel: rgba(25, 30, 43, 0.86);
  --surface: rgba(32, 38, 56, 0.95);
  --border: rgba(147, 161, 190, 0.22);
  --text: #e9eefb;
  --muted: #9aa6c1;
  --pink: #ff7ab8;
  --purple: #8d95ff;
  --green: #44d493;
  --red: #ff6f7f;
  --shadow: 0 12px 34px rgba(6, 9, 16, 0.35);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f4f7ff;
  --bg-1: #e8eefb;
  --panel: rgba(255, 255, 255, 0.88);
  --surface: #ffffff;
  --border: rgba(77, 90, 127, 0.2);
  --text: #171d2e;
  --muted: #59627a;
  --pink: #d23f83;
  --purple: #4b58d4;
  --green: #1a9f67;
  --red: #cb3f56;
  --shadow: 0 10px 26px rgba(25, 35, 58, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Fira Code", "Segoe UI", "Roboto", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, rgba(141, 149, 255, 0.18), transparent 35%),
              radial-gradient(circle at 82% 4%, rgba(255, 122, 184, 0.15), transparent 33%),
              linear-gradient(145deg, var(--bg-0), var(--bg-1));
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.cn-has-header {
  padding-top: 86px;
}

a {
  color: inherit;
}

.cn-container {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px;
  padding-top: 24px;
  animation: cnFadeIn 0.42s ease-out;
}

@keyframes cnFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cn-header {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 999;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 9px 12px;
}

.cn-header.cn-header-static {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  margin: 14px;
}

.cn-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.cn-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 0 12px rgba(141, 149, 255, 0.5);
}

.cn-brand-name {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.cn-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  gap: 8px;
}

.cn-nav-link {
  text-decoration: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.72rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.cn-nav-link:hover {
  color: var(--text);
  background: rgba(141, 149, 255, 0.11);
  border-color: var(--border);
}

.cn-nav-accent {
  color: var(--pink);
  border-color: rgba(255, 122, 184, 0.28);
  background: rgba(255, 122, 184, 0.08);
}

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

.cn-user-info {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cn-theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.cn-theme-toggle:hover {
  border-color: rgba(141, 149, 255, 0.5);
  transform: translateY(-1px);
}

.cn-glass,
.cn-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.cn-glass {
  padding: 1.2rem;
}

.cn-card {
  background: var(--surface);
}

.cn-title {
  margin: 0;
  font-size: clamp(1.22rem, 1.7vw, 1.7rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cn-subtitle {
  margin-top: 0.34rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.cn-btn,
.cn-btn-outline {
  border-radius: 10px;
  padding: 0.68rem 1rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.cn-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 10px 20px rgba(141, 149, 255, 0.25);
}

.cn-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.cn-btn-outline {
  color: var(--text);
  border-color: var(--border);
  background: transparent;
}

.cn-btn-outline:hover {
  border-color: rgba(141, 149, 255, 0.5);
  background: rgba(141, 149, 255, 0.1);
}

.cn-alert {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.9rem 1rem;
}

.cn-alert-success {
  border-color: rgba(68, 212, 147, 0.45);
}

.cn-alert-danger {
  border-color: rgba(255, 111, 127, 0.45);
}

input,
textarea,
select {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 85%, transparent);
}

@media (max-width: 980px) {
  .cn-header {
    grid-template-columns: 1fr auto;
    row-gap: 8px;
  }

  .cn-brand {
    min-width: 0;
  }

  .cn-nav {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
  }

  .cn-user-info {
    display: none;
  }
}

@media (max-width: 640px) {
  body.cn-has-header {
    padding-top: 112px;
  }

  .cn-container {
    padding: 16px;
    padding-top: 16px;
  }

  .cn-nav {
    gap: 6px;
  }

  .cn-nav-link {
    padding: 0.44rem 0.6rem;
    font-size: 0.8rem;
  }

  .cn-header.cn-header-static {
    margin: 10px;
  }
}
