/* ============================================================
   智欣联创官网 - 后台管理样式（红蓝主题）
   ============================================================ */
:root {
  --red: #C8102E;
  --red-dark: #A00D26;
  --red-light: #FDF2F4;
  --blue: #0A2E6B;
  --blue-2: #1560BD;
  --blue-light: #EEF3FB;
  --ink: #1A2233;
  --ink-2: #4A5468;
  --ink-3: #8A93A6;
  --bg: #F2F4F9;
  --line: #E3E7F0;
  --grad-main: linear-gradient(120deg, #C8102E 0%, #7A1A5A 45%, #0A2E6B 100%);
  --grad-red: linear-gradient(135deg, #C8102E, #E8556D);
  --grad-blue: linear-gradient(135deg, #0A2E6B, #1560BD);
  --shadow: 0 4px 16px rgba(10, 46, 107, .08);
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }

/* 侧栏 */
.sidebar {
  width: 232px; background: linear-gradient(180deg, #050F2B 0%, #0B2C6F 100%);
  color: #fff; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 18px 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .mark-chip { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 14px rgba(0,0,0,.28); }
.sidebar .brand .mark-chip img { width: 30px; height: 30px; display: block; }
.sidebar .brand .t1 { font-size: 15.5px; font-weight: 700; }
.sidebar .brand .t2 { font-size: 10.5px; color: rgba(255,255,255,.45); letter-spacing: 1.5px; }
.sidebar .menu { flex: 1; overflow-y: auto; padding: 14px 10px; }
.sidebar .menu::-webkit-scrollbar { width: 4px; }
.sidebar .menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.menu-group-title { font-size: 11px; color: rgba(255,255,255,.38); letter-spacing: 2px; padding: 16px 12px 8px; }
.menu-item {
  display: flex; align-items: center; gap: 11px; padding: 10.5px 14px; border-radius: 8px;
  color: rgba(255,255,255,.68); font-size: 14px; margin-bottom: 3px; cursor: pointer;
  transition: all .18s; border: 1px solid transparent;
}
.menu-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-item.active { background: rgba(200,16,46,.22); color: #fff; border-color: rgba(200,16,46,.5); }
.menu-item.active::before { content: ""; width: 4px; height: 16px; background: var(--red); border-radius: 4px; position: absolute; left: 0; }
.menu-item { position: relative; }
.menu-item svg { width: 17px; height: 17px; opacity: .85; }
.sidebar .side-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: rgba(255,255,255,.45); }
.sidebar .side-foot a { color: rgba(255,255,255,.65); }
.sidebar .side-foot a:hover { color: #fff; }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; height: 60px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 50; }
.topbar .crumb { font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.topbar .crumb .sep { color: var(--ink-3); font-weight: 400; }
.topbar .right { display: flex; align-items: center; gap: 18px; }
.topbar .user { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.topbar .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad-blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.topbar .view-site { font-size: 13px; color: var(--blue-2); padding: 6px 14px; border: 1px solid var(--blue-2); border-radius: 999px; transition: all .2s; }
.topbar .view-site:hover { background: var(--blue-2); color: #fff; }
.content { padding: 24px; flex: 1; }

/* 页面卡片 */
.panel { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px; }
.panel-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.panel-title::before { content: ""; width: 4px; height: 16px; background: var(--grad-red); border-radius: 4px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; cursor: pointer; border-radius: 7px; padding: 9px 20px; font-size: 13.5px; font-weight: 600; transition: all .18s; }
.btn-primary { background: var(--grad-red); color: #fff; box-shadow: 0 5px 14px rgba(200,16,46,.28); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-blue { background: var(--grad-blue); color: #fff; }
.btn-plain { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-plain:hover { border-color: var(--blue-2); color: var(--blue-2); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #F3C1CA; }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: 5px 13px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { background: var(--blue-light); color: var(--blue); font-weight: 700; white-space: nowrap; }
.data-table tr:hover td { background: #FAFBFE; }
.data-table .title-cell { font-weight: 600; color: var(--ink); max-width: 420px; }
.data-table .ops { white-space: nowrap; }
.data-table .ops .btn { margin-right: 6px; }
.tag-dot { display: inline-flex; align-items: center; gap: 6px; }
.tag-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2BB673; }
.tag-dot.off::before { background: #C4C9D4; }
.empty-tip { text-align: center; color: var(--ink-3); padding: 46px 0; }

/* 搜索/筛选栏 */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.input, .select, .textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 9px 13px; background: #fff; transition: border .18s, box-shadow .18s; width: 100%;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(21,96,189,.12); }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.form-item label .req { color: var(--red); margin-left: 3px; }
.form-item .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(10,22,49,.45); backdrop-filter: blur(2px); z-index: 900; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 640px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 30px 70px rgba(10,22,49,.3); animation: pop .22s ease; }
.modal.wide { width: 920px; }
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head .t { font-size: 16px; font-weight: 700; }
.modal-close { width: 30px; height: 30px; border-radius: 7px; border: none; background: transparent; font-size: 19px; color: var(--ink-3); cursor: pointer; }
.modal-close:hover { background: var(--red-light); color: var(--red); }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 15px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* toast */
#toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast { background: #fff; border-radius: 9px; padding: 11px 22px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(10,22,49,.18); display: flex; align-items: center; gap: 9px; animation: pop .2s ease; border-left: 4px solid #2BB673; }
.toast.err { border-left-color: var(--red); }
.toast.info { border-left-color: var(--blue-2); }

/* 分页 */
.pager { display: flex; gap: 7px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--ink-2); cursor: pointer; padding: 0 8px; }
.pager a:hover { border-color: var(--red); color: var(--red); }
.pager .cur { background: var(--grad-red); color: #fff; border-color: transparent; font-weight: 700; }
.pager .total { margin-right: auto; border: none; cursor: default; color: var(--ink-3); }

/* 开关 */
.switch { position: relative; width: 42px; height: 22px; background: #D6DBE6; border-radius: 999px; cursor: pointer; transition: background .2s; border: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.switch.on { background: #2BB673; }
.switch.on::after { left: 23px; }

/* 排序数字 */
.sort-input { width: 62px; text-align: center; padding: 5px 6px; }

/* 仪表盘 */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.dash-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 20px 22px; position: relative; overflow: hidden; }
.dash-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.dash-card.c1::before { background: var(--grad-red); }
.dash-card.c2::before { background: var(--grad-blue); }
.dash-card.c3::before { background: linear-gradient(90deg, #7A1A5A, #C8102E); }
.dash-card.c4::before { background: linear-gradient(90deg, #1560BD, #38B6E4); }
.dash-card .num { font-size: 30px; font-weight: 800; color: var(--ink); font-family: "DIN Alternate", Arial, sans-serif; }
.dash-card .label { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.dash-card .ico { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; }
.dash-card.c1 .ico { background: var(--grad-red); }
.dash-card.c2 .ico { background: var(--grad-blue); }
.dash-card.c3 .ico { background: linear-gradient(135deg, #7A1A5A, #C8102E); }
.dash-card.c4 .ico { background: linear-gradient(135deg, #1560BD, #38B6E4); }
.dash-2col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.dash-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.dash-list li:last-child { border-bottom: none; }
.dash-list .t { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.dash-list .d { color: var(--ink-3); font-size: 12px; flex-shrink: 0; margin-left: 12px; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(118deg, #081F49 0%, #0A2E6B 45%, #123E86 100%); position: relative; overflow: hidden; padding: 20px; }
.login-page::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(200,16,46,.35), transparent 45%), radial-gradient(circle at 15% 85%, rgba(21,96,189,.4), transparent 40%); }
.login-page::after { content: ""; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.04), 0 0 0 150px rgba(255,255,255,.025); }
.login-box { position: relative; z-index: 2; width: 400px; max-width: 100%; background: rgba(255,255,255,.98); border-radius: 18px; padding: 40px 38px 34px; box-shadow: 0 34px 80px rgba(2,12,40,.45); }
.login-box .lb-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-box .lb-brand .lb-logo { height: 56px; width: auto; display: block; }
.login-box .lb-brand .t { font-size: 18px; font-weight: 800; color: var(--blue); }
.login-box .lb-brand .t span { display: block; font-size: 10.5px; color: var(--ink-3); letter-spacing: 1.5px; font-weight: 500; }
.login-box .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 26px; }
.login-box .field { margin-bottom: 16px; }
.login-box .field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.login-box .field .input { padding: 12px 14px; }
.login-btn { width: 100%; padding: 13px; font-size: 15px; margin-top: 6px; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.8; }
.login-err { background: var(--red-light); color: var(--red); border: 1px solid #F3C1CA; border-radius: 8px; padding: 9px 14px; font-size: 12.5px; margin-bottom: 14px; display: none; }
.login-err.show { display: block; }

/* 富文本编辑器 */
.zeditor { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.zeditor .ztoolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px 10px; background: #F7F9FC; border-bottom: 1px solid var(--line); }
.zeditor .ztoolbar button {
  min-width: 30px; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--ink-2); padding: 0 7px; display: inline-flex; align-items: center; justify-content: center;
}
.zeditor .ztoolbar button:hover { background: #fff; border-color: var(--line); color: var(--blue-2); }
.zeditor .ztoolbar button.on { background: var(--blue-light); color: var(--blue-2); border-color: #C6D7F2; }
.zeditor .ztoolbar .sep { width: 1px; background: var(--line); margin: 4px 5px; }
.zeditor .ztoolbar select { border: 1px solid var(--line); border-radius: 6px; height: 30px; padding: 0 6px; background: #fff; font-size: 12.5px; }
.zeditor .zbody { min-height: 320px; padding: 14px 18px; background: #fff; outline: none; line-height: 1.9; font-size: 14.5px; overflow-y: auto; max-height: 560px; }
.zeditor .zbody:empty::before, .zeditor .zbody[data-empty="1"]::before { content: "请输入内容..."; color: #C4C9D4; }
.zeditor .zbody img { max-width: 100%; border-radius: 6px; }
.zeditor .zbody h2 { font-size: 19px; margin: 18px 0 10px; padding-left: 12px; border-left: 4px solid var(--red); }
.zeditor .zbody h3 { font-size: 16px; margin: 14px 0 8px; color: var(--blue); }
.zeditor .zbody p { margin-bottom: 10px; }
.zeditor .zbody blockquote { border-left: 4px solid var(--blue-2); background: var(--blue-light); padding: 10px 16px; margin: 10px 0; }
.zeditor .zbody table { border-collapse: collapse; }
.zeditor .zbody td, .zeditor .zbody th { border: 1px solid var(--line); padding: 8px 12px; }

/* iframe 容器 */
.page-frame { width: 100%; border: none; min-height: calc(100vh - 60px); }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-2col { grid-template-columns: 1fr; }
}
