/* ==========================================================================
   fu365 管理后台样式
   ========================================================================== */

:root {
  --primary: #0084ff;
  --primary-dark: #0071db;
  --text-darker: #101c2e;
  --text-dark: #444d58;
  --text-default: #6b7386;
  --text-light: #8b9199;
  --line: #eef1f5;
  --page-bg: #f4f8fd;
  --panel-bg: #fff;
  --danger: #e5484d;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 28, 46, .03), 0 10px 30px rgba(16, 28, 46, .05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-width: 1080px;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 85% -10%, #e4f2ff 0%, rgba(228, 242, 255, 0) 60%),
    radial-gradient(700px 360px at -10% 0%, #f0f7ff 0%, rgba(240, 247, 255, 0) 55%),
    var(--page-bg);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-darker);
  font: 13px/1.6 "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", 微软雅黑, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
li { list-style: none; }
img { border: 0; vertical-align: middle; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; outline: 0; }
[hidden] { display: none !important; }

/* ============================ 登录 / 权限提示 ============================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(760px 400px at 50% -8%, #d8edff 0%, rgba(216, 237, 255, 0) 62%),
    linear-gradient(180deg, #f7fbff 0%, #f2f7fd 100%);
}

.gate-card {
  width: 420px;
  padding: 38px 36px 34px;
  text-align: center;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(16, 60, 120, .12), inset 0 1px 0 #fff;
  backdrop-filter: blur(16px);
}

.gate-logo { width: 46px; height: 46px; border-radius: 12px; }
.gate-card h1 { margin-top: 14px; font-size: 20px; letter-spacing: .5px; }
.gate-text {
  margin-top: 10px;
  color: var(--text-default);
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}
.gate-loading-text { display: block; margin-top: 12px; }
.gate-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.gate-actions .btn { min-width: 118px; justify-content: center; }

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border: 2px solid #dbe9fb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.side {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 216px;
  padding: 22px 16px 18px;
  background: rgba(255, 255, 255, .92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
}
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand span { display: flex; flex-direction: column; font-size: 15px; font-weight: 700; line-height: 1.25; }
.brand small { margin-top: 2px; color: var(--text-light); font-size: 11px; font-weight: 400; letter-spacing: .5px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-dark);
  transition: background .18s, color .18s;
}
.nav-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c9d6e6;
  transition: background .18s, transform .18s;
}
.nav-item:hover { background: #f5f9ff; color: var(--primary); }
.nav-item.active { background: #e9f4ff; color: var(--primary); font-weight: 600; }
.nav-item.active .dot { background: var(--primary); transform: scale(1.15); }

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.side-link {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--text-default);
  font-size: 12.5px;
  text-align: left;
}
.side-link:hover { background: #f5f9ff; color: var(--primary); }

.main { flex: 1; min-width: 0; margin-left: 216px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid rgba(238, 241, 245, .9);
  backdrop-filter: blur(14px);
}
.topbar-title h1 { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.topbar-title p { margin-top: 2px; color: var(--text-light); font-size: 12px; }

.who { display: flex; align-items: center; gap: 8px; color: var(--text-dark); }
.who .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3aa5ff, #0071db);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.who b { max-width: 160px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.content { padding: 24px 32px 52px; }

/* ============================ 皮肤管理 ============================ */
.skin-cat-panel { margin-bottom: 16px; padding: 16px 18px; }
.skin-cat-panel .chips { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 { font-size: 14px; }
.chip-count { padding: 0 5px; border-radius: 4px; background: #eef4ff; color: var(--text-light); font-size: 10px; line-height: 15px; }
.chip-btn { height: 18px; padding: 0 5px; border: 1px solid #e3e8ef; border-radius: 4px; background: #fff; color: var(--text-default); font-size: 10px; }
.chip-btn:hover { border-color: #8cc8ff; color: var(--primary); }
.chip-btn.danger:hover { border-color: #ffc9c9; color: var(--danger); }
.skin-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 34px;
  border-radius: 6px;
  background: #f3f5f8;
  color: var(--text-light);
  font-size: 10px;
  object-fit: cover;
}
.cell-sub { display: flex; gap: 4px; margin-top: 5px; }
.image-picker { display: flex; flex-direction: column; gap: 8px; }
.image-picker-row { display: flex; gap: 8px; }
.image-picker-row .input { flex: 1; min-width: 0; }
.upload-btn { flex: none; cursor: pointer; }
.image-preview { width: 100%; max-height: 180px; border: 1px solid #eef1f5; border-radius: 8px; object-fit: cover; }

/* ============================ 通用组件 ============================ */
.panel {
  background: var(--panel-bg);
  border: 1px solid rgba(238, 241, 245, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.muted { color: var(--text-light); font-size: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background: #fff;
  color: var(--text-dark);
  font-size: 12.5px;
  white-space: nowrap;
  transition: border-color .18s, color .18s, background .18s, opacity .18s;
}
.btn:hover { border-color: #b9d9ff; color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.danger { border-color: #ffd7d9; color: var(--danger); }
.btn.danger:hover { background: #fff5f5; border-color: #ffb9bc; color: var(--danger); }
.btn.small { height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-default); }
.btn.ghost:hover { background: #f5f9ff; color: var(--primary); }

.input {
  height: 34px;
  padding: 0 11px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background: #fff;
  color: var(--text-darker);
  font-size: 12.5px;
  transition: border-color .18s, box-shadow .18s;
}
.input:focus { border-color: #8cc8ff; box-shadow: 0 0 0 3px rgba(0, 132, 255, .1); }
.input::placeholder { color: #a9b1c0; }
select.input { padding-right: 26px; cursor: pointer; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar.between { justify-content: space-between; }
.toolbar-note { color: #b26a00; font-size: 12px; }

.role-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f0f2f5;
  color: var(--text-default);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}
.role-tag.admin { background: #f3ecff; color: #7b3fd3; }
.role-tag.editor { background: #e8f3ff; color: var(--primary-dark); }
.role-tag.user { background: #f0f2f5; color: var(--text-default); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f0f2f5;
  color: var(--text-light);
  font-size: 11px;
}
.badge.on { background: #e7f8ee; color: #1a9f53; }
.badge.off { background: #ffeded; color: var(--danger); }
.badge.info { background: #e8f3ff; color: var(--primary-dark); }
.badge.warning { background: #fff4e5; color: #b26a00; }
.badge.success { background: #e7f8ee; color: #1a9f53; }
.badge.new { background: #e7f8ee; color: #0a9d5c; }
.badge.hot { background: #fff2e8; color: #ff6a00; }
.badge.up { background: #eaf1ff; color: #3376f4; }

/* ============================ 数据概览 ============================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  padding: 18px 20px;
  background: var(--panel-bg);
  border: 1px solid rgba(238, 241, 245, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-card span { color: var(--text-light); font-size: 12px; }
.stat-card b { display: block; margin-top: 8px; font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stat-card b em { font-size: 12px; font-style: normal; font-weight: 400; color: var(--text-light); }

.note-panel { margin-top: 16px; padding: 20px 22px; }
.note-panel h3 { font-size: 14px; }
.note-panel p { margin-top: 8px; color: var(--text-default); font-size: 12.5px; line-height: 1.8; }

/* ============================ 表格 ============================ */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  padding: 11px 16px;
  background: #f8fafc;
  color: var(--text-light);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 12px 16px; border-top: 1px solid #f3f5f8; color: var(--text-dark); vertical-align: middle; }
.table tbody tr:hover { background: #fafcff; }
.table .col-actions { width: 1%; white-space: nowrap; }
.table .cell-user b { display: block; color: var(--text-darker); font-weight: 600; }
.table .cell-user small { display: block; margin-top: 1px; color: var(--text-light); font-size: 11.5px; }
.table .row-actions { display: flex; flex-wrap: wrap; gap: 4px; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid #f3f5f8; }
.pager .pager-info { color: var(--text-light); font-size: 12px; }

.empty { padding: 42px 20px; color: var(--text-light); font-size: 12.5px; text-align: center; }

/* ============================ 分类栏 ============================ */
.cat-list { display: flex; flex-direction: column; gap: 14px; }
.cat-card {
  overflow: hidden;
  background: var(--panel-bg);
  border: 1px solid rgba(238, 241, 245, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border-bottom: 1px solid #f3f5f8;
}
.cat-head b { font-size: 13.5px; }
.cat-head .row-actions { display: flex; gap: 4px; margin-left: auto; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0, 132, 255, .08); }

.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px dashed #f2f4f7;
}
.link-row:first-child { border-top: 0; }
.link-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border-radius: 5px;
  background: #f2f5f9;
  color: #8a97a8;
  font-size: 11px;
  font-weight: 600;
}
.link-icon img { width: 100%; height: 100%; object-fit: contain; }
.link-row .link-title { flex: none; width: 170px; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.link-row .link-url { flex: 1; min-width: 0; overflow: hidden; color: var(--text-light); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.link-row .row-actions { display: flex; gap: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f5f9ff;
  color: var(--text-dark);
  font-size: 12px;
}

/* ============================ 公告 ============================ */
.cell-clip { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ 弹窗表单 ============================ */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(16, 28, 46, .42); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 540px;
  max-height: 86vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(16, 28, 46, .22);
  animation: modal-in .2s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-card.modal-wide { width: 760px; max-width: calc(100vw - 40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; }
.modal-head h3 { font-size: 15px; }
.modal-x { width: 28px; height: 28px; border-radius: 8px; color: var(--text-light); font-size: 18px; line-height: 1; }
.modal-x:hover { background: #f5f7fa; color: var(--text-dark); }
.modal-body { flex: 1; padding: 6px 22px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid #f3f5f8; }
.modal-foot .btn { min-width: 84px; }

.field { display: block; margin-top: 14px; }
.field > span { display: block; margin-bottom: 6px; color: var(--text-default); font-size: 12px; }
.field .req { color: var(--danger); }
.field .input, .field textarea, .field select { width: 100%; }
.field textarea {
  min-height: 92px;
  padding: 9px 11px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color .18s, box-shadow .18s;
}
.field textarea:focus { border-color: #8cc8ff; box-shadow: 0 0 0 3px rgba(0, 132, 255, .1); }
.field .hint { margin-top: 5px; color: var(--text-light); font-size: 11.5px; }
.field.check { display: flex; align-items: center; gap: 8px; }
.field.check input { width: 15px; height: 15px; accent-color: var(--primary); }
.field.check > span { margin: 0; color: var(--text-dark); font-size: 12.5px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.field input[type="color"] { height: 34px; padding: 3px; cursor: pointer; }

/* ============================ Toast ============================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 1200;
  max-width: 520px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(16, 28, 46, .92);
  color: #fff;
  font-size: 12.5px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
