/* ============================================================
   MusicBuddy —— 设计系统（深色）
   分层：1) 令牌  2) 基础  3) 布局  4) 组件  5) 工具类
   ============================================================ */

/* ---------- 1. 令牌 ---------- */
:root {
  --bg: #0b0f16;
  --bg-glow: radial-gradient(1100px 560px at 12% -12%, #17263c 0%, transparent 62%),
    radial-gradient(900px 480px at 100% 0%, #14202f 0%, transparent 55%);
  --surface: #121924;
  --surface-2: #18222f;
  --surface-3: #1f2b3b;
  --border: #263343;
  --border-strong: #35485f;

  --text: #e8eef6;
  --text-dim: #93a3b8;
  --text-mute: #6b7c92;

  --accent: #4f8cff;
  --accent-hover: #6c9dff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --success: #35d0a0;
  --success-soft: rgba(53, 208, 160, 0.14);
  --warn: #ffb454;
  --warn-soft: rgba(255, 180, 84, 0.14);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.14);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 2. 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-soft);
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ---------- 启动态 ---------- */
.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.boot__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text-dim);
}

.boot__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
  animation: pulse 1.4s ease-in-out infinite;
}

.boot__text {
  font-size: 13px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.82);
    opacity: 0.6;
  }
}

/* ---------- 3. 布局：应用外壳 ---------- */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 25, 36, 0.72);
  backdrop-filter: blur(8px);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #2f6be0);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex: none;
}

.brand__name {
  font-weight: 650;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 0 22px;
  min-height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 25, 36, 0.72);
  backdrop-filter: blur(8px);
}

.header__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header__title h1 {
  font-size: 15px;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 26px 48px;
  overflow-x: hidden;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1080px;
}

/* ---------- 首页（建设中） ---------- */
.home {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px 20px;
}

.home__panel {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 42px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.home__mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(140deg, var(--accent), #2f6be0);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}

.home__title {
  font-size: 20px;
  font-weight: 680;
  letter-spacing: 0.2px;
}

.home__text {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-dim);
  word-break: break-word;
}

.home__mail {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home__mail:hover {
  color: var(--accent-hover);
}

/* ---------- 4. 组件 ---------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex: none;
}

.card__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 620;
}

.card__desc {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-mute);
}

.card__body {
  padding: 18px;
}

.stat {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.stat__label {
  font-size: 12.5px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 7px;
}

.stat__value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat__hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: transparent;
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-dim);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn--danger {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.btn--danger:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.22);
  border-color: transparent;
}

.btn--sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

.btn--block {
  width: 100%;
}

/* 表单 */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12.5px;
  color: var(--text-dim);
}

.field__hint {
  font-size: 12px;
  color: var(--text-mute);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.inline-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-field .input {
  flex: 1;
}

/* 分段控件 */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.segmented__item {
  flex: 1;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.segmented__item:hover {
  color: var(--text);
}

.segmented__item.is-active {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--live {
  background: var(--success-soft);
  color: var(--success);
}

.badge--planned {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge--neutral {
  background: var(--surface-3);
  color: var(--text-dim);
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* 提示条 */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}

.notice--error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: #ffd9d9;
}

.notice--success {
  border-left-color: var(--success);
  background: var(--success-soft);
  color: #d6fbee;
}

.notice--info {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: #dce9ff;
}

.notice--warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
  color: #ffe9cc;
}

.empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-mute);
}

/* 定义列表（键值展示） */
.kv {
  display: grid;
  gap: 12px 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kv__item {
  min-width: 0;
}

.kv__key {
  font-size: 12px;
  color: var(--text-mute);
}

.kv__val {
  margin-top: 2px;
  font-size: 13.5px;
  word-break: break-word;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

/* 内联图标（icons.js 的默认类） */
.icon {
  flex: none;
  opacity: 0.9;
}

/* ---------- 认证页 ---------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  min-height: 100vh;
}

.auth__aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 44px 48px;
  border-right: 1px solid var(--border);
  background: linear-gradient(160deg, #101926 0%, #0b0f16 70%);
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth__brand .brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 17px;
}

.auth__brandname {
  font-size: 17px;
  font-weight: 680;
}

.auth__pitch h2 {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.auth__pitch p {
  margin-top: 12px;
  max-width: 44ch;
  color: var(--text-dim);
}

.auth__feats {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.auth__feat {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-dim);
}

.auth__feat strong {
  display: block;
  color: var(--text);
  font-weight: 620;
}

.auth__foot {
  font-size: 12.5px;
  color: var(--text-mute);
}

.auth__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 40px 44px;
  background: rgba(18, 25, 36, 0.6);
}

.auth__panel h3 {
  font-size: 19px;
  font-weight: 660;
}

.auth__sub {
  font-size: 13px;
  color: var(--text-mute);
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth__switch {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-mute);
}

.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
}

.linkbtn:hover {
  text-decoration: underline;
}

/* ---------- 5. 工具类 ---------- */
.row-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.text-dim {
  color: var(--text-dim);
}
.text-mute {
  color: var(--text-mute);
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.nowrap {
  white-space: nowrap;
}
.grow {
  flex: 1;
  min-width: 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth__aside {
    display: none;
  }
  .auth__panel {
    min-height: 100vh;
  }
}

@media (max-width: 820px) {
  .main {
    padding: 18px 14px 40px;
  }
  .brand,
  .header {
    padding-inline: 14px;
  }
}
