:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-soft: #eef2ff;
  --accent: #f59e0b;
  --green: #059669;
  --red: #e11d48;
  --cyan: #0891b2;
  --radius: 20px;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Microsoft YaHei', -apple-system, 'PingFang SC', 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 480px at 92% -8%, rgba(79, 70, 229, 0.14), transparent 60%),
    radial-gradient(800px 420px at -8% 108%, rgba(8, 145, 178, 0.10), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }

.shell { max-width: 1280px; margin: 0 auto; padding: 18px 18px 46px; }

/* 顶部导航 */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; border-radius: 22px; padding: 15px 20px; margin-bottom: 22px;
  color: #fff; background: linear-gradient(115deg, #0f172a 0%, #312e81 55%, #4f46e5 130%);
  box-shadow: 0 20px 45px rgba(49, 46, 129, 0.22);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; }
.brand .logo {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); font-size: 22px;
}
.brand small { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,.72); }
.topbar nav { display: flex; gap: 7px; flex-wrap: wrap; }
.topbar nav a {
  color: #fff; font-size: 12px; font-weight: 700; padding: 8px 12px;
  border-radius: 999px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.18);
  transition: .2s;
}
.topbar nav a:hover { background: rgba(255,255,255,.24); transform: translateY(-1px); }
.topbar nav a.active { background: #fff; color: var(--primary-dark); }

/* 卡片与布局 */
.panel {
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(226, 232, 240, 0.8); margin-bottom: 18px;
}
.panel h2 {
  font-size: 16px; margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.panel h3 { font-size: 14px; margin: 16px 0 8px; color: #334155; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* 数据卡片 */
.stat {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%); border-radius: 16px;
  padding: 16px 18px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); min-height: 92px;
}
.stat .num { font-size: 27px; font-weight: 800; color: var(--primary-dark); letter-spacing: -.5px; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; }

/* 标签 */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-amber { background: #fef3c7; color: #b45309; }
.tag-gray { background: #f1f5f9; color: #475569; }

/* 按钮 */
.btn {
  display: inline-block; border: 0; border-radius: 12px; cursor: pointer;
  padding: 10px 16px; font-size: 13px; font-weight: 800; color: #fff; background: var(--primary);
  transition: transform .15s, box-shadow .2s, opacity .2s; box-shadow: 0 6px 14px rgba(79, 70, 229, 0.22);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(79, 70, 229, 0.28); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-green { background: var(--green); box-shadow: 0 6px 14px rgba(5, 150, 105, 0.20); }
.btn-red { background: var(--red); box-shadow: 0 6px 14px rgba(225, 29, 72, 0.20); }
.btn-amber { background: var(--accent); box-shadow: 0 6px 14px rgba(245, 158, 11, 0.20); }
.btn-gray { background: #64748b; box-shadow: 0 6px 14px rgba(100, 116, 139, 0.20); }
.btn-sm { padding: 6px 10px; font-size: 11px; border-radius: 9px; }

/* 表单 */
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 12px; font-weight: 800; color: #475569; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 13px; border: 1px solid #cbd5e1; border-radius: 12px;
  font-size: 14px; font-family: inherit; background: #fff; transition: .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #f8fafc; color: #475569; font-weight: 800; white-space: nowrap; }
.table tr:hover td { background: #f8fafc; }
.muted { color: var(--muted); font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* 消息 */
.flash { margin-bottom: 12px; }
.msg { padding: 12px 15px; border-radius: 12px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.msg-ok { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.msg-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* 时钟 */
.clock-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.clock-hero .time { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary-dark); }
.stage-badge { font-size: 13px; font-weight: 800; color: #fff; background: var(--primary); border-radius: 999px; padding: 5px 14px; }

/* 角色导航 */
.role-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.role-nav a {
  padding: 8px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--ink); font-size: 12px; font-weight: 800;
}
.role-nav a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 商品 */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 16px; }
.product-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); transition: .2s; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card img { width: 100%; height: 158px; object-fit: cover; background: #e2e8f0; }
.product-card .body { padding: 13px; }
.product-card .title { font-weight: 800; margin-bottom: 4px; }
.product-card .price { color: var(--red); font-weight: 800; font-size: 19px; }

/* 日志 */
.log-list { max-height: 430px; overflow: auto; }
.log-item { padding: 9px 5px; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.log-item time { color: var(--muted); margin-right: 6px; }

.cue-bar {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  padding: 12px 15px; border-radius: 13px; margin-bottom: 14px; font-size: 13px; font-weight: 600;
}

.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
@media (max-width: 850px) { .split { grid-template-columns: 1fr; } }

/* 店铺前台 */
.store-shell { max-width: 1020px; margin: 0 auto; padding: 20px; }
.store-hero {
  border-radius: 24px; padding: 30px; color: #fff; margin-bottom: 20px;
  background:
    radial-gradient(600px 220px at 90% 0%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(115deg, #0f172a, #312e81 65%, #4f46e5 140%);
  box-shadow: 0 22px 45px rgba(49, 46, 129, 0.22);
}
.store-hero h1 { font-size: 27px; }
.store-hero .live-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444; margin-right: 7px; animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,68,68,.35); } 50% { opacity: .45; box-shadow: 0 0 0 6px rgba(239,68,68,0); } }

/* 登录 */
.login-card {
  max-width: 420px; margin: 60px auto; text-align: center;
  background: var(--card); border-radius: 24px; padding: 30px; box-shadow: var(--shadow);
}
.login-card h2 { margin-bottom: 18px; }
.login-card .btn { width: 100%; }

/* 空状态与辅助 */
.empty { padding: 26px; text-align: center; color: var(--muted); background: #f8fafc; border-radius: 14px; }
.inline-form { display: inline; }
.mt-10 { margin-top: 10px; }

@media (max-width: 640px) {
  .shell { padding: 10px 10px 36px; }
  .topbar { border-radius: 16px; }
  .clock-hero .time { font-size: 30px; }
  .form-row { flex-direction: column; }
}

/* AI 素材 */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.media-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.media-card video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #0f172a; }
.media-card .muted { padding: 9px 11px; }
.table-wrap { overflow-x: auto; }
.table video { vertical-align: middle; }

/* AI 创作中心 */
.ai-tool-card {
  display: block;
  color: var(--ink);
  transition: transform .2s, box-shadow .2s;
}
.ai-tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.ai-tool-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 28px;
  border-radius: 17px;
  background: var(--primary-soft);
  margin-bottom: 14px;
}
.ai-tool-meta {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

/* 新布局：真实电商运营台 */
body {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(248,250,252,0.94)),
    url('../uploads/ai/app/app_bg.png?v=20261020c') center / cover fixed;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.86);
  border-right: 1px solid rgba(226,232,240,0.95);
  backdrop-filter: blur(18px);
  padding: 18px 14px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 23px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 12px 24px rgba(79,70,229,0.24);
}

.sidebar-brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: .2px;
}

.sidebar-brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-group {
  margin: 18px 10px 8px;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: .8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 13px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  transition: .18s ease;
}

.sidebar-nav a span {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-nav a:hover {
  background: #f1f5f9;
  transform: translateX(2px);
}

.sidebar-nav a.active {
  color: #4338ca;
  background: #eef2ff;
  box-shadow: inset 0 0 0 1px #e0e7ff;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 8px;
}

.user-card .avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.user-card strong {
  display: block;
  font-size: 13px;
}

.user-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.logout-link {
  display: block;
  margin: 8px 6px 0;
  padding: 8px 10px;
  border-radius: 11px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  background: #f8fafc;
}

.logout-link:hover {
  color: #b91c1c;
  background: #fee2e2;
}

.main-area {
  min-width: 0;
  padding: 22px 26px 40px;
}

.main-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.topbar-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  background: #fff;
  border: 1px solid var(--line);
}

.shop-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.shop-status.live i {
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239,68,68,.12);
  animation: pulse 1.2s infinite;
}

.shop-status.setup i {
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245,158,11,.12);
}

.shop-status.review i {
  background: #0891b2;
  box-shadow: 0 0 0 5px rgba(8,145,178,.12);
}

.btn-outline {
  color: #4f46e5;
  background: #fff;
  border: 1px solid #e0e7ff;
  box-shadow: none;
}

.btn-outline:hover {
  background: #eef2ff;
  box-shadow: none;
}

.page-content {
  animation: fade-in .22s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 登录页独立布局 */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.86) 0%, rgba(248,250,252,0.64) 46%, rgba(255,255,255,0.82) 100%),
    url('../uploads/ai/login/login_bg.png?v=20261020c') center / cover fixed;
}

.login-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(238,242,255,.82));
}

