:root {
  --bg: #0c0f14;
  --bg-soft: #121720;
  --panel: #161c26;
  --panel-2: #1c2431;
  --line: #26303f;
  --text: #e6edf5;
  --muted: #8fa0b5;
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #16324a 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 0%, #241f4d 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------------------------------------------------------------- 登录 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 360px;
  background: linear-gradient(180deg, rgba(28, 36, 49, .96), rgba(18, 23, 32, .96));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #06121c;
}
.brand h1 { font-size: 18px; margin: 0; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login-tip { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }

/* ------------------------------------------------------------- 应用框架 */
.app { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 20px 16px;
  background: rgba(12, 16, 22, .78);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column; gap: 18px;
}
.sidebar .brand { padding: 0 6px; }
.sidebar .brand-mark { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
.sidebar .brand h1 { font-size: 15px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 14px;
  border: 1px solid transparent;
}
.sidebar nav a:hover { background: var(--panel); color: var(--text); }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, .16), rgba(99, 102, 241, .07));
  border-color: rgba(56, 189, 248, .35);
  color: #fff;
}
.nav-badge { font-size: 11px; color: var(--accent); }
.sidebar-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 8px;
  font-size: 12px; color: var(--muted); padding: 0 6px;
}
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; text-align: left; }
.link:hover { color: var(--accent); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 22px 26px 14px;
}
.topbar h2 { margin: 0; font-size: 22px; letter-spacing: .3px; }
.topbar p { margin: 4px 0 0; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 999px; background: var(--panel);
}
.view { padding: 8px 26px 40px; display: grid; gap: 18px; min-width: 0; }
.view > * { min-width: 0; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: linear-gradient(180deg, rgba(28, 36, 49, .9), rgba(18, 23, 32, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat {
  background: linear-gradient(180deg, rgba(28, 36, 49, .9), rgba(18, 23, 32, .9));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
  background: radial-gradient(circle, rgba(56, 189, 248, .18), transparent 70%);
}
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: .5px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn.primary {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border-color: transparent; color: #06121c; font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(248, 113, 113, .45); color: var(--bad); }
.btn.danger:hover { background: rgba(248, 113, 113, .12); border-color: var(--bad); }
.btn.tiny { padding: 4px 8px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1;
}
.icon-btn:hover { color: var(--text); }

/* ---------------------------------------------------------------- 表单 */
input, select, textarea {
  background: #0f141c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid { display: grid; gap: 14px; }
.checkbox-line { display: flex; gap: 14px; flex-wrap: wrap; }
.checkbox-line label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.checkbox-line input { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- 表格 */
.table-wrap { overflow: auto; max-width: 100%; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid rgba(38, 48, 63, .7); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tbody tr:hover { background: rgba(56, 189, 248, .05); }
td .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, .8); }
.dot.off { background: #475569; }
.dot.pending { background: var(--warn); }

.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, .03);
}
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, .35); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .35); }
.badge.bad { color: var(--bad); border-color: rgba(248, 113, 113, .35); }
.badge.type { color: var(--accent); border-color: rgba(56, 189, 248, .35); }

.empty {
  padding: 34px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 12px;
}

/* ------------------------------------------------------------- 终端卡片 */
.pending-bar {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.pending-item {
  display: flex; align-items: center; gap: 14px;
  border: 1px dashed rgba(251, 191, 36, .4);
  background: rgba(251, 191, 36, .06);
  padding: 12px 16px; border-radius: 12px;
}
.pending-item .code { font-size: 20px; font-weight: 700; letter-spacing: 3px; color: var(--warn); }

/* ---------------------------------------------------------------- 媒体库 */
.upload-zone {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
  background: rgba(56, 189, 248, .03);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); color: var(--text); background: rgba(56, 189, 248, .08); }
.upload-zone strong { color: var(--text); }
.upload-progress { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; margin-top: 10px; }
.upload-progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.media-thumb {
  height: 120px; background: #0b1017 center/cover no-repeat;
  display: grid; place-items: center; color: var(--muted); font-size: 26px;
  position: relative;
}
.media-thumb .type-tag { position: absolute; left: 8px; top: 8px; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-body { padding: 10px 12px; display: grid; gap: 6px; }
.media-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.media-actions { display: flex; gap: 6px; }

/* ------------------------------------------------------------ 播放列表 */
.playlist-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.pl-list { display: grid; gap: 8px; }
.pl-item {
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: var(--panel); display: grid; gap: 4px;
}
.pl-item:hover { border-color: rgba(56, 189, 248, .5); }
.pl-item.active { border-color: var(--accent); background: rgba(56, 189, 248, .08); }
.pl-item .name { font-weight: 600; font-size: 13px; }
.pl-item .meta { font-size: 11px; color: var(--muted); }
.play-items { display: grid; gap: 8px; }
.play-row {
  display: grid; grid-template-columns: 34px 58px 1fr auto auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel);
}
.play-row .idx { color: var(--muted); font-size: 12px; text-align: center; }
.play-row .thumb { width: 58px; height: 40px; border-radius: 8px; background: #0b1017 center/cover no-repeat; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.play-row .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.play-row .title { font-size: 13px; font-weight: 600; }
.play-row .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.play-row .dur { width: 74px; }
.time-total { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------- 计划任务 */
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label {
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12px;
  cursor: pointer; color: var(--muted); display: flex; gap: 4px; align-items: center;
}
.days label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: rgba(56, 189, 248, .08); }

/* ------------------------------------------------------------------ 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(4, 7, 11, .68);
  display: grid; place-items: center; padding: 20px; z-index: 50; backdrop-filter: blur(4px);
}
.modal-box {
  width: min(560px, 96vw); max-height: 90vh; display: flex; flex-direction: column;
  background: #121826; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-box header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.modal-box header h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px; overflow: auto; display: grid; gap: 14px; }
.modal-box.wide { width: min(1040px, 96vw); }
.modal-body.wide { width: min(760px, 96vw); }
#modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}
#modal-foot:empty { display: none; }

/* ------------------------------------------------------------------ 提示 */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 80; }
.toast {
  padding: 11px 16px; border-radius: 10px; background: #1b2432; border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 13px; max-width: 380px;
  animation: slideIn .2s ease;
}
.toast.ok { border-color: rgba(52, 211, 153, .5); color: #b9f6dc; }
.toast.bad { border-color: rgba(248, 113, 113, .5); color: #ffd3d3; }
@keyframes slideIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ 日志 */
.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.log-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.log-field input { padding: 8px 10px; }
.log-keyword { flex: 1 1 220px; min-width: 180px; padding: 8px 12px; }
.log-list { display: grid; gap: 6px; font-size: 12px; }
.log-row { display: grid; grid-template-columns: 150px 130px 70px 1fr; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .02); }
.log-row .time, .log-row .device { color: var(--muted); }
.log-row.level-error { border-left: 2px solid var(--bad); }
.log-row.level-warn { border-left: 2px solid var(--warn); }
.log-row.level-system { border-left: 2px solid var(--accent); }

/* -------------------------------------------------------------- 授权与套餐 */
.license-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 12px; white-space: nowrap;
}
.license-chip:hover { border-color: var(--accent); color: var(--text); }
.license-chip .license-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.license-chip.ok { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); color: #a7f3d0; }
.license-chip.ok .license-dot { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, .65); }
.license-chip.warn { border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .08); color: #fde68a; }
.license-chip.warn .license-dot { background: var(--warn); }
.license-chip.bad { border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .1); color: #fecaca; }
.license-chip.bad .license-dot { background: var(--bad); }

