/* 夸克网盘资源管理系统 - 全站样式（前台 + 后台） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.6; color: #1c1e21; background: #f7f8fa;
}
a { color: #2b87f0; text-decoration: none; }
a:hover { opacity: .88; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.ic { vertical-align: -2px; flex-shrink: 0; }

/* 按钮（前台） */
.btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid #dcdfe4; background: #fff; color: #333;
  border-radius: 8px; padding: 7px 16px; font-size: 13px; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.btn-line:hover { border-color: #2b87f0; color: #2b87f0; }
.btn-fill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid #2b87f0; background: #2b87f0; color: #fff;
  border-radius: 8px; padding: 7px 16px; font-size: 13px; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.btn-fill:hover { background: #1f6fd6; border-color: #1f6fd6; }

/* 基础按钮（后台 / 安装页） */
.btn {
  display: inline-block; border: 1px solid #dcdfe4; background: #fff; color: #444;
  border-radius: 8px; padding: 8px 18px; font-size: 14px; cursor: pointer; text-align: center;
  transition: all .15s;
}
.btn:hover { border-color: #2b87f0; color: #2b87f0; opacity: 1; }
.btn-primary { background: #2b87f0; border-color: #2b87f0; color: #fff; }
.btn-primary:hover { background: #1f6fd6; border-color: #1f6fd6; color: #fff; }
.btn-danger { color: #a32d2d; border-color: #e24b4a; }
.btn-danger:hover { background: #fcebeb; }
.btn-ghost { background: transparent; }
.btn-big { display: block; width: 100%; padding: 14px; font-size: 16px; margin: 16px 0 20px; }
.btn-block { display: block; width: 100%; margin-top: 20px; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.admin-main .panel h3, .panel-h3 { font-size: 15px; font-weight: 500; margin-bottom: 14px; }

/* ============ 前台：顶部栏 ============ */
.topbar { background: #fff; border-bottom: 1px solid #f0f1f3; position: sticky; top: 0; z-index: 50; }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; color: #1c1e21; white-space: nowrap; }
.search { position: relative; flex: 1; max-width: 460px; margin: 0 auto; }
.search .s-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9aa0a6; display: flex; }
.search input {
  width: 100%; border: none; outline: none; background: #f2f3f5; border-radius: 999px;
  padding: 9px 16px 9px 40px; font-size: 14px; color: #333;
}
.search input:focus { background: #eef1f5; box-shadow: 0 0 0 2px rgba(43,135,240,.18); }
.topnav { display: flex; gap: 20px; white-space: nowrap; }
.topnav a { color: #5f6368; font-size: 14px; }
.topnav a:hover { color: #2b87f0; opacity: 1; }

/* ============ 前台：蓝色数据横幅 ============ */
.hero { margin-top: 16px; }
.hero-inner {
  background: linear-gradient(120deg, #4aa0f5 0%, #1f7ce8 100%);
  border-radius: 14px; padding: 30px 36px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.hero-inner h1 { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.hero-inner .hero-sub { font-size: 14px; opacity: .92; margin-top: 8px; }
.hero-stats { display: flex; gap: 48px; }
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 28px; font-weight: 600; line-height: 1.2; }
.hero-stat span { font-size: 13px; opacity: .9; }

/* ============ 前台：布局（侧栏 + 主列表） ============ */
.home-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.side { background: #fff; border-radius: 12px; padding: 14px 12px; }
.side-title { font-size: 13px; color: #9aa0a6; padding: 6px 10px 8px; }
.side-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px;
  color: #333; font-size: 14px; margin-bottom: 2px;
}
.side-item:hover { background: #f5f6f8; opacity: 1; }
.side-item.active { background: #e8f3ff; color: #2b87f0; font-weight: 500; }
.side-item .side-count { margin-left: auto; font-size: 12px; color: #9aa0a6; }
.side-item.active .side-count { color: #2b87f0; }
.side-item .ell { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-empty { font-size: 13px; color: #b9bec5; padding: 6px 10px; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9d6e5; flex-shrink: 0; }
.side-item.active .cat-dot { background: #2b87f0; }

/* 投稿表单 */
.sub-fi { margin-bottom: 16px; }
.sub-fi label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #333; }
.sub-fi input {
  width: 100%; border: 1px solid #dcdfe4; border-radius: 8px; padding: 10px 14px;
  font-size: 14px; outline: none; background: #fff;
}
.sub-fi input:focus { border-color: #2b87f0; box-shadow: 0 0 0 2px rgba(43,135,240,.12); }
.sub-fi .fhint { font-size: 12px; color: #9aa0a6; margin-top: 4px; }

/* 投稿页（对齐资源获取页设计） */
.sub-main { max-width: 560px; }
.sub-lead { text-align: center; color: #9aa0a6; font-size: 13px; margin: -14px 0 20px; }
.sub-card { padding: 26px 28px 28px; }
.sub-form { margin-top: 18px; }
.sub-fi label i { color: #e24b4a; font-style: normal; }
.sub-fi input[type="number"] { -moz-appearance: textfield; }
.sub-go { display: flex; width: 100%; justify-content: center; margin-top: 8px; border: none; cursor: pointer; font-size: 15px; }

/* 链接失效反馈 */
.res-feedback {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #fff; border-radius: 12px; padding: 13px 16px; margin-top: 4px;
  font-size: 14px; font-weight: 500; color: #e24b4a; text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: background .15s;
}
.res-feedback:hover { background: #fff5f5; color: #c93333; }
.res-feedback .ic { flex-shrink: 0; }
.foot-link { color: #9aa0a6; }
.foot-link:hover { color: #2b87f0; }
.sub-fi textarea {
  width: 100%; border: 1px solid #dcdfe4; border-radius: 8px; padding: 10px 14px;
  font-size: 14px; outline: none; background: #fff; font-family: inherit; resize: vertical;
}
.sub-fi textarea:focus { border-color: #e8890c; box-shadow: 0 0 0 2px rgba(232,137,12,.12); }
.rep-target {
  margin-top: 14px; background: #fdf3e7; border: 1px solid #f3ddb8; color: #8a5a12;
  border-radius: 8px; padding: 9px 12px; font-size: 13px;
}
.sub-go-warn { background: #e8890c; }
.sub-go-warn:hover { background: #d07a08; opacity: 1; }

.panel { background: #fff; border-radius: 12px; padding: 6px 22px 16px; }
.list-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f0f1f3; padding: 12px 0 0; }
.list-head h2 { font-size: 16px; font-weight: 600; }
.vt { display: flex; gap: 18px; }
.vt span { color: #9aa0a6; font-size: 14px; cursor: pointer; padding-bottom: 10px; border-bottom: 2px solid transparent; }
.vt span.on { color: #2b87f0; border-bottom-color: #2b87f0; font-weight: 500; }

/* 列表视图 */
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid #f5f6f8; }
.row-item:last-child { border-bottom: none; }
.row-icon {
  width: 46px; height: 46px; border-radius: 12px; background: #e8f3ff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.row-info { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 500; color: #1c1e21; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; align-items: center; gap: 16px; color: #9aa0a6; font-size: 12px; margin-top: 6px; }
.row-meta span { display: inline-flex; align-items: center; gap: 4px; }
.row-code { font-family: Consolas, monospace; }
.row-btns { display: flex; gap: 10px; flex-shrink: 0; }

/* 网格视图 */
.rows.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rows.grid .row-item {
  border: 1px solid #eef0f2; border-radius: 12px; padding: 16px;
  flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 0;
}
.rows.grid .row-item:hover { border-color: #bcdcff; box-shadow: 0 2px 10px rgba(43,135,240,.08); }
.rows.grid .row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rows.grid .row-info { width: 100%; }
.rows.grid .row-btns { width: 100%; }
.rows.grid .row-btns .btn-line, .rows.grid .row-btns .btn-fill { flex: 1; padding: 7px 8px; }

.empty { text-align: center; color: #9aa0a6; padding: 80px 0; }
.pager { margin: 22px 0 6px; text-align: center; }
.pager a, .pager-cur { display: inline-block; min-width: 32px; padding: 4px 8px; margin: 0 3px;
  border: 1px solid #e3e5e8; border-radius: 6px; font-size: 13px; color: #5f6368; background: #fff; }
.pager a:hover { border-color: #2b87f0; color: #2b87f0; opacity: 1; }
.pager-cur { background: #2b87f0; color: #fff; border-color: #2b87f0; }
.front-footer { text-align: center; color: #9aa0a6; font-size: 12px; padding: 26px 16px 40px; }

/* ============ 前台：资源获取页 ============ */
.res-top { background: #fff; border-bottom: 1px solid #f0f1f3; text-align: center; padding: 16px 0 12px; }
.res-top h1 { font-size: 19px; font-weight: 600; }
.res-top .res-domain { font-size: 13px; color: #9aa0a6; margin-top: 2px; }
.res-main { max-width: 680px; margin: 0 auto; padding: 0 16px 46px; }
.res-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 34px 0 24px; }
.res-brand b { font-size: 26px; font-weight: 600; color: #2b87f0; }
.res-card { background: #fff; border-radius: 14px; padding: 24px 26px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card-h { font-size: 15px; font-weight: 600; border-left: 4px solid #2b87f0; padding-left: 9px; line-height: 1.25; }
.card-p { color: #5f6368; font-size: 14px; margin: 12px 0 20px; }
.res-go {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  max-width: 420px; margin: 0 auto; height: 48px; border-radius: 999px;
  background: #2b87f0; color: #fff; font-size: 15px; font-weight: 500;
  transition: background .15s;
}
.res-go:hover { background: #1f6fd6; opacity: 1; }
.res-url { background: #f2f3f5; border-radius: 10px; padding: 13px 16px; margin-top: 14px; }
.res-url input { width: 100%; border: none; outline: none; background: transparent; font-size: 14px; color: #2b87f0; }
.res-copy {
  display: flex; align-items: center; gap: 6px; margin: 18px auto 0;
  border: 1px solid #dcdfe4; border-radius: 999px; padding: 9px 30px;
  background: #fff; color: #333; font-size: 14px; cursor: pointer; transition: all .15s;
}
.res-copy:hover { border-color: #2b87f0; color: #2b87f0; }
.res-note { text-align: center; color: #9aa0a6; font-size: 13px; margin-top: 16px; }
.res-center { text-align: center; }

/* ============ 安装页 ============ */
.install-body { background: #f7f8fa; }
.install-wrap { max-width: 560px; margin: 50px auto; background: #fff; border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px; padding: 36px 32px; }
.install-wrap h1 { font-size: 20px; font-weight: 500; text-align: center; }
.install-sub { text-align: center; color: #888780; font-size: 13px; margin: 8px 0 20px; }
.install-h2 { font-size: 15px; font-weight: 500; margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,.08); }
.install-env { width: 100%; border-collapse: collapse; font-size: 13px; }
.install-env td { padding: 6px 4px; border-bottom: 1px dashed rgba(0,0,0,.08); }
.install-env td.ok { color: #3b6d11; }
.install-env td.bad { color: #a32d2d; }
.frow { margin-bottom: 14px; }
.frow label { display: block; font-size: 13px; margin-bottom: 5px; color: #444; }
.frow input { width: 100%; border: 1px solid #d3d1c7; border-radius: 8px; padding: 9px 12px; font-size: 14px; outline: none; }
.frow input:focus { border-color: #2b87f0; }
.fhint { display: block; font-size: 12px; color: #888780; margin-top: 3px; }
.install-err { background: #fcebeb; border: 1px solid #e24b4a; color: #791f1f; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.install-ok { text-align: center; padding: 20px 0; }
.install-btns { margin-top: 20px; display: flex; gap: 12px; justify-content: center; }

/* ============ 后台 ============ */
.admin-body { background: #f2f2ef; }
.admin-nav { background: #fff; border-bottom: 1px solid rgba(0,0,0,.08); }
.admin-nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-brand { font-weight: 500; color: #0c447c; margin-right: 16px; padding: 14px 0; }
.admin-nav a { padding: 14px 12px; display: inline-block; color: #444; font-size: 14px; }
.admin-nav a:hover { color: #185fa5; }
.admin-nav a.cur { color: #185fa5; border-bottom: 2px solid #185fa5; }
.admin-user { margin-left: auto; color: #888780; font-size: 13px; display: flex; align-items: center; gap: 10px; }

.admin-main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 50px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.admin-head h2 { font-size: 17px; font-weight: 500; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-actions .btn, .panel .btn, .filter-bar .btn { border: 1px solid #dcdfe4; background: #fff; color: #333; border-radius: 8px; padding: 8px 18px; font-size: 14px; cursor: pointer; }
.admin-actions .btn:hover, .panel .btn:hover { border-color: #2b87f0; color: #2b87f0; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; padding: 18px; text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 500; color: #2b87f0; }
.stat-card .lab { font-size: 13px; color: #888780; margin-top: 4px; }

.panel-h3 { font-size: 15px; font-weight: 500; margin-bottom: 14px; }
.admin-main .panel { background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; padding: 18px; margin-bottom: 18px; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar input[type=text] { border: 1px solid #d3d1c7; border-radius: 8px; padding: 7px 12px; font-size: 13px; width: 240px; outline: none; }
.filter-bar select { border: 1px solid #d3d1c7; border-radius: 8px; padding: 7px 10px; font-size: 13px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.tbl th, table.tbl td { padding: 10px 10px; border-bottom: 1px solid rgba(0,0,0,.07); text-align: left; vertical-align: middle; }
table.tbl th { color: #888780; font-weight: 400; background: #fafaf8; white-space: nowrap; }
table.tbl tr:hover td { background: #fafaf8; }
.td-code { font-family: Consolas, monospace; }
.td-url { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5f5e5a; }
.tag { display: inline-block; font-size: 12px; padding: 1px 10px; border-radius: 10px; }
.tag-on { background: #eaf3de; color: #3b6d11; }
.tag-off { background: #fcebeb; color: #a32d2d; }
.tag-amber { background: #fdf3e0; color: #8a5a00; }
.cs-0 { background: #f1efe8; color: #888780; }
.cs-1 { background: #eaf3de; color: #3b6d11; }
.cs-2 { background: #fcebeb; color: #a32d2d; }
.cs-3 { background: #fdf3e0; color: #8a5a00; }
.op-btns { white-space: nowrap; }
.op-btns form { display: inline-block; margin-left: 4px; }
.op-btns .btn { padding: 4px 10px !important; font-size: 12px !important; border-radius: 6px !important; }
.btn-danger { color: #a32d2d; border-color: #e24b4a !important; }
.btn-danger:hover { background: #fcebeb; }

details.fold { background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; margin-bottom: 18px; }
details.fold > summary { cursor: pointer; padding: 14px 18px; font-weight: 500; font-size: 14px; list-style: none; }
details.fold > summary::before { content: "+ "; color: #2b87f0; }
details.fold[open] > summary::before { content: "− "; }
details.fold .fold-body { padding: 0 18px 18px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.fi label { display: block; font-size: 13px; margin-bottom: 5px; color: #444; }
.fi input[type=text], .fi input[type=password], .fi input[type=url], .fi textarea, .fi select {
  width: 100%; border: 1px solid #d3d1c7; border-radius: 8px; padding: 9px 12px; font-size: 14px; outline: none; font-family: inherit;
}
.fi input:focus, .fi textarea:focus { border-color: #2b87f0; }
.fi textarea { min-height: 120px; resize: vertical; }
.fhint { font-size: 12px; color: #888780; margin-top: 3px; }

.trend { display: flex; align-items: flex-end; gap: 14px; height: 160px; padding: 10px 4px 0; }
.trend .bar-item { flex: 1; text-align: center; }
.trend .bar { background: #85b7eb; border-radius: 4px 4px 0 0; margin: 0 auto; width: 60%; min-height: 4px; }
.trend .bar-num { font-size: 12px; color: #444; margin-bottom: 4px; }
.trend .bar-day { font-size: 12px; color: #888780; margin-top: 6px; }

.rank-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(0,0,0,.07); font-size: 13px; }
.rank-no { width: 22px; height: 22px; border-radius: 50%; background: #e8f3ff; color: #2b87f0; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-num { color: #888780; }

.alert-ok { background: #eaf3de; border: 1px solid #97c459; color: #27500a; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.muted { color: #888780; font-size: 12px; }

@media (max-width: 800px) {
  .home-layout { grid-template-columns: 1fr; }
  .hero-inner { padding: 24px; }
  .hero-stats { gap: 30px; }
  .row-btns .btn-line span, .row-btns .btn-fill span { display: none; }
  .td-url { max-width: 140px; }
  table.tbl th:nth-child(5), table.tbl td:nth-child(5) { display: none; }
  .search { max-width: none; }
  .topnav { display: none; }
}
