/* ============ 基础 ============ */
:root {
  --primary: #6c5ce7;
  --primary-dark: #5549d6;
  --primary-soft: #efeaff;
  --gold: #f5a623;
  --gold-soft: #fff4e0;
  --danger: #e74c3c;
  --success: #00b894;
  --text: #1f2430;
  --text-2: #5b6472;
  --text-3: #98a1b0;
  --border: #e8eaf0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 36, 48, 0.06);
  --shadow-lg: 0 12px 32px rgba(31, 36, 48, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 700; line-height: 1.35; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.logo-mark { font-size: 20px; }
.logo-text { background: linear-gradient(90deg, #6c5ce7, #e84393); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 500;
  transition: .18s;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.search { flex: 1; max-width: 320px; display: flex; position: relative; }
.search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 40px 0 16px;
  background: var(--bg);
  outline: none;
  transition: .18s;
}
.search input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search button {
  position: absolute;
  right: 4px; top: 3px;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: transparent; cursor: pointer;
}

.user-area { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  border: 1px solid transparent;
  transition: .18s;
}
.avatar-chip:hover { border-color: var(--border); }
.avatar-face {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-soft);
  display: grid; place-items: center; font-size: 15px;
}
.user-menu { position: relative; }
.dropdown {
  position: absolute; right: 0; top: 44px;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 60;
}
.dropdown .dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px; border: 0; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--text);
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 18px;
  border: 1px solid var(--border);
  background: #fff; color: var(--text);
  border-radius: 10px; cursor: pointer; font-weight: 500;
  transition: .18s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-gold { background: linear-gradient(135deg, #f7b733, #f5a623); border: 0; color: #4a3100; font-weight: 700; }
.btn-gold:hover { filter: brightness(1.05); color: #4a3100; }
.btn-danger { color: var(--danger); border-color: #f5c6c0; }
.btn-danger:hover { background: #fdecea; color: var(--danger); border-color: var(--danger); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 18px;
}
.badge-free { background: #eef0f4; color: #7b8493; }
/* 卡片统一角标：会员内容一律显示 VIP */
.badge-vip { background: linear-gradient(135deg, #ffe6a7, #f5c542); color: #6b4b00; font-weight: 600; }
.badge-l1 { background: linear-gradient(135deg, #dfe9ff, #a8c6ff); color: #1d3f8f; }
.badge-l2 { background: linear-gradient(135deg, #ffe6a7, #f5c542); color: #6b4b00; }
.badge-l3 { background: linear-gradient(135deg, #d7f5ec, #4fe0b6); color: #04604a; }
.badge-l4 { background: linear-gradient(135deg, #ffd0e8, #e84393); color: #fff; }
.badge-pan { background: #eaf2ff; color: #2d6cdf; }
/* 订单状态 */
.badge-paid { background: #e6f9f1; color: #057e4f; }
.badge-pending { background: #fff6e0; color: #a26700; }

/* 网盘资源卡片 */
.pan-card { margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.pan-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: linear-gradient(90deg, #f7f8ff, #fff); }
.pan-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.pan-body { padding: 18px; }
.pan-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.pan-row .k { width: 82px; flex: none; color: var(--text-2); font-size: 13px; }
.pan-row .val { font-family: ui-monospace, Consolas, Menlo, monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; flex: 1; min-width: 200px; word-break: break-all; }
.pan-row .copy { flex: none; }
.pan-lock { padding: 22px; text-align: center; background: #fbfbff; }
.pan-quota { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }

/* ===== 多网盘资源 ===== */
.pan-names {
  display: inline-block; text-align: left; margin: 0 0 12px; padding-left: 20px;
  font-size: 13px; color: var(--text-2); line-height: 1.9;
}
.pan-item {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 12px; background: #fcfcff;
}
.pan-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pan-seq {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none;
}
.pan-item-name { font-weight: 600; font-size: 14px; flex: 1; min-width: 140px; }
.pan-row .val.code { font-weight: 700; letter-spacing: 1px; }
.pan-pending { margin-top: 14px; border: 1px dashed var(--border); border-radius: 10px; padding: 12px 14px; }
.pan-pending-head { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.pan-pending-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px;
}
.pan-pending-row:first-of-type { border-top: 0; }
.quota-bar { width: 120px; height: 6px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.quota-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #6c5ce7, #e84393); }

/* ============ 通用块 ============ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { margin: 26px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.page { padding: 22px 0 60px; min-height: 60vh; }

.empty { padding: 60px 20px; text-align: center; color: var(--text-3); }
.empty .icon { font-size: 42px; display: block; margin-bottom: 10px; }

/* ============ Hero ============ */
.hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  padding: 42px 38px;
  color: #fff;
  margin-top: 20px;
  background: linear-gradient(120deg, #5b4bd6 0%, #8e6ff0 45%, #e84393 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.25), transparent 55%);
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 30px; margin-bottom: 10px; }
.hero p { margin: 0 0 20px; opacity: .92; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { height: 42px; }
.hero .btn-outline { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.28); color: #fff; border-color: #fff; }

/* ============ 分类 Tabs ============ */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 16px; }
.tab {
  padding: 7px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  cursor: pointer; color: var(--text-2); transition: .18s;
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
select, .input {
  height: 36px; border: 1px solid var(--border); border-radius: 9px;
  padding: 0 10px; background: #fff; color: var(--text); outline: none;
}
.input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { height: auto; padding: 10px; min-height: 84px; width: 100%; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.field .input { width: 100%; }

/* ============ 视频卡片 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.vcard { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: .2s; cursor: pointer; }
.vcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d9d5f7; }
.vcover {
  position: relative; aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  color: #fff; font-size: 34px;
}
.vcover .glass {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.22));
}
.vcover .play {
  opacity: 0; transform: scale(.85); transition: .2s;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0,0,0,.45); display: grid; place-items: center;
  font-size: 18px; position: relative;
}
.vcard:hover .play { opacity: 1; transform: scale(1); }
.vcover .duration {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.65); color: #fff;
  padding: 1px 6px; border-radius: 5px; font-size: 11px;
}
.vcover .lock {
  position: absolute; left: 8px; top: 8px;
}
/* 缩略图：铺满封面，加载失败时由 onerror 隐藏，露出底层渐变 */
.vcover .thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.vcover .pan-tip {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0,0,0,.65); color: #fff;
  padding: 1px 7px; border-radius: 5px; font-size: 11px;
}
.vbody { padding: 11px 12px 13px; }
.vtitle {
  font-weight: 600; font-size: 14px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 40px;
}
.vmeta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-3); }

/* ============ 播放页 ============ */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; margin-top: 20px; }
.player-box {
  background: #000; border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 16/9;
}
.player-box video { width: 100%; height: 100%; display: block; background: #000; }
.player-mask {
  position: absolute; inset: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(15,12,35,.75), rgba(15,12,35,.94));
  color: #fff; display: grid; place-items: center; text-align: center; padding: 30px;
}
.player-mask .box { max-width: 460px; }
.player-mask h3 { font-size: 20px; margin-bottom: 8px; }
.player-mask p { opacity: .85; margin-bottom: 18px; }
.player-mask .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.info-title { font-size: 20px; font-weight: 700; margin: 16px 0 6px; }
.info-meta { display: flex; gap: 14px; color: var(--text-3); font-size: 13px; align-items: center; flex-wrap: wrap; }
.info-desc { margin-top: 12px; color: var(--text-2); line-height: 1.8; }
.info-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 2px 9px; background: var(--bg); border-radius: 6px; font-size: 12px; color: var(--text-2); margin-right: 6px; }

.side-title { font-weight: 700; margin-bottom: 12px; font-size: 15px; }
.mini-list { display: flex; flex-direction: column; gap: 12px; }
.mini { display: flex; gap: 10px; cursor: pointer; }
.mini .mini-cover {
  width: 116px; aspect-ratio: 16/10; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 20px; position: relative;
}
.mini .mini-cover .dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.6); font-size: 10px; padding: 0 4px; border-radius: 4px; }
.mini .mini-title { font-size: 13px; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini .mini-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ============ 会员 ============ */
.member-hero {
  background: linear-gradient(120deg, #2b2440 0%, #4b3a72 60%, #7d5ba6 100%);
  color: #fff; border-radius: 18px; padding: 30px 28px; margin-top: 20px;
}
.member-hero .row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.member-hero h1 { margin: 0 0 6px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.plan {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; padding: 20px; transition: .2s;
}
.plan:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.plan.recommended { border-color: var(--gold); box-shadow: 0 6px 22px rgba(245,166,35,.18); }
.plan .ribbon {
  position: absolute; top: -10px; right: 14px;
  background: var(--gold); color: #4a3100; font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
}
.plan .name { font-weight: 700; font-size: 16px; }
.plan .price { font-size: 30px; font-weight: 800; margin: 10px 0 2px; }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--text-3); }
.plan .origin { text-decoration: line-through; color: var(--text-3); font-size: 13px; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 18px; }
.plan li { padding: 5px 0 5px 20px; position: relative; color: var(--text-2); font-size: 13px; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }

.pay-methods { display: grid; gap: 10px; margin: 16px 0; }
.pay-method {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: .18s;
}
.pay-method.active { border-color: var(--primary); background: var(--primary-soft); }
.pay-method .ico { font-size: 20px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafbfe; font-weight: 600; color: var(--text-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcff; }

/* ============ 统计卡 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 20px 0; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .label { color: var(--text-3); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; }

/* ============ 个人中心 ============ */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 22px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 20px; }
.profile-head .face { width: 62px; height: 62px; border-radius: 50%; background: var(--primary-soft); display: grid; place-items: center; font-size: 30px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { padding: 8px 16px; border: 0; background: transparent; cursor: pointer; color: var(--text-2); }
.seg button.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ============ 登录 ============ */
.auth-wrap { max-width: 400px; margin: 46px auto; }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.auth-card h1 { text-align: center; margin-bottom: 22px; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--text-2); }
.auth-switch a { color: var(--primary); font-weight: 600; cursor: pointer; }
.demo-tip { margin-top: 16px; padding: 10px 12px; background: var(--bg); border-radius: 10px; font-size: 12px; color: var(--text-2); }

/* ============ Toast / Modal ============ */
.toast {
  position: fixed; left: 50%; top: 74px; transform: translate(-50%, -16px);
  background: rgba(31, 36, 48, .94); color: #fff;
  padding: 10px 20px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 999;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 22, 32, .5);
  display: grid; place-items: center; z-index: 200; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: min(560px, 100%);
  max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg);
}
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.close-x { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--text-3); line-height: 1; }

/* ============ 响应式 ============ */
@media (max-width: 980px) {
  .player-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .search { order: 3; max-width: none; width: 100%; }
  .nav { order: 2; }
  .user-area { order: 1; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 23px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .container { padding: 0 14px; }
}