.license-banner {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px; align-items: center;
  padding: 20px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    radial-gradient(520px 180px at 0% 0%, rgba(56, 189, 248, .13), transparent 70%),
    linear-gradient(180deg, rgba(28, 36, 49, .95), rgba(18, 23, 32, .92));
}
.license-banner.ok { border-color: rgba(56, 189, 248, .28); }
.license-banner.warn { border-color: rgba(251, 191, 36, .38); }
.license-banner.bad { border-color: rgba(248, 113, 113, .42); background: radial-gradient(520px 180px at 0% 0%, rgba(248, 113, 113, .12), transparent 70%), linear-gradient(180deg, rgba(28, 36, 49, .95), rgba(18, 23, 32, .92)); }
.license-kicker { font-size: 10px; letter-spacing: 1.6px; color: var(--muted); font-weight: 600; }
.license-banner-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.license-banner-title h3 { margin: 0; font-size: 21px; }
.license-banner-main p { margin: 0; color: var(--muted); font-size: 12px; }
.license-banner-side { display: flex; align-items: center; gap: 22px; }
.license-mini { min-width: 108px; }
.license-mini > span { display: block; color: var(--muted); font-size: 11px; }
.license-mini b { display: block; font-size: 17px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.license-mini b em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 400; }
.license-mini small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.license-progress { height: 4px; border-radius: 99px; background: rgba(143, 160, 181, .2); margin-top: 8px; overflow: hidden; }
.license-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.license-progress.large { height: 6px; margin-top: 12px; }
.license-state {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 11px; font-weight: 600;
}
.license-state.ok { color: #a7f3d0; border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.license-state.warn { color: #fde68a; border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); }
.license-state.bad { color: #fecaca; border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .1); }

.license-hero {
  position: relative; overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    radial-gradient(700px 260px at 0% 0%, rgba(56, 189, 248, .14), transparent 70%),
    radial-gradient(500px 260px at 100% 100%, rgba(99, 102, 241, .12), transparent 70%),
    linear-gradient(180deg, rgba(28, 36, 49, .96), rgba(15, 20, 28, .94));
}
.license-hero.warn { border-color: rgba(251, 191, 36, .36); }
.license-hero.bad { border-color: rgba(248, 113, 113, .42); }
.license-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.license-hero-title { display: flex; align-items: center; gap: 12px; margin: 7px 0 6px; }
.license-hero-title h3 { margin: 0; font-size: 28px; letter-spacing: .5px; }
.license-hero-top p { margin: 0; color: var(--muted); font-size: 13px; }
.license-instance { text-align: right; min-width: 210px; }
.license-instance span { display: block; color: var(--muted); font-size: 10px; letter-spacing: 1.2px; }
.license-instance b { display: block; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: .5px; }
.license-instance small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.license-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.license-metrics > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9, 13, 19, .42); }
.license-metrics span { display: block; color: var(--muted); font-size: 11px; }
.license-metrics b { display: block; margin-top: 7px; font-size: 20px; font-variant-numeric: tabular-nums; }
.license-metrics b em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--muted); }
.license-metrics small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.license-metrics .license-state-value { font-size: 18px; }
.license-state-value.ok { color: #a7f3d0; }
.license-state-value.warn { color: #fde68a; }
.license-state-value.bad { color: #fecaca; }
.license-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.license-alert { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); font-size: 12px; }
.license-alert b { font-size: 13px; }
.license-alert span { color: var(--muted); }
.license-alert.warn { border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .07); }
.license-alert.warn b { color: #fde68a; }
.license-alert.bad { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .08); }
.license-alert.bad b { color: #fecaca; }
.license-inline-warn { margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .07); color: #fde68a; font-size: 12px; }
.btn.locked { border-style: dashed; border-color: rgba(251, 191, 36, .38); color: var(--warn); }

.license-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px; align-items: start; }
.entitlement-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.entitlement-chips span { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(56, 189, 248, .3); background: rgba(56, 189, 248, .08); color: #bae6fd; font-size: 11px; }
.license-note { margin-top: 16px; }
.license-note > span { display: block; color: var(--muted); font-size: 11px; }
.license-note p { margin: 5px 0 0; color: #cbd5e1; font-size: 12px; line-height: 1.7; }
.license-history { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.license-history .card-head { margin-bottom: 8px; }
.license-history-row { display: grid; grid-template-columns: 132px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(38, 48, 63, .55); font-size: 12px; }
.license-history-row:last-child { border-bottom: 0; }
.license-history-row span { color: var(--muted); font-variant-numeric: tabular-nums; }
.license-history-row p { margin: 0; color: #cbd5e1; }
.license-order-list { display: grid; gap: 10px; }
.license-order { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(9, 13, 19, .4); }
.license-order b { display: block; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.license-order span { display: block; margin-top: 3px; color: #cbd5e1; font-size: 12px; }
.license-order small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.plan-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.plan-card { position: relative; display: flex; flex-direction: column; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9, 13, 19, .4); }
.plan-card.current { border-color: rgba(56, 189, 248, .55); background: linear-gradient(180deg, rgba(56, 189, 248, .09), rgba(9, 13, 19, .4)); box-shadow: 0 0 0 1px rgba(56, 189, 248, .12) inset; }
.plan-card.featured { border-color: rgba(99, 102, 241, .42); }
.plan-card-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 22px; }
.plan-code { font-size: 9px; letter-spacing: 1.2px; color: var(--muted); }
.plan-card h4 { margin: 7px 0 3px; font-size: 17px; }
.plan-tagline { margin: 0; min-height: 32px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.plan-price { margin-top: 10px; font-size: 23px; font-weight: 700; color: #e0f2fe; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 11px; color: var(--muted); font-weight: 400; }
.plan-seats { margin-top: 6px; color: var(--muted); font-size: 11px; }
.plan-seats b { color: var(--text); font-size: 12px; }
.plan-features { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; gap: 5px; flex: 1; }
.plan-features li { position: relative; padding-left: 13px; color: #cbd5e1; font-size: 11px; line-height: 1.45; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-size: 10px; }
.plan-card-footer { margin-top: auto; }
.license-edit-intro p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.form-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }


.order-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.order-summary div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .02); }
.order-summary b { display: block; font-size: 22px; line-height: 1.2; }
.order-summary span { color: var(--muted); font-size: 12px; }
.order-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.order-toolbar select { width: 130px; }
.order-toolbar input { flex: 1 1 260px; min-width: 200px; }
.order-table { display: grid; gap: 4px; overflow-x: auto; }
.order-row { display: grid; grid-template-columns: 1.35fr 1.1fr .8fr .8fr 1fr .7fr 64px; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; background: rgba(255, 255, 255, .02); min-width: 820px; }
.order-row b { display: block; font-weight: 600; }
.order-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.order-head { color: var(--muted); font-size: 11px; background: transparent; padding-top: 2px; padding-bottom: 4px; }
.order-head span { font-weight: 600; }
.order-no b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.order-amount { font-variant-numeric: tabular-nums; }
.order-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .02); }
.order-detail span { display: block; color: var(--muted); font-size: 11px; }
.order-detail b { font-weight: 500; font-size: 13px; word-break: break-all; }

@media (max-width: 860px) {
  .order-table { overflow: visible; }
  .order-head { display: none; }
  .order-row {
    min-width: 0;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 6px;
  }
  .order-row > span:nth-child(1) { grid-column: 1 / -1; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .order-row > span:nth-child(5) { grid-column: 1 / -1; }
  .order-row > span:nth-child(7) { align-self: end; justify-self: end; }
  .order-toolbar select { width: 100%; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar-foot { margin: 0; flex-direction: row; }
  .playlist-layout { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr 1fr; }
  .order-summary { grid-template-columns: 1fr; }
  .order-detail { grid-template-columns: 1fr; }
  .license-columns { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .topbar-right { flex-wrap: wrap; }
  .license-banner { grid-template-columns: 1fr; }
  .license-banner-side { flex-wrap: wrap; gap: 14px 24px; }
  .license-hero-top { flex-direction: column; }
  .license-instance { text-align: left; min-width: 0; }
  .license-metrics { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-card:last-child { grid-column: 1 / -1; }
  .license-order { align-items: flex-start; flex-direction: column; }
  .license-history-row { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 520px) {
  .plan-grid { grid-template-columns: 1fr; }
  .license-chip { max-width: 100%; }
}

