/* HUWO.AI BOSS 平台样式（登录/控制台），依赖 styles 的变量 */
* { box-sizing: border-box; }
body.app-body { background: #f4f6f6; color: var(--text); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #17383f; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: tin .25s ease; max-width: 90vw; }
.toast.err { background: #a33a2f; } .toast.ok { background: #1d6b4f; }
.toast.hide { opacity: 0; transform: translateY(-8px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- 登录/注册 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 600px at 80% -10%, #12707f 0%, var(--ink) 45%, var(--ink2) 100%); }
.auth-card { width: 100%; max-width: 420px; background: var(--paper); border-radius: 18px; padding: 34px 32px; box-shadow: 0 30px 70px rgba(0,0,0,.3); }
.auth-brand { text-align: center; margin-bottom: 6px; }
.auth-brand .logo { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
.auth-brand .sub { font-size: 12.5px; color: #7a8585; margin-top: 4px; }
.auth-tabs { display: flex; margin: 22px 0 18px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.auth-tabs button { flex: 1; padding: 10px; border: 0; background: transparent; font-size: 14px; color: #77807f; cursor: pointer; }
.auth-tabs button.on { background: var(--ink); color: #fff; }
.auth-card .field { margin-bottom: 14px; }
.auth-card label { display: block; font-size: 13px; color: #55605f; margin-bottom: 6px; }
.auth-card input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; background: #fff; }
.auth-card input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,85,99,.12); }
.auth-btn { width: 100%; margin-top: 6px; padding: 12px; font-size: 15px; }
.auth-note { text-align: center; font-size: 12.5px; color: #8a9291; margin-top: 16px; }
.auth-note a { color: var(--ink); font-weight: 600; text-decoration: none; }

/* ---------- 控制台布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 232px; background: linear-gradient(180deg, var(--ink) 0%, var(--ink2) 100%); color: #cfe0df; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
.side-brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand .logo { font-family: var(--serif); font-size: 21px; font-weight: 700; color: #fff; }
.side-brand .sub { font-size: 11px; color: #9fc0bf; margin-top: 3px; letter-spacing: .5px; }
.side-nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; color: #c5d8d7; font-size: 14px; text-decoration: none; margin-bottom: 3px; cursor: pointer; }
.side-nav a .ic { width: 18px; text-align: center; opacity: .85; font-style: normal; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.on { background: var(--gold); color: #20302f; font-weight: 600; }
.side-foot { padding: 12px 16px; font-size: 11.5px; color: #8fb0ae; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar h2 { font-size: 17px; color: var(--ink2); margin: 0; }
.top-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eef4f3; color: var(--ink); border: 1px solid #d9e6e4; padding: 6px 11px; border-radius: 999px; font-weight: 600; font-size: 12.5px; }
.chip.gold { background: #f7f0e1; color: #8a6a24; border-color: #e9d8b2; }
.avatar-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.content { padding: 24px; flex: 1; }
.page { display: none; } .page.on { display: block; animation: fin .25s ease; }
@keyframes fin { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 面板/统计 ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-h h3 { margin: 0; font-size: 15px; color: var(--ink2); }
.panel-h .more { font-size: 12.5px; color: var(--ink); text-decoration: none; cursor: pointer; }
.stat .label { font-size: 12.5px; color: #8a9291; }
.stat .num { font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--ink); margin-top: 6px; line-height: 1.1; }
.stat .delta { font-size: 12px; color: #6f9c6a; margin-top: 4px; }
.stat .ic { float: right; width: 38px; height: 38px; border-radius: 10px; background: #eef4f3; color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 17px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: #7d8786; font-weight: 600; font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid #eef1f0; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .nowrap { white-space: nowrap; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.free { background: #eef1f0; color: #6a7271; }
.badge.pro { background: #e7f0f2; color: #12636f; }
.badge.boss { background: #f7f0e1; color: #8a6a24; }
.badge.enterprise { background: #efe7f2; color: #6b3f78; }
.badge.ok, .badge.succeeded, .badge.paid { background: #e6f3ec; color: #1d6b4f; }
.badge.run, .badge.running, .badge.pending { background: #fdf3df; color: #9a6d1a; }
.badge.err, .badge.failed { background: #f8e7e4; color: #a33a2f; }

/* ---------- 表单/按钮 ---------- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #55605f; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fff; font-family: inherit; color: var(--text); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,85,99,.1); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.6; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--ink); color: #fff; transition: .15s; text-decoration: none; }
.btn:hover { background: var(--ink2); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: #24302f; } .btn.gold:hover { background: #b8924a; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); } .btn.ghost:hover { background: #f3f6f5; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.muted { color: #8a9291; } .small { font-size: 12.5px; } .mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.empty { text-align: center; padding: 44px 20px; color: #99a1a0; font-size: 13.5px; }
.empty .ic { font-size: 34px; display: block; margin-bottom: 10px; opacity: .5; }

/* ---------- 视频 ---------- */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.video-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.video-card .ph { aspect-ratio: 9/16; max-height: 280px; background: #0e2a2f center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #9fc0bf; font-size: 12.5px; position: relative; margin: 0 auto; width: 100%; }
.video-card .bd { padding: 11px 12px; }
.video-card .t { font-size: 13.5px; font-weight: 600; color: var(--ink2); margin-bottom: 4px; }
.video-card .meta { font-size: 11.5px; color: #8a9291; display: flex; justify-content: space-between; }
.video-card video { width: 100%; display: block; }

/* ---------- 定价 ---------- */
.price-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; }
.price-card.hot { border-color: var(--gold); box-shadow: 0 14px 34px rgba(200,162,90,.18); position: relative; }
.price-card .tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #24302f; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.price-card .pname { font-size: 16px; font-weight: 700; color: var(--ink2); }
.price-card .pp { font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--ink); margin: 10px 0 2px; }
.price-card .pp small { font-size: 13px; color: #8a9291; font-weight: 400; }
.price-card ul { list-style: none; padding: 0; margin: 14px 0; flex: 1; }
.price-card li { font-size: 12.8px; color: #55605f; padding: 5px 0 5px 20px; position: relative; }
.price-card li:before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }

/* ---------- 模态 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(10,25,28,.5); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-mask.on { display: flex; }
.modal { background: var(--paper); border-radius: 14px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; padding: 22px 24px; }
.modal h3 { margin: 0 0 16px; color: var(--ink2); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.script-out { white-space: pre-wrap; line-height: 1.7; font-size: 13.5px; background: #f7f9f8; border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-height: 120px; }
.menu-toggle { display: none; background: none; border: 0; font-size: 22px; color: var(--ink); cursor: pointer; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: repeat(2,1fr); } .price-grid { grid-template-columns: repeat(2,1fr); }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: .25s; width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr; } .video-grid { grid-template-columns: 1fr; } .price-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; } .topbar { padding: 0 14px; }
  .chip { display: none; }
}
