/* yun_admin 后台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f0f2f5; color: #333; font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: #999; font-weight: normal; font-size: 12px; }

/* 登录 */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: #fff; padding: 40px; border-radius: 10px; width: 340px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { font-size: 22px; text-align: center; }
.login-card .sub { text-align: center; color: #888; margin-bottom: 8px; }
.login-card input, .toolbar input, .pwd-card input {
  padding: 9px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; width: 100%;
}
.login-card button { padding: 10px; border: none; border-radius: 6px; background: #1677ff; color: #fff; cursor: pointer; }
.error { color: #e5484d; font-size: 12px; min-height: 16px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: #001529; color: #fff; display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
}
.brand { font-size: 18px; font-weight: bold; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar nav { display: flex; flex-direction: column; padding: 10px 0; flex: 1; }
.sidebar nav a, .ext-nav a {
  padding: 11px 18px; color: rgba(255,255,255,.75); cursor: pointer; text-decoration: none; font-size: 14px;
}
.sidebar nav a:hover, .ext-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar nav a.active { color: #fff; background: #1677ff; }
.ext-nav { border-top: 1px solid rgba(255,255,255,.08); padding: 8px 0; }
.ext-nav .ext-title { padding: 6px 18px; font-size: 12px; color: rgba(255,255,255,.4); }
.ext-nav a::after { content: " ↗"; font-size: 11px; opacity: .7; }
.sidebar-foot { padding: 14px 18px; font-size: 13px; color: rgba(255,255,255,.6); border-top: 1px solid rgba(255,255,255,.08); }
.link-btn { background: none; border: none; color: #69b1ff; cursor: pointer; padding: 0; margin-left: 8px; }

.content { margin-left: 210px; flex: 1; padding: 26px 30px; }
.page h2 { margin-bottom: 18px; font-size: 19px; }
.page h3 { margin: 22px 0 8px; font-size: 15px; }
.page > p { margin-bottom: 10px; }

/* 卡片 */
.cards { display: flex; gap: 16px; flex-wrap: wrap; }
.card {
  background: #fff; border-radius: 8px; padding: 20px 24px; min-width: 160px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card .num { font-size: 26px; font-weight: bold; color: #1677ff; }
.card .label { color: #888; margin-top: 4px; }

/* 工具条与表格 */
.toolbar { display: flex; gap: 10px; margin: 10px 0 14px; flex-wrap: wrap; }
.toolbar input { width: 240px; }
button {
  padding: 8px 16px; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff;
  cursor: pointer; font-size: 13px;
}
button:hover { border-color: #1677ff; color: #1677ff; }
button.primary { background: #1677ff; border-color: #1677ff; color: #fff; }
button.primary:hover { background: #4096ff; }
button.danger { color: #e5484d; border-color: #e5484d; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.tbl th { background: #fafafa; color: #666; font-weight: normal; }
.perm-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; margin-right: 4px; }
.perm-badge.on { background: #e8f5e9; color: #2e7d32; }
.perm-badge.off { background: #fdecea; color: #c62828; }
.tbl .ops button { margin-right: 6px; padding: 4px 10px; font-size: 12px; }

/* 导航链接编辑 */
#nav-links-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.nav-item { display: flex; gap: 10px; align-items: center; }
.nav-item input { padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; }
.nav-item .n { width: 180px; }
.nav-item .u { flex: 1; }

/* Mixly 配置编辑 */
.mixly-card { background: #fff; border-radius: 8px; padding: 16px 18px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.mixly-card > h4 { font-size: 14px; margin-bottom: 10px; color: #1677ff; }
.mixly-field { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mixly-field .k { width: 220px; color: #666; font-size: 13px; flex-shrink: 0; }
.mixly-field input[type=text], .mixly-field input[type=number] { flex: 1; padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 6px; }
.mixly-field textarea { flex: 1; padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 6px; font-family: Consolas, monospace; font-size: 12px; min-height: 60px; }
.mixly-field .type-tag { font-size: 11px; color: #aaa; flex-shrink: 0; }

/* 修改密码 */
.pwd-card { background: #fff; border-radius: 8px; padding: 24px; width: 380px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.pwd-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #666; }
.pwd-card button { align-self: flex-start; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; padding: 22px; width: 460px; max-height: 70vh; overflow: auto; }
.modal h3 { margin-bottom: 12px; }
.modal table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.modal td, .modal th { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; font-size: 13px; text-align: left; }
.modal .close-row { text-align: right; }

/* toast */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 9px 20px; border-radius: 6px; z-index: 200; font-size: 13px;
}
.toast.err { background: #e5484d; }
