/* ===== 深爱办公插件网 全局样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #f5f6fa; color: #333; min-height: 100vh;
}
a { color: #3b6fd4; text-decoration: none; }

/* 顶栏 */
.topbar {
  background: #fff; border-bottom: 1px solid #e6e8ee;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 58px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.brand { font-size: 20px; font-weight: 700; color: #2f54eb; display: flex; align-items: center; gap: 8px; }
.brand a { color: inherit; }
.brand .logo { font-size: 24px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.btn {
  display: inline-block; padding: 7px 16px; border-radius: 6px; border: 1px solid transparent;
  cursor: pointer; font-size: 14px; transition: .15s; text-align: center;
}
.btn-primary { background: #2f54eb; color: #fff; }
.btn-primary:hover { background: #2546c8; }
.btn-outline { background: #fff; border-color: #d0d4dd; color: #555; }
.btn-outline:hover { border-color: #2f54eb; color: #2f54eb; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
/* 禁用态（如「本版本已试用」）：灰化且不可点 */
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.user-chip { background: #eef2ff; color: #2f54eb; padding: 6px 12px; border-radius: 20px; font-size: 13px; }

.container { max-width: 1080px; margin: 24px auto; padding: 0 16px; }

/* 卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: #fff; border: 1px solid #e6e8ee; border-radius: 10px; padding: 20px;
  display: flex; flex-direction: column; transition: .15s;
}
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: #c9d4f5; }
.card h3 { font-size: 17px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.card .ver { color: #999; font-size: 12px; font-weight: 400; }
.card .desc { color: #666; font-size: 13px; line-height: 1.5; flex: 1; margin: 8px 0 14px; }
.card .meta { color: #bbb; font-size: 12px; margin-bottom: 12px; }
.card .actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .price { color: #e0482e; font-weight: 700; font-size: 15px; margin-left: 8px; }

/* 表格（订单/管理后台）*/
.table-wrap { background: #fff; border: 1px solid #e6e8ee; border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th, table.list td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f1f5; }
table.list th { background: #f7f8fc; font-weight: 600; color: #444; white-space: nowrap; }
table.list tr:hover td { background: #fafbff; }
.st-ok { color: #389e0d; font-weight: 600; }
.st-pending { color: #d48806; font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select, .toolbar button { padding: 7px 10px; border: 1px solid #d0d4dd; border-radius: 6px; font-size: 13px; }
.toolbar input:focus, .toolbar select:focus { border-color: #2f54eb; outline: none; }
.secure-note { color: #bf5122; font-size: 12px; }

/* 权限彩标 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; color: #fff; }
.badge-trial { background: #9aa3ad; }
.badge-standard { background: #2f6beb; }
.badge-premium { background: #c8921a; }
.badge-lifetime { background: #7b3ff0; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px 0; font-size: 14px; color: #666; }
.pagination button { min-width: 64px; }

/* 表单页 */
.auth-wrap { max-width: 420px; margin: 60px auto; background: #fff; border: 1px solid #e6e8ee; border-radius: 10px; padding: 28px; }
.auth-wrap h2 { text-align: center; margin-bottom: 18px; font-size: 20px; }
.tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid #eee; }
.tab { flex: 1; text-align: center; padding: 10px 0; cursor: pointer; color: #888; border-bottom: 2px solid transparent; }
.tab.active { color: #2f54eb; border-bottom-color: #2f54eb; font-weight: 600; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-item input {
  width: 100%; padding: 10px 12px; border: 1px solid #d0d4dd; border-radius: 6px; font-size: 14px; outline: none;
}
.form-item input:focus { border-color: #2f54eb; }
.btn-block { width: 100%; padding: 10px; font-size: 15px; }
.divider { display: flex; align-items: center; margin: 18px 0; color: #aaa; font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #eee; }
.divider span { padding: 0 10px; }
.msg { text-align: center; font-size: 13px; padding: 8px 0; display: none; }
.msg.error { color: #d4380d; }
.msg.ok { color: #389e0d; }

/* 微信扫码区 */
.wechat-box { text-align: center; border: 1px dashed #d0d4dd; border-radius: 8px; padding: 20px; margin-top: 12px; }
.wechat-box .qr { font-size: 110px; line-height: 1; margin: 4px 0 8px; color: #4caf50; }
.wechat-box p { font-size: 13px; color: #666; margin: 4px 0; }
.wechat-status { font-size: 13px; margin-top: 8px; color: #2f54eb; min-height: 18px; }

/* 我的权限 */
.perm-list { display: flex; flex-direction: column; gap: 12px; }
.perm-row {
  background: #fff; border: 1px solid #e6e8ee; border-radius: 8px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.perm-row .p-name { font-weight: 600; font-size: 15px; }
.perm-row .p-date { color: #888; font-size: 13px; }
.perm-row .left { display: flex; align-items: center; gap: 12px; }
.empty { text-align: center; color: #999; padding: 60px 0; }
.page-title { font-size: 22px; margin-bottom: 18px; }

/* ===== WPS 内嵌紧凑布局（body.wps-embed，任务窗格打开） ===== */
body.wps-embed { background: #fff; }
body.wps-embed .topbar {
  height: 42px; padding: 0 10px; box-shadow: none;
}
body.wps-embed .brand { font-size: 15px; }
body.wps-embed .brand .logo { font-size: 18px; }
body.wps-embed .topbar-actions { gap: 6px; }
body.wps-embed .btn { padding: 3px 8px; font-size: 12px; border-radius: 4px; }
body.wps-embed .btn-sm { padding: 2px 7px; font-size: 12px; }
body.wps-embed .user-chip { padding: 3px 8px; font-size: 11px; }
body.wps-embed .container { max-width: none; margin: 10px auto; padding: 0 8px; }
body.wps-embed .grid { grid-template-columns: 1fr; gap: 8px; }
body.wps-embed .card { padding: 10px 12px; border-radius: 6px; }
body.wps-embed .card h3 { font-size: 14px; margin-bottom: 4px; }
body.wps-embed .card .desc { font-size: 12px; margin: 4px 0 8px; }
body.wps-embed .card .meta { font-size: 11px; margin-bottom: 6px; }
body.wps-embed .card .price { font-size: 13px; }
body.wps-embed .pagination { margin: 10px 0; font-size: 12px; }
body.wps-embed .pagination button { min-width: 52px; font-size: 12px; padding: 2px 8px; }
body.wps-embed .auth-wrap { margin: 20px auto; padding: 16px; }
body.wps-embed .auth-wrap h2 { font-size: 16px; margin-bottom: 12px; }
body.wps-embed .form-item input { padding: 7px 9px; font-size: 13px; }
body.wps-embed table.list th, body.wps-embed table.list td { padding: 7px 8px; font-size: 12px; }
body.wps-embed .page-title { font-size: 16px; margin-bottom: 10px; }
body.wps-embed .tab { padding: 7px 0; font-size: 13px; }
body.wps-embed .toolbar { margin-bottom: 8px; }
body.wps-embed .toolbar input, body.wps-embed .toolbar select, body.wps-embed .toolbar button { padding: 4px 7px; font-size: 12px; }
body.wps-embed .perm-row { padding: 9px 12px; }
body.wps-embed .perm-row .p-name { font-size: 13px; }
body.wps-embed .perm-row .p-date { font-size: 12px; }
body.wps-embed .perm-list { gap: 8px; }
/* 顶栏快捷按钮在窄屏下精简：隐藏不必要的次要入口，仅保留核心 */
body.wps-embed .topbar-actions .opt-hide { display: none; }

/* ===== 档位体系：通用元素 ===== */
.ver { color: #999; font-size: 12px; font-weight: 400; }
s, .strike { color: #999; font-weight: 400; text-decoration: line-through; }
.price-now { color: #e0482e; }
.muted { color: #bbb; }
.discount-period { color: #c8921a; font-size: 13px; margin: 0 0 10px; }
.discount-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 4px;
  background: linear-gradient(135deg, #ff7a45, #e0482e); color: #fff; font-size: 11px; font-weight: 600;
}
.dur-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: #f0f1f5; color: #666; font-size: 12px; vertical-align: middle;
}
.period-text { color: #888; font-size: 12px; }

/* 卡片：价格行 + 档位小标签 */
.card-price-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.lv-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 10px; border: 1px solid transparent; font-size: 12px; line-height: 1.6;
}
.lv-tag em { font-style: normal; opacity: .72; }
.lv-tag.badge-trial { background: #f1f2f4; color: #606874; border-color: #e2e4e9; }
.lv-tag.badge-standard { background: #eef3ff; color: #2f6beb; border-color: #d6e0fb; }
.lv-tag.badge-premium { background: #fdf5e3; color: #a5771a; border-color: #f2e2bd; }
.lv-tag.badge-lifetime { background: #f4edff; color: #7b3ff0; border-color: #e4d6fb; }

/* 我的权限：已过期 */
.perm-row.expired { background: #fff8f7; border-color: #f6c7c0; }
.perm-row.expired .p-name { color: #a8a8a8; }
.expired-tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: #fdecea; color: #d4380d; border: 1px solid #f6c7c0; font-size: 12px;
}

/* 管理后台：定价输入 */
.price-input {
  width: 100%; min-width: 92px; max-width: 150px; padding: 5px 7px;
  border: 1px solid #d0d4dd; border-radius: 5px; font-size: 12px; outline: none;
}
.price-input:focus { border-color: #2f54eb; }
.price-input-sm { min-width: 62px; max-width: 80px; }
.payable-cell { color: #666; min-width: 170px; white-space: normal; }

/* 管理后台：表单控件扩展（下拉 / 多行文本 / 勾选） */
.form-item select, .form-item textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d0d4dd; border-radius: 6px;
  font-size: 14px; font-family: inherit; outline: none;
}
.form-item select:focus, .form-item textarea:focus { border-color: #2f54eb; }
.form-item textarea { line-height: 1.5; resize: vertical; }
.form-item input[type="checkbox"] { width: auto; }

/* ===== 档位选择弹层（index.html，纯前端自绘） ===== */
.level-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.level-modal[hidden] { display: none; }
.level-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.level-modal-card {
  position: relative; background: #fff; border-radius: 12px; padding: 20px 22px;
  width: min(880px, 92vw); max-height: 88vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
}
.level-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.level-modal-head h3 { font-size: 18px; }
.level-modal-close {
  border: none; background: transparent; color: #999; font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.level-modal-close:hover { background: #f2f3f7; color: #333; }
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.level-card {
  border: 1px solid #e6e8ee; border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; transition: .15s;
}
.level-card:hover { border-color: #c9d4f5; box-shadow: 0 4px 14px rgba(0, 0, 0, .06); }
.level-card-head { display: flex; align-items: center; gap: 8px; }
.level-card-price { color: #e0482e; font-weight: 700; font-size: 18px; }
.level-card-price s { font-size: 13px; }
.level-caps { list-style: none; margin: 0; padding: 0; flex: 1; }
.level-caps li { position: relative; padding: 3px 0 3px 14px; font-size: 12px; color: #666; }
.level-caps li::before { content: "·"; position: absolute; left: 4px; color: #2f54eb; font-weight: 700; }
.level-pick { width: 100%; margin-top: 6px; }

@media (max-width: 760px) {
  .level-grid { grid-template-columns: repeat(2, 1fr); }
}

/* WPS 内嵌紧凑模式 */
body.wps-embed .lv-tags { gap: 4px; margin: 4px 0 2px; }
body.wps-embed .lv-tag { font-size: 11px; padding: 1px 6px; }
body.wps-embed .dur-badge { font-size: 11px; }
body.wps-embed .level-modal-card { padding: 12px; border-radius: 8px; width: 96vw; max-height: 92vh; }
body.wps-embed .level-modal-head h3 { font-size: 14px; }
body.wps-embed .level-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
body.wps-embed .level-card { padding: 10px; gap: 5px; }

/* ===== 分栏布局组件（站点通用：左栏＝搜索 + 清单；右栏＝内容） ===== */
.split { display: grid; grid-template-columns: 302px minmax(0, 1fr); gap: 16px; align-items: start; }
.split-side { background: #fff; border: 1px solid #e6e8ee; border-radius: 12px; padding: 12px; }
.split-main { overflow-y: auto; max-height: calc(100vh - 176px); padding-right: 4px; }

.side-search { display: flex; gap: 6px; }
.side-search input {
  flex: 1 1 auto; min-width: 0; height: 32px; border: 1px solid #dfe3ea; border-radius: 8px;
  padding: 0 10px; font-size: 13px; font-family: inherit; color: #333; background: #fbfcfe; outline: none;
}
.side-search input:focus { border-color: #3b6fd4; background: #fff; }
.side-btns { display: flex; gap: 6px; margin-top: 8px; }
.side-btns .btn { flex: 1 1 0; justify-content: center; height: 30px; padding: 0 6px; font-size: 13px; }
.side-hint { font-size: 12px; color: #8a8f99; margin-top: 10px; }
.side-hint b { color: #3b6fd4; }
.side-list { position: relative; list-style: none; margin: 8px 0 0; padding: 0; overflow-y: auto; max-height: calc(100vh - 306px); min-height: 180px; }
.side-item { padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.side-item:hover { background: #f5f8fd; }
.side-item.active { background: #eef4ff; }
.side-item .n { display: block; font-family: Consolas, Monaco, monospace; font-size: 12.5px; font-weight: 600; color: #3b6fd4; word-break: break-all; }
.side-item .t { display: block; font-size: 12px; color: #777; margin-top: 1px; }
.side-item.active .n { color: #1f4fa8; }
.side-empty { color: #999; font-size: 13px; padding: 10px 4px; }
.side-extra { border-top: 1px dashed #e8ecf3; margin-top: 8px; padding-top: 8px; }
.side-extra a { font-size: 12.5px; }

/* ===== 固定底栏（默认隐藏；鼠标接近视口底部 / 滚动到页底 → 自动弹出；无过渡动画） ===== */
body.has-site-footer { padding-bottom: 46px; }
.site-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #23272f; color: #c8cdd6; font-size: 12.5px;
  visibility: hidden; transform: translateY(100%);
}
.site-footer.is-open { visibility: visible; transform: none; }
.site-footer-in {
  max-width: 1320px; margin: 0 auto; padding: 0 16px; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.site-footer .sf-left, .site-footer .sf-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.site-footer .sf-sep { color: #4a505c; }
.site-footer a { color: #9fb6e8; }
.site-footer a:hover { color: #c9d8f7; }
.site-footer .sf-dim { color: #8b929e; }

/* ===== 宿主一键安装区块（首页长期置顶：不参与搜索/分页过滤，样式通用） ===== */
.host-banner {
  background: linear-gradient(180deg, #f7faff, #fff);
  border: 1px solid #d9e3f7; border-left: 4px solid #2f54eb; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.host-banner .hb-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.host-banner .hb-icon { font-size: 28px; line-height: 1; }
.host-banner .hb-title { font-size: 16px; font-weight: 700; color: #1f2d3d; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.host-banner .hb-ver { font-size: 12px; font-weight: 600; color: #2f54eb; background: #eef3ff; border: 1px solid #cfdcff; border-radius: 10px; padding: 1px 8px; }
.host-banner .hb-desc { font-size: 13px; color: #555; margin-top: 4px; line-height: 1.6; }
.host-banner .hb-meta { font-size: 12px; color: #8a8f99; margin-top: 4px; }
.host-banner .hb-ok { color: #389e0d; font-weight: 600; }
.host-banner .hb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.host-banner .hb-help {
  flex: 1 1 100%; border-top: 1px dashed #e2e8f5; margin-top: 12px; padding-top: 12px;
  font-size: 13px; color: #555; line-height: 1.8;
}
.host-banner .hb-help ol, .host-banner .hb-help ul { margin: 4px 0 8px 20px; padding: 0; }
.host-banner .hb-help li { margin: 2px 0; }
.host-banner .hb-help code { font-family: Consolas, Monaco, monospace; font-size: 12px; background: #f4f6fb; border-radius: 4px; padding: 1px 5px; word-break: break-all; }

/* 窄屏：动作区换行、整体纵向 */
@media (max-width: 900px) {
  .host-banner { align-items: flex-start; }
  .host-banner .hb-actions { width: 100%; }
}
body.wps-embed .host-banner { padding: 10px 12px; margin-bottom: 8px; gap: 8px; }
body.wps-embed .host-banner .hb-icon { font-size: 20px; }
body.wps-embed .host-banner .hb-title { font-size: 14px; }
body.wps-embed .host-banner .hb-desc, body.wps-embed .host-banner .hb-meta { font-size: 12px; }
body.wps-embed .host-banner .hb-help { font-size: 12px; line-height: 1.6; }

/* 窄屏：分栏堆叠为单栏 */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .side-list { max-height: 34vh; }
  .split-main { max-height: none; overflow: visible; }
}
body.wps-embed .split { grid-template-columns: 262px minmax(0, 1fr); }
body.wps-embed .side-list { max-height: calc(100vh - 250px); }
body.wps-embed .side-search input { height: 28px; font-size: 12px; }
body.wps-embed .side-item .n { font-size: 12px; }
body.wps-embed .site-footer { font-size: 11.5px; }
body.wps-embed .site-footer-in { min-height: 38px; }
body.wps-embed .level-card-price { font-size: 15px; }
body.wps-embed .level-caps li { font-size: 11px; }
body.wps-embed .price-input { min-width: 74px; font-size: 11px; padding: 3px 5px; }
body.wps-embed .payable-cell { min-width: 130px; font-size: 11px; }