/* 视觉对齐 modelhub frontend2 浅色皮肤（auth-light / platform-light） */
:root{
  --bg:#ffffff; --bg-auth:#fafafa; --surface-2:#f7f8fa; --surface-hover:#f4f4f5;
  --text-main:#111827; --text-muted:#4b5563; --text-faint:#8a8f98;
  --border:#eef0f3; --border-input:#d8dee8; --border-strong:#d4d4d8;
  --primary:#111827; --primary-hover:#000;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC',Roboto,sans-serif;
  font-size:14px;line-height:1.55;letter-spacing:.01em;
  color:var(--text-main);background:var(--bg);min-height:100vh;-webkit-font-smoothing:antialiased;
}
.hidden{display:none!important}
.mono{font-family:var(--mono);font-size:12px}
.muted{color:var(--text-faint)}
.sub{color:var(--text-faint);font-size:12px}

/* ===== 登录（auth-light） ===== */
.auth-page{
  min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;
  background:radial-gradient(circle at 50% 0%,rgba(24,24,27,.06),transparent 34%),var(--bg-auth);
}
.auth-card{
  width:100%;max-width:420px;background:#fff;border:1px solid #e4e4e7;border-radius:22px;
  padding:36px 32px 32px;box-shadow:0 24px 80px rgba(17,24,39,.08);
}
.auth-logo{
  width:44px;height:44px;border-radius:12px;margin:0 auto 16px;display:flex;align-items:center;justify-content:center;
  background:#111827;color:#fff;font-size:16px;font-weight:700;
}
.auth-brand{text-align:center;font-size:1.4rem;font-weight:700;color:#111827;margin-bottom:6px}
.auth-subtitle{text-align:center;color:#71717a;font-size:13px;margin-bottom:22px}
.auth-field{margin-bottom:14px}
.auth-field label{display:block;margin:0 0 6px;font-size:12px;color:#71717a}
.auth-field input{
  width:100%;padding:12px 14px;background:#fff;border:1px solid #d4d4d8;border-radius:11px;
  font-size:14px;color:#111827;outline:none;transition:border-color .18s,box-shadow .18s;
}
.auth-field input::placeholder{color:#a1a1aa}
.auth-field input:focus{border-color:#111827;box-shadow:0 0 0 3px rgba(17,24,39,.10)}
.auth-submit{
  width:100%;padding:13px;font-size:14.5px;font-weight:600;margin-top:6px;
  background:#111827;color:#fff;border:1px solid #111827;border-radius:11px;cursor:pointer;
}
.auth-submit:hover{background:#000;border-color:#000}
#login-msg{margin-top:14px;font-size:13px;color:#71717a;min-height:1.2em;text-align:center}
#login-msg.err{color:#b91c1c}
#login-msg.info{color:#71717a}

/* ===== 控制台（platform-light） ===== */
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  height:56px;padding:0 20px;background:#fff;border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:10;
}
.topbar-left{display:flex;align-items:center;gap:10px;min-width:0}
.topbar-logo{
  width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center;
  background:#111827;color:#fff;font-weight:700;font-size:11px;
}
.topbar-brand{font-weight:700;font-size:14px;color:#111827}
.topbar-sub{font-size:12px;color:var(--text-faint);margin-top:1px}
.topbar-right{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:13px}
.topbar-user{color:#111827}
.shell-body{max-width:1100px;margin:0 auto;padding:40px 32px 64px;width:100%}

.card{
  background:#fff;border:1px solid #e4e4e7;border-radius:14px;padding:22px 24px;margin-bottom:18px;
}
.card h2{margin:0 0 14px;font-weight:600;font-size:16px;color:#111827}

.bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 12px}
.toolbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center}

input,select,textarea{
  font:inherit;padding:8px 12px;min-height:38px;background:#fff;color:#111827;
  border:1px solid var(--border-input);border-radius:8px;outline:none;
}
input[type=file]{min-height:auto;padding:6px 8px}
input::placeholder,textarea::placeholder{color:#a1a1aa}
input:focus,select:focus,textarea:focus{outline:2px solid rgba(17,24,39,.35);outline-offset:2px}
textarea{width:100%;min-height:96px;resize:vertical}

button{
  font:inherit;font-size:13px;font-weight:500;min-height:38px;padding:0 16px;border-radius:8px;cursor:pointer;
  background:#111827;border:1px solid #111827;color:#fff;box-shadow:none;transition:background .15s,border-color .15s;
}
button:hover{background:#000;border-color:#000}
button:focus-visible{outline:2px solid rgba(17,24,39,.35);outline-offset:2px}
button:disabled{background:#f4f4f5;border-color:#e4e4e7;color:#a1a1aa;cursor:not-allowed}
button.ghost,button.sm:not(.primary):not(.danger){background:#fff;border:1px solid #d4d4d8;color:#18181b}
button.ghost:hover,button.sm:not(.primary):not(.danger):hover{background:#f4f4f5;border-color:#a1a1aa;color:#111827}
button.primary{background:#111827;border-color:#111827;color:#fff}
button.danger{background:#fff;border:1px solid #fecaca;color:#b91c1c}
button.danger:hover{background:#fef2f2;border-color:#f87171}
button.sm{min-height:30px;padding:0 12px;font-size:12px}
.topbar button.active{background:#f3f4f6;border-color:#d4d4d8;color:#111827;box-shadow:inset 0 -2px 0 #111827}

#msg{min-height:1.2em;font-size:13px;padding:0;margin:0 0 14px;border-radius:10px;border:1px solid transparent}
#msg.ok,#msg.bad{padding:10px 14px}
#msg.ok{color:#166534;background:#f0fdf4;border-color:#bbf7d0}
#msg.bad{color:#b91c1c;background:#fef2f2;border-color:#fecaca}

.table-wrap{overflow-x:auto;border:1px solid #e4e4e7;border-radius:12px;background:#fff}
table.data{width:100%;border-collapse:collapse;font-size:13px}
table.data th,table.data td{text-align:left;padding:12px 14px;border-bottom:1px solid var(--border);vertical-align:top}
table.data th{color:var(--text-faint);font-weight:600;font-size:12px;background:#fafafa;white-space:nowrap}
table.data tbody tr:hover td{background:var(--surface-2)}
table.data tr:last-child td{border-bottom:none}

.pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:11px;font-weight:600;
  background:#f4f4f5;color:#3f3f46;border:1px solid #e4e4e7}
.pill.pending{background:#fffbeb;color:#92400e;border-color:#fde68a}
.pill.replied{background:#f0fdf4;color:#166534;border-color:#bbf7d0}
.pill.closed{background:#f4f4f5;color:#71717a;border-color:#e4e4e7}

.pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;
  padding:10px 12px;border:1px solid #e4e4e7;border-radius:12px;background:#fff}
.empty-state{padding:28px 16px;text-align:center;color:var(--text-faint);font-size:13px;
  background:#fafafa;border:1px dashed #e4e4e7;border-radius:12px;margin-top:8px}

.timeline{display:flex;flex-direction:column;gap:12px}
.bubble{border:1px solid #e4e4e7;border-radius:12px;padding:12px 14px;background:#fff}
.bubble.official{background:#f7f8fa;border-color:#d4d4d8;box-shadow:inset 3px 0 0 #111827}
.bubble .meta{font-size:12px;color:var(--text-faint);margin-bottom:6px}
.thumbs{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.thumbs img{width:72px;height:72px;object-fit:cover;border:1px solid #e4e4e7;border-radius:8px;cursor:pointer;background:#fafafa}

/* ===== 外壳：左侧导航（frontend2 platform-light） ===== */
.app-shell{display:flex;min-height:100vh;background:#fafafa}
.sidebar{width:232px;flex:0 0 232px;background:#fff;border-right:1px solid var(--border);display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.sidebar-brand{display:flex;align-items:center;gap:10px;padding:18px 18px 14px;border-bottom:1px solid var(--border)}
#nav{flex:1;overflow:auto;padding:10px 10px}
.nav-group{margin-bottom:12px}
/* 大类标题是 <button>：必须盖住全局 button/#000 hover，否则聚焦/悬停变黑底 */
.nav-group-title{
  all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;width:100%;
  cursor:pointer;font-size:11px;font-weight:600;color:var(--text-faint);letter-spacing:.04em;padding:8px 10px 4px;border-radius:6px;background:transparent;border:1px solid transparent;
}
button.nav-group-title:hover,
button.nav-group-title:active,
button.nav-group-title:focus,
button.nav-group-title:focus-visible{
  background:var(--surface-hover);border-color:transparent;color:#111827;box-shadow:none;
}
button.nav-group-title:focus-visible{outline:2px solid rgba(17,24,39,.35);outline-offset:2px}
.nav-group-title .caret{font-size:10px;transition:transform .15s}
.nav-group.collapsed .caret{transform:rotate(-90deg)}
.nav-group.collapsed .nav-items{display:none}

.me-card{display:flex;align-items:flex-start;gap:10px}
.me-avatar{
  flex:0 0 36px;width:36px;height:36px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:#111827;color:#fff;font-size:13px;font-weight:700;letter-spacing:.02em;
}
.me-meta{flex:1;min-width:0}
.me-name-row{display:flex;align-items:flex-start;gap:4px}
.me-name{
  flex:1;min-width:0;font-weight:500;font-size:12px;line-height:1.35;color:#111827;cursor:pointer;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;
  overflow:hidden;word-break:break-word;overflow-wrap:anywhere;
}
.me-name:hover{text-decoration:underline dotted}
.icon-btn{
  all:unset;cursor:pointer;color:var(--text-faint);font-size:12px;
  padding:2px 5px;border-radius:6px;flex:0 0 auto;margin-top:1px;line-height:1.2;
  opacity:.55;transition:opacity .15s,background .15s,color .15s;
}
.me-card:hover .icon-btn,.icon-btn:hover,.icon-btn:focus-visible{opacity:1}
.icon-btn:hover,.icon-btn:focus-visible{background:var(--surface-hover);color:#111827}
.me-email{
  margin-top:2px;font-family:var(--mono);font-size:11px;line-height:1.35;color:var(--text-faint);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.me-hint{
  margin-top:4px;font-size:11px;color:#a1a1aa;line-height:1.3;
  opacity:0;max-height:0;overflow:hidden;transition:opacity .15s,max-height .15s;
}
.me-card:hover .me-hint,.me-card:focus-within .me-hint{opacity:1;max-height:2em}
.me-edit{margin-top:2px}
.me-edit-label{display:block;font-size:11px;color:var(--text-faint);margin-bottom:6px}
.me-edit input{width:100%;min-height:34px;padding:7px 10px;margin-bottom:8px}
.logout-btn{
  display:block;width:100%;margin-top:14px;padding:8px 12px;min-height:34px;
  font:inherit;font-size:12.5px;font-weight:500;cursor:pointer;
  background:#fff;border:1px solid #e4e4e7;border-radius:8px;color:#3f3f46;
}
.logout-btn:hover{background:#fafafa;border-color:#d4d4d8;color:#111827}
.nav-item{display:block;padding:8px 12px;border-radius:8px;color:var(--text-muted);text-decoration:none;font-size:13.5px}
.nav-item:hover{background:var(--surface-hover);color:#111827}
.nav-item.active{background:#f3f4f6;color:#111827;font-weight:600;box-shadow:inset 2px 0 0 #111827}
.sidebar-foot{padding:16px 16px 18px;border-top:1px solid var(--border);background:#fafafa}
.me-id{word-break:break-all;color:#111827}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.main-head{height:56px;display:flex;align-items:center;padding:0 28px;background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:5}
.main-head h1{margin:0;font-size:16px;font-weight:650}
.main-body{padding:24px 28px 64px;max-width:1240px;width:100%}
#msg.info{padding:10px 14px;color:#4b5563;background:#f7f8fa;border-color:#eef0f3}

/* ===== 推荐产品模块 ===== */
.card h2 .tag{font-size:11px;font-weight:600;color:var(--text-faint);background:#f4f4f5;border-radius:999px;padding:2px 8px;margin-left:6px}
.note{margin:0 0 12px;color:var(--text-faint);font-size:12.5px}
.thumb{width:48px;height:48px;object-fit:contain;background:#fff;border:1px solid #e4e4e7;border-radius:6px;display:block}
.logo-cell{width:72px}
.logo-wrap{position:relative;width:48px;display:inline-block}
.logo-wrap label.up{position:absolute;right:-4px;bottom:-4px;background:rgba(17,24,39,.8);color:#fff;font-size:10px;border-radius:6px;padding:2px 5px;opacity:0;cursor:pointer;z-index:2}
.logo-wrap:hover label.up{opacity:1}
.logo-wrap input[type=file]{display:none}
.pids{display:flex;flex-wrap:wrap;gap:4px;max-width:280px}
.chip{display:inline-block;font-family:var(--mono);font-size:11px;background:#f4f4f5;color:#111827;border:1px solid #e4e4e7;border-radius:6px;padding:2px 7px;word-break:break-all}
.chip.empty{color:var(--text-faint)}
.pids-cell{min-width:200px;max-width:320px}
.pids-view,.sort-view{cursor:text;border-radius:6px;padding:2px;min-height:28px;display:inline-block}
.pids-view:hover,.sort-view:hover{outline:1px dashed #a1a1aa}
.pids-edit,.sort-edit{display:flex;flex-direction:column;gap:6px}
.sort-edit input{width:80px}
.type-src{font-size:12px}.type-src .src{color:var(--text-faint);font-size:11px}
.row-actions{display:flex;flex-wrap:wrap;gap:6px}
details.advanced{margin-top:10px;border:1px solid #e4e4e7;border-radius:10px;padding:8px 12px;background:#fafafa}
details.advanced summary{cursor:pointer;color:var(--text-muted);font-size:13px}
details.advanced a{color:#111827;word-break:break-all}
details.advanced code{font-family:var(--mono);font-size:11.5px;background:#f4f4f5;padding:1px 4px;border-radius:4px}
textarea.tall{min-height:180px;font-family:var(--mono);font-size:12px;margin-top:8px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0}
.form-grid label{font-size:12px;color:var(--text-faint);display:flex;flex-direction:column;gap:4px}
.form-grid input,.form-grid select,.form-grid textarea{width:100%}
.modal-bg{position:fixed;inset:0;background:rgba(17,24,39,.4);display:none;align-items:center;justify-content:center;z-index:50;padding:16px}
.modal-bg.on{display:flex}
.modal{background:#fff;border-radius:16px;border:1px solid #e4e4e7;max-width:560px;width:100%;padding:22px;box-shadow:0 24px 80px rgba(17,24,39,.12);max-height:90vh;overflow:auto}
.modal h3{margin:0 0 12px;font-size:16px}
@media (max-width:860px){
  .app-shell{flex-direction:column}
  .sidebar{width:100%;flex:none;height:auto;position:static}
  .main-body{padding:16px 12px 48px}
  .form-grid{grid-template-columns:1fr}
}