.page-hero-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.2px;
  margin-bottom: 4px;
}

.live-hero {
  border-color: #e0e7ff;
  background:
    radial-gradient(400px 160px at 90% 0%, rgba(239,68,68,.08), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,.97), rgba(238,242,255,.86));
}

.tag-purple {
  background: #ede9fe;
  color: #6d28d9;
}

.welcome-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background:
    radial-gradient(520px 200px at 90% 0%, rgba(79,70,229,.10), transparent 60%),
    linear-gradient(135deg, #ffffff, #f8fafc);
}

.welcome-panel h1 {
  margin: 4px 0 6px;
  font-size: 24px;
}

.role-chip {
  min-width: 130px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

.role-chip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.role-chip strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.quick-card {
  display: block;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}

.quick-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.quick-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 21px;
  margin-bottom: 12px;
}

.quick-icon.blue { background: #e0e7ff; }
.quick-icon.green { background: #d1fae5; }
.quick-icon.amber { background: #fef3c7; }
.quick-icon.purple { background: #ede9fe; }
.quick-icon.cyan { background: #cffafe; }

.quick-card h2 {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 6px;
}

.role-tip {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-list > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.timeline-list b {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #4f46e5;
  font-size: 12px;
}

.timeline-list strong {
  display: block;
  font-size: 13px;
}

.timeline-list span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    overflow: visible;
  }

  .nav-group {
    display: none;
  }

  .sidebar-nav a {
    margin: 0;
    padding: 8px 11px;
  }

  .sidebar-footer {
    display: none;
  }

  .main-area {
    padding: 18px 14px 34px;
  }
}
