/* 社交媒体内容工作台 - 全局样式（桌面优先，兼容手机） */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e2e5ea;
  --text: #1f2430;
  --muted: #6b7280;
  --primary: #d8232a;
  --primary-dark: #b31c22;
  --ok: #1a7f37;
  --warn: #b45309;
  --error: #c0342c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* 顶栏 */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar .inner { display: flex; align-items: center; gap: 18px; height: 56px; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--primary);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: #eef2f7; text-decoration: none; color: var(--text); }
.nav a.active { background: #e7effc; color: var(--primary); }
.userbox { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #dbe4f3; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.userbox .uname { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { margin: 0 0 10px; font-size: 14px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer; font-weight: 500;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f4f6f9; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--error); border-color: #f0c4c1; }
.btn.danger:hover { background: #fdf0ef; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 4px 10px; font-size: 13px; }

/* 徽标 */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge.ok { background: #e6f4ea; color: var(--ok); }
.badge.warn { background: #fdf1e0; color: var(--warn); }
.badge.error { background: #fdecea; color: var(--error); }
.badge.info { background: #e7effc; color: var(--primary); }
.badge.gray { background: #eef0f3; color: var(--muted); }

/* 表单 */
.form .field { margin-bottom: 14px; }
.form label { display: block; font-weight: 500; margin-bottom: 6px; }
.form .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input, .textarea, select.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus { outline: 2px solid #bcd2f6; border-color: var(--primary); }
.checkrow { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.checkrow:last-child { border-bottom: none; }
.checkrow input { margin-top: 3px; }
.checkrow .meta { flex: 1; }
.checkrow .muted { font-size: 12px; color: var(--muted); }

/* 平台图标色块 */
.p-icon { width: 30px; height: 30px; border-radius: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.p-linkedin { background: #0a66c2; }
.p-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.p-facebook { background: #1877f2; }

/* 账号列表 */
.account-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.account-row:last-child { border-bottom: none; }
.account-row .info { flex: 1; min-width: 0; }
.account-row .name { font-weight: 600; }
.account-row .sub { font-size: 12px; color: var(--muted); }
.account-row .ops { display: flex; gap: 8px; flex: none; }

/* 素材预览 */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.media-item { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #f0f1f3; }
.media-item img, .media-item video { width: 100%; height: 110px; object-fit: cover; display: block; background: #000; }
.media-item .tag { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.media-item .del { position: absolute; top: 6px; right: 6px; }
.media-item .filename { padding: 6px 8px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 文案卡 */
.copy-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: #fff; margin-bottom: 16px; }
.copy-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.copy-head .t { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.copy-body textarea { font-family: inherit; }
.copy-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.count { font-size: 12px; color: var(--muted); }
.count.over { color: var(--error); font-weight: 600; }

/* 发布记录表 */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
table.list th { color: var(--muted); font-weight: 500; background: #fafbfc; }
table.list td.time { color: var(--muted); white-space: nowrap; }

/* 内容列表 */
.content-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.content-row:last-child { border-bottom: none; }
.content-row .main { flex: 1; min-width: 0; }
.content-row .t { font-weight: 600; }
.content-row .sub { font-size: 12px; color: var(--muted); }
.content-row .ops { flex: none; display: flex; gap: 8px; }

/* 提示条 */
.notice, .okbar {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px;
  border: 1px solid var(--border);
}
.notice { background: #fdf1e0; color: var(--warn); border-color: #f3d9ae; }
.okbar { background: #e6f4ea; color: var(--ok); border-color: #bfe3cb; }
.inline-error { color: var(--error); font-size: 13px; margin-top: 4px; }

/* 空状态 */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 30px; margin-bottom: 8px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; max-width: 720px; width: 100%; max-height: 86vh; overflow: auto; padding: 20px; }
.modal h3 { margin: 0 0 12px; }
.modal .confirm-list { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.modal .confirm-list .row { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.modal .confirm-list .row:last-child { border-bottom: none; }

/* 登录页 - 左图右表单 */
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1.2fr 1fr; background: #fff; }
.login-hero { position: relative; overflow: hidden; }
.login-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 45%);
  color: var(--text); padding: 48px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.login-hero-logo { width: 96px; height: auto; margin-bottom: 24px; }
.login-hero-overlay h1 { font-size: 36px; font-weight: 700; margin: 0 0 12px; letter-spacing: 1px; color: var(--primary); }
.login-hero-overlay p { font-size: 15px; line-height: 1.8; margin: 0; color: #444; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-side-inner { width: 100%; max-width: 380px; }
.login-brand { margin-bottom: 32px; }
.login-brand-logo { height: 72px; width: auto; }
.login-title { font-size: 26px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.login-sub { color: var(--muted); margin: 0 0 32px; font-size: 14px; }
.login-btn { padding: 13px 18px; font-size: 15px; border-radius: 8px; margin-top: 8px; }
.login-footer { margin-top: 48px; color: #9aa0aa; font-size: 12px; }

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-hero { min-height: 200px; }
  .login-hero-overlay { padding: 24px; justify-content: flex-start; }
  .login-hero-logo { width: 64px; margin-bottom: 12px; }
  .login-hero-overlay h1 { font-size: 24px; }
  .login-hero-overlay p { display: none; }
}

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; }
.toast.error { background: var(--error); }
.toast.ok { background: var(--ok); }

/* 授权页（无权限） */
.deny-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.deny-card { max-width: 520px; width: 100%; text-align: center; }

/* 小工具 */
.muted { color: var(--muted); }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt12 { margin-top: 12px; }
.mb12 { margin-bottom: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* 手机适配 */
@media (max-width: 640px) {
  .topbar .inner { height: 52px; }
  .userbox .uname { display: none; }
  .account-row, .content-row { flex-wrap: wrap; }
  .account-row .ops { width: 100%; justify-content: flex-end; }
}
