/* 百度网盘卡密下载后台 —— 浅色管理端样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e8ecf3;
  --line2: #d9e0ec;
  --txt: #1f2937;
  --txt2: #5b6577;
  --dim: #8a94a6;
  --blue: #2a6ff0;
  --blue-bg: #eef4ff;
  --green: #22a06b;
  --green-bg: #eaf7f1;
  --red: #e5484d;
  --red-bg: #fdeeee;
  --orange: #e08a1e;
  --orange-bg: #fdf5e7;
  --radius: 8px;
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: #f2f5fa; padding: 1px 6px; border-radius: 4px;
  font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; color: #d6336c;
}
.dim { color: var(--dim); }
.ok { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--orange); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: inline; }
.hidden { display: none !important; }

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

.side {
  width: 208px; flex: 0 0 208px; background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  padding: 18px 18px 16px; border-bottom: 1px solid var(--line);
}
.brand .logo {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
  background: linear-gradient(135deg, #4d8dff, #2a6ff0);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}
.brand b { font-size: 14px; font-weight: 600; color: var(--txt); }

.nav { padding: 10px 10px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 2px; border-radius: var(--radius);
  color: var(--txt2); font-size: 13.5px; text-decoration: none;
  transition: background .14s, color .14s;
}
.nav a:hover { background: #f4f7fd; color: var(--txt); text-decoration: none; }
.nav a.on { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.nav .ic { width: 16px; text-align: center; font-size: 14px; }

.nav-group { margin-top: 6px; }
.nav-group > .nav-title {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--txt2); font-size: 13.5px; user-select: none;
}
.nav-group > .nav-title:hover { background: #f4f7fd; }
.nav-group > .nav-title.on { color: var(--blue); }
.nav-group > .nav-title .arrow { margin-left: auto; font-size: 10px; color: var(--dim); transition: transform .18s; }
.nav-group.open > .nav-title .arrow { transform: rotate(180deg); }
.nav-sub { padding-left: 26px; display: none; }
.nav-group.open .nav-sub { display: block; }
.nav-sub a { padding: 8px 12px; font-size: 13px; }

.side-foot {
  padding: 12px 14px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.side-foot .ghost {
  display: block; text-align: center; padding: 8px; border-radius: var(--radius);
  background: #f4f7fd; color: var(--txt2); font-size: 12.5px; text-decoration: none;
}
.side-foot .ghost:hover { background: #e9f0fd; color: var(--blue); text-decoration: none; }
.who { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--dim); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 16px 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 16px; font-weight: 600; }
.topbar-right { color: var(--dim); font-size: 12.5px; }

.content { padding: 18px 24px 48px; display: flex; flex-direction: column; gap: 14px; }

/* ---------------- 卡片 ---------------- */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px;
}
.panel h2 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.panel h2 .dim { font-weight: 400; font-size: 12.5px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.panel-head h2 { margin-bottom: 0; }

/* 统计卡 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.cards.small { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 15px 17px;
}
.stat .k { color: var(--dim); font-size: 12.5px; margin-bottom: 6px; }
.stat .v { font-size: 23px; font-weight: 600; line-height: 1.2; }
.stat .v.small { font-size: 16px; padding: 4px 0; }
.stat .s { color: var(--dim); font-size: 11.5px; margin-top: 6px; }
.stat.good { border-color: #cdeadd; background: linear-gradient(180deg, #f7fdfa, #fff); }
.stat.good .v { color: var(--green); }
.stat.warn { border-color: #f6e3c4; background: linear-gradient(180deg, #fffcf6, #fff); }
.stat.warn .v { color: var(--orange); }

.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

/* 图表 */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-top: 6px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar {
  width: 100%; max-width: 26px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #6fa4ff, #2a6ff0); min-height: 2px; transition: height .3s;
}
.bar-lb { font-size: 10px; color: var(--dim); }
.bar-v { font-size: 10px; color: #99a3b5; height: 12px; }
.bar-wrap:hover .bar { filter: brightness(1.12); }

.kv {
  display: flex; justify-content: space-between; padding: 7px 0;
  border-bottom: 1px solid #f2f5fa; font-size: 13px;
}
.kv:last-child { border-bottom: none; }
.kv span { color: var(--txt2); }

/* ---------------- 表格 ---------------- */
.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.tb th {
  text-align: left; padding: 11px 12px; background: #f7f9fc;
  color: var(--txt2); font-weight: 500; font-size: 12.5px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tb th:first-child { border-radius: 6px 0 0 0; }
.tb th:last-child { border-radius: 0 6px 0 0; }
.tb td { padding: 11px 12px; border-bottom: 1px solid #f2f5fa; vertical-align: middle; }
.tb tbody tr:hover td { background: #fafcff; }
.tb .sel { cursor: pointer; }
.tb .sel:hover { color: var(--green); }
.tb input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.ops { white-space: nowrap; }
.ops .inline + .inline { margin-left: 4px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #eef2f8; color: var(--txt2); font-size: 11.5px;
}
.tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-orange { background: var(--orange-bg); color: var(--orange); }
.tag-admin { background: var(--orange-bg); color: var(--orange); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 5px; font-size: 12px; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.bad { background: var(--red-bg); color: var(--red); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid var(--line2); background: #fff; color: var(--txt2);
  font-size: 13px; font-family: inherit; cursor: pointer; transition: all .14s;
  text-decoration: none;
}
.btn:hover { border-color: #b9c6dd; color: var(--txt); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1f5fd8; border-color: #1f5fd8; color: #fff; }
.btn.blue   { border-color: #b9d2ff; color: var(--blue); background: var(--blue-bg); }
.btn.blue:hover { background: #dfeaff; }
.btn.green  { border-color: #b8e4cf; color: var(--green); background: var(--green-bg); }
.btn.green:hover { background: #d9f2e6; }
.btn.red    { border-color: #f6c9ca; color: var(--red); background: var(--red-bg); }
.btn.red:hover { background: #fbdcdc; }
.btn.orange { border-color: #f2ddb8; color: var(--orange); background: var(--orange-bg); }
.btn.orange:hover { background: #fbeccf; }
.btn.danger { border-color: #f6c9ca; color: var(--red); background: #fff; }
.btn.danger:hover { background: var(--red-bg); }

.mini {
  padding: 4px 10px; border-radius: 5px; border: 1px solid var(--line2);
  background: #fff; color: var(--txt2); font-size: 12px; font-family: inherit; cursor: pointer;
}
.mini:hover { border-color: #b9c6dd; color: var(--txt); }
.mini.danger { border-color: #f6c9ca; color: var(--red); }
.mini.danger:hover { background: var(--red-bg); }

/* 表格里的纯文字操作按钮（跟参考后台一样） */
.mini.link-blue, .mini.link-red, .mini.link-green, .mini.link-orange {
  border: none; background: none; padding: 2px 3px; font-size: 12.5px;
}
.mini.link-blue:hover, .mini.link-red:hover, .mini.link-green:hover, .mini.link-orange:hover {
  background: none; text-decoration: underline;
}
.mini.link-blue   { color: var(--blue); }
.mini.link-red    { color: var(--red); }
.mini.link-green  { color: var(--green); }
.mini.link-orange { color: var(--orange); }
.ops .mini.link-blue + .mini, .ops .mini + form.inline + .mini { margin-left: 6px; }

.acts { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* ---------------- 表单 ---------------- */
label { display: block; margin-bottom: 13px; color: var(--txt2); font-size: 12.5px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 8px 11px;
  border-radius: var(--radius); border: 1px solid var(--line2);
  background: #fff; color: var(--txt); font-family: inherit; font-size: 13px;
  outline: none; transition: border-color .14s, box-shadow .14s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42,111,240,.1);
}
textarea { resize: vertical; line-height: 1.6; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
input[readonly] { background: #f7f9fc; color: var(--txt2); }

.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row label { margin-bottom: 0; flex: 0 0 auto; }
.form-row label.grow { flex: 1 1 200px; }
.form-row input, .form-row select { width: 140px; }
.form-row label.grow input { width: 100%; }

.filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter input, .filter select { margin-top: 0; width: auto; min-width: 140px; }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin-bottom: 16px; }
.switch input { display: none; }
.switch .sw {
  flex: 0 0 40px; width: 40px; height: 22px; border-radius: 11px; margin-top: 2px;
  background: #d5dbe6; position: relative; transition: background .18s;
}
.switch .sw::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: all .18s;
}
.switch input:checked + .sw { background: var(--blue); }
.switch input:checked + .sw::after { left: 20px; }
.sw-label b { display: block; color: var(--txt); font-size: 13.5px; font-weight: 500; }
.sw-label i { display: block; font-style: normal; color: var(--dim); font-size: 12px; margin-top: 2px; }

.codes {
  width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  background: #f8fbf8; border: 1px solid #cdeadd; border-radius: var(--radius);
  color: #1a7f52; padding: 12px; line-height: 1.8;
}
.panel.gen { border-color: #b8e4cf; background: linear-gradient(180deg, #f8fdfa, #fff); }

/* ---------------- 提示 ---------------- */
.flash, .msg {
  padding: 11px 15px; border-radius: var(--radius); line-height: 1.7;
  border: 1px solid transparent; margin-bottom: 14px; font-size: 13px;
}
.flash { margin: 14px 24px 0; }
.flash.ok, .msg.ok { background: var(--green-bg); border-color: #b8e4cf; color: #1a7f52; }
.flash.err, .msg.err { background: var(--red-bg); border-color: #f6c9ca; color: #b8302f; }
.flash.warn, .msg.warn { background: var(--orange-bg); border-color: #f2ddb8; color: #9a6212; }
.msg code { background: rgba(0,0,0,.06); color: inherit; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 6px; margin-top: 15px; flex-wrap: wrap; }
.pager a {
  padding: 5px 11px; border-radius: 6px; border: 1px solid var(--line2);
  background: #fff; color: var(--txt2); font-size: 12.5px; text-decoration: none;
}
.pager a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pager a.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.42);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(15,23,42,.2);
}
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 14.5px; font-weight: 600; }
.modal-head .x { cursor: pointer; color: var(--dim); font-size: 18px; line-height: 1; background: none; border: none; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 9px;
}

/* ---------------- 登录页 ---------------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
  background: linear-gradient(135deg, #eef4ff 0%, #f7f9fc 55%, #eaf0fd 100%);
}
.login-card {
  width: 100%; max-width: 380px; background: #fff;
  border-radius: 14px; padding: 34px 30px;
  box-shadow: 0 12px 40px rgba(31,41,55,.1);
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-head .logo.big {
  width: 50px; height: 50px; margin: 0 auto 13px; border-radius: 13px;
  background: linear-gradient(135deg, #4d8dff, #2a6ff0);
  display: flex; align-items: center; justify-content: center; font-size: 25px; color: #fff;
}
.login-head h1 { font-size: 17px; font-weight: 600; }
.login-head p { color: var(--dim); font-size: 12px; margin-top: 4px; }
.login-card label { margin-bottom: 14px; }
.login-card button[type=submit] {
  width: 100%; padding: 11px; margin-top: 4px; border: none; border-radius: var(--radius);
  background: var(--blue); color: #fff; font-size: 14.5px; font-family: inherit; cursor: pointer;
}
.login-card button[type=submit]:hover { background: #1f5fd8; }
.login-foot { text-align: center; margin-top: 18px; font-size: 12.5px; }

/* 必填星号 */
.req { color: #e5484d; margin-right: 3px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; overflow-x: auto; border-right: none;
    border-bottom: 1px solid var(--line); padding: 8px;
  }
  .brand { border: none; padding: 8px 12px; }
  .brand b { display: none; }
  .nav { display: flex; padding: 0; gap: 2px; }
  .nav a { white-space: nowrap; padding: 8px 12px; margin: 0; }
  .nav .ic { display: none; }
  .nav-group { margin: 0; }
  .nav-sub { display: none !important; }
  .side-foot { border: none; padding: 0 8px; flex-direction: row; align-items: center; }
  .side-foot .ghost, .who span { display: none; }
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .flash { margin-left: 14px; margin-right: 14px; }
  .ell { max-width: 130px; }
}
