/* ============================================================
   KPOP.WANG 在线设计操作台 —— 豆包风格左右分栏
   命名空间 .kdec- ，独立样式，不污染 PbootCMS / editor.css
   ============================================================ */
* { box-sizing: border-box; }
.kdec-body {
  margin: 0; padding: 0;
  background: #f4f5f7;
  color: #1b1f29;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部导航 ---------- */
.kdec-topnav {
  height: 56px; background: #fff; border-bottom: 1px solid #ececf1;
  position: sticky; top: 0; z-index: 50;
}
.kdec-topnav__in {
  max-width: 1440px; height: 56px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 18px;
}
.kdec-logo { font-size: 19px; font-weight: 800; color: #111; text-decoration: none; letter-spacing: .3px; }
.kdec-logo span { color: #F5B041; }
.kdec-nav { display: flex; gap: 4px; margin-left: 8px; }
.kdec-nav a {
  padding: 7px 12px; border-radius: 9px; font-size: 14px; color: #4a4f5c;
  text-decoration: none; transition: .15s;
}
.kdec-nav a:hover { background: #f4f5f7; color: #111; }
.kdec-nav a.is-active { background: #fff6e6; color: #b9770a; font-weight: 600; }
.kdec-topnav__r { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.kdec-tbtn {
  border: 1px solid #e2e3ea; background: #fff; color: #333; font-size: 13px;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; transition: .15s; text-decoration: none;
}
.kdec-tbtn:hover { border-color: #c9cad4; background: #fafafa; }
.kdec-tbtn--solid { background: #111; color: #fff; border-color: #111; }
.kdec-tbtn--solid:hover { background: #000; }
.kdec-hamb { display: none; margin-left: auto; border: 0; background: transparent; font-size: 22px; cursor: pointer; }

/* ---------- 外壳分栏 ---------- */
.kdec-shell { display: flex; height: calc(100vh - 56px); overflow: hidden; }

/* ---------- 左侧素材栏 ---------- */
.kdec-side {
  width: 300px; flex: 0 0 300px; background: #fff; border-right: 1px solid #ececf1;
  display: flex; flex-direction: column; overflow: hidden;
}
.kdec-side__brand { padding: 14px 16px 8px; }
.kdec-brandpill {
  display: inline-block; background: #111; color: #F5B041; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 100px;
}
.kdec-brandhint { display: block; margin-top: 6px; font-size: 11px; color: #9aa0ad; }
.kdec-side__search { padding: 4px 16px 12px; }
.kdec-side__search input {
  width: 100%; border: 1px solid #e6e7ee; border-radius: 10px; padding: 9px 12px;
  font-size: 13px; outline: none; background: #fafbfc;
}
.kdec-side__search input:focus { border-color: #F5B041; background: #fff; }

.kdec-acc { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.kdec-acc__grp { border-bottom: 1px solid #f1f2f6; }
.kdec-acc__h {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 10px; background: none; border: 0; cursor: pointer; font-size: 14px;
  font-weight: 700; color: #1b1f29; text-align: left;
}
.kdec-acc__ar { transition: transform .2s; color: #b9becb; font-style: normal; }
.kdec-acc__grp.is-open .kdec-acc__ar { transform: rotate(90deg); }
.kdec-acc__b { display: none; padding: 0 6px 12px; }
.kdec-acc__grp.is-open .kdec-acc__b { display: block; }

/* 版型类目 */
.kdec-catlist { display: flex; flex-wrap: wrap; gap: 7px; }
.kdec-cat {
  font-size: 12.5px; padding: 7px 11px; border-radius: 100px; border: 1px solid #e6e7ee;
  background: #fff; color: #3a3f4c; cursor: pointer; transition: .15s;
}
.kdec-cat:hover { border-color: #F5B041; color: #b9770a; }
.kdec-cat.is-active { background: #fff6e6; border-color: #F5B041; color: #b9770a; font-weight: 600; }

/* 版型缩略 */
.kdec-baselist { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kdec-base {
  border: 1px solid #eee; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: #fff; transition: .15s;
}
.kdec-base:hover { border-color: #F5B041; box-shadow: 0 4px 14px rgba(245,176,65,.18); }
.kdec-base.is-active { border-color: #F5B041; box-shadow: 0 0 0 2px rgba(245,176,65,.35); }
.kdec-base img { width: 100%; height: 96px; object-fit: cover; display: block; background: #f3f4f8; }
.kdec-base__t { padding: 7px 9px; }
.kdec-base__t b { display: block; font-size: 12.5px; color: #1b1f29; }
.kdec-base__t span { font-size: 11px; color: #f0883a; font-weight: 700; }

.kdec-backlink {
  margin: 2px 0 10px; font-size: 12px; color: #6b7180; cursor: pointer; display: inline-block;
}
.kdec-backlink:hover { color: #F5B041; }

/* 图库分类 */
.kdec-galcats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.kdec-galcats .kdec-cat { padding: 5px 10px; font-size: 12px; }

/* 图案卡片 */
.kdec-galgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kdec-card {
  border: 1px solid #eee; border-radius: 12px; overflow: hidden; background: #fff; position: relative;
}
.kdec-card__img { position: relative; cursor: pointer; }
.kdec-card__img img { width: 100%; height: 110px; object-fit: cover; display: block; background: #f3f4f8; }
.kdec-card__hover {
  position: absolute; inset: 0; background: rgba(17,18,24,.72); color: #fff; font-size: 11.5px;
  line-height: 1.5; padding: 10px; display: flex; align-items: center; text-align: center;
  opacity: 0; transition: .18s; pointer-events: none;
}
.kdec-card__img:hover .kdec-card__hover { opacity: 1; }
.kdec-badge {
  position: absolute; top: 8px; left: 8px; background: #fff; color: #1a6e4a; border: 1px solid #1a6e4a;
  font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 100px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px; box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.kdec-badge::before { content: "🛡"; font-size: 11px; }
.kdec-card__t { padding: 8px 9px; }
.kdec-card__t b { display: block; font-size: 12.5px; color: #1b1f29; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kdec-card__t span { font-size: 11px; color: #8b91a0; }
.kdec-card__use {
  width: calc(100% - 18px); margin: 0 9px 9px; border: 1px solid #F5B041; background: #fff6e6;
  color: #b9770a; font-size: 12.5px; font-weight: 600; padding: 7px; border-radius: 9px; cursor: pointer;
}
.kdec-card__use:hover { background: #F5B041; color: #fff; }

.kdec-galmore { text-align: center; padding: 10px 0 2px; }
.kdec-galmore button { border: 1px solid #e2e3ea; background: #fff; padding: 7px 16px; border-radius: 9px; font-size: 12.5px; cursor: pointer; }
.kdec-galtip {
  margin-top: 10px; font-size: 11px; color: #6b7180; background: #f7f8fa; border: 1px solid #eef0f4;
  border-radius: 9px; padding: 8px 10px; line-height: 1.5;
}
.kdec-galtip b { color: #b9770a; }

/* 我的项目 */
.kdec-mine__guest { font-size: 12.5px; color: #8b91a0; line-height: 1.6; padding: 4px 4px 10px; }
.kdec-mine__guest p { margin: 0 0 10px; }
.kdec-mine__list { list-style: none; margin: 0; padding: 0; }
.kdec-mine__list li { margin-bottom: 6px; }
.kdec-mine__list a {
  display: block; padding: 10px 12px; border: 1px solid #eee; border-radius: 10px;
  font-size: 13px; color: #2a2f3a; text-decoration: none;
}
.kdec-mine__list a:hover { border-color: #F5B041; background: #fff6e6; }
.kdec-mine__list em {
  float: right; font-style: normal; font-size: 10px; background: #111; color: #F5B041;
  padding: 2px 6px; border-radius: 100px; margin-top: 2px;
}

.kdec-side__foot { padding: 10px 16px; border-top: 1px solid #f1f2f6; font-size: 11px; color: #aab; }

/* ---------- 中间画布 ---------- */
.kdec-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #f4f5f7; }
.kdec-main__bar {
  height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: #fff; border-bottom: 1px solid #ececf1;
}
.kdec-main__l, .kdec-main__r { display: flex; align-items: center; gap: 8px; }
.kdec-main__c { margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.kdec-chip { font-size: 12.5px; background: #f4f5f7; border: 1px solid #e6e7ee; padding: 6px 12px; border-radius: 100px; color: #3a3f4c; }
.kdec-side-toggle { display: none; border: 1px solid #e2e3ea; background: #fff; padding: 6px 12px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.kdec-seg { display: inline-flex; border: 1px solid #e6e7ee; border-radius: 9px; overflow: hidden; }
.kdec-seg button { border: 0; background: #fff; padding: 7px 14px; font-size: 13px; color: #4a4f5c; cursor: pointer; }
.kdec-seg button.is-active { background: #111; color: #fff; }
.kdec-zoom { display: inline-flex; align-items: center; gap: 4px; }
.kdec-zoom button { width: 30px; height: 30px; border: 1px solid #e6e7ee; background: #fff; border-radius: 8px; cursor: pointer; font-size: 15px; color: #333; }
.kdec-zoom span { min-width: 42px; text-align: center; font-size: 12.5px; color: #4a4f5c; }

.kdec-stagewrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 24px; }
.kdec-stage { background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(20,24,40,.08); padding: 14px; }
.kdec-stage canvas { border-radius: 8px; max-width: 100%; height: auto; touch-action: none; }
.kdec-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #9aa0ad; text-align: center; pointer-events: none; gap: 6px;
}
.kdec-empty__ic { font-size: 46px; }
.kdec-empty p { font-size: 14px; margin: 4px 0 0; }
.kdec-empty strong { color: #b9770a; }
.kdec-empty span { font-size: 12px; color: #b3b8c4; }
.kdec-empty.is-hidden { display: none; }

.kdec-hint { text-align: center; font-size: 11.5px; color: #9aa0ad; padding: 0 0 10px; }

.kdec-bottom { height: 64px; background: #fff; border-top: 1px solid #ececf1; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.kdec-price { display: flex; align-items: baseline; gap: 8px; }
.kdec-price__label { font-size: 12px; color: #8b91a0; }
.kdec-price__val { font-size: 22px; font-weight: 800; color: #e0532a; }
.kdec-price__note { font-size: 11px; color: #9aa0ad; }
.kdec-bottom__acts { display: flex; gap: 10px; }

.kdec-btn { border: 1px solid #e2e3ea; background: #fff; color: #2a2f3a; font-size: 14px; padding: 11px 20px; border-radius: 11px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: .15s; }
.kdec-btn:hover { border-color: #c9cad4; }
.kdec-btn--ghost { background: #f7f8fa; }
.kdec-btn--primary { background: #F5B041; border-color: #F5B041; color: #3a2600; font-weight: 700; }
.kdec-btn--primary:hover { background: #f0a82b; }
.kdec-btn--solid { background: #111; border-color: #111; color: #fff; }
.kdec-btn--solid:hover { background: #000; }
.kdec-btn.sm { padding: 8px 14px; font-size: 12.5px; }

/* ---------- 弹窗 ---------- */
.kdec-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.kdec-modal__mask { position: absolute; inset: 0; background: rgba(15,17,24,.5); }
.kdec-modal__box { position: relative; background: #fff; border-radius: 16px; width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.kdec-modal__box--lg { width: 600px; }
.kdec-modal__box--sm { width: 380px; }
.kdec-modal__head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid #f1f2f6; position: sticky; top: 0; background: #fff; }
.kdec-modal__head b { font-size: 15.5px; }
.kdec-modal__sub { font-size: 12px; color: #9aa0ad; }
.kdec-modal__x { margin-left: auto; border: 0; background: none; font-size: 18px; color: #9aa0ad; cursor: pointer; }
.kdec-modal__body { padding: 18px; }

/* 版权弹窗 */
.kdec-cert__meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px; margin-bottom: 14px; }
.kdec-cert__meta dt { color: #8b91a0; }
.kdec-cert__meta dd { margin: 0; color: #1b1f29; word-break: break-all; }
.kdec-cert__meta .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: #4a4f5c; }
.kdec-cert__acts { display: flex; gap: 10px; margin-bottom: 14px; }
.kdec-cert__btn { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-size: 13px; text-decoration: none; border: 1px solid #1a6e4a; color: #1a6e4a; background: #fff; }
.kdec-cert__btn--ghost { border-color: #c9cad4; color: #4a4f5c; }
.kdec-cert__legal { background: #f7f8fa; border: 1px solid #eef0f4; border-radius: 10px; padding: 12px 14px; }
.kdec-cert__legal b { font-size: 12.5px; color: #4a4f5c; display: block; margin-bottom: 4px; }
.kdec-cert__legal p { font-size: 12px; color: #6b7180; line-height: 1.6; margin: 0; }

/* 下单表单 */
.kdec-ord__row { margin-bottom: 14px; }
.kdec-ord__row > label { display: block; font-size: 13px; color: #4a4f5c; margin-bottom: 6px; }
.kdec-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.kdec-opt { border: 1px solid #e2e3ea; background: #fff; padding: 7px 12px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.kdec-opt.is-active { border-color: #F5B041; background: #fff6e6; color: #b9770a; font-weight: 600; }
.kdec-ord__row input, .kdec-ord__row textarea {
  width: 100%; border: 1px solid #e6e7ee; border-radius: 10px; padding: 10px 12px; font-size: 13px; outline: none; font-family: inherit;
}
.kdec-ord__row input:focus, .kdec-ord__row textarea:focus { border-color: #F5B041; }
.kdec-ord__sum { font-size: 13px; color: #4a4f5c; background: #f7f8fa; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; line-height: 1.7; }
.kdec-ord__sum b { color: #e0532a; }
.kdec-ord__copyright { font-size: 11.5px; color: #1a6e4a; background: #eafaf2; border: 1px solid #c7ecd9; border-radius: 9px; padding: 8px 10px; margin-bottom: 14px; line-height: 1.5; }

/* 登录弹窗 */
.kdec-login { text-align: center; }
.kdec-login p { font-size: 13.5px; color: #4a4f5c; margin: 0 0 16px; }
.kdec-login .kdec-btn--solid { width: 100%; margin-bottom: 10px; }
.kdec-login__reg { display: block; font-size: 12.5px; color: #6b7180; text-decoration: none; }
.kdec-login__reg:hover { color: #F5B041; }

/* 结果 */
.kdec-done { text-align: center; padding: 10px 6px; }
.kdec-done__ico { width: 54px; height: 54px; border-radius: 50%; background: #1a6e4a; color: #fff; font-size: 28px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.kdec-done h3 { margin: 0 0 8px; font-size: 17px; }
.kdec-done p { font-size: 13px; color: #6b7180; margin: 0 0 16px; line-height: 1.6; }
.kdec-done__acts { display: flex; gap: 10px; }
.kdec-done__acts .kdec-btn { flex: 1; }

/* toast / loading */
.kdec-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 200;
  background: #111; color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 100px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.kdec-loading {
  position: fixed; inset: 0; z-index: 300; background: #f4f5f7; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; color: #6b7180; font-size: 14px;
}
.kdec-loading i { width: 34px; height: 34px; border: 3px solid #e2e3ea; border-top-color: #F5B041; border-radius: 50%; animation: kdec-spin .8s linear infinite; }
@keyframes kdec-spin { to { transform: rotate(360deg); } }

.kdec-drawer-mask { position: fixed; inset: 0; background: rgba(15,17,24,.4); z-index: 40; }

/* ---------- 移动端：侧边栏转抽屉 ---------- */
@media (max-width: 860px) {
  .kdec-hamb { display: block; }
  .kdec-nav { display: none; }
  .kdec-topnav__r .kdec-tbtn { display: none; }
  .kdec-side {
    position: fixed; top: 56px; left: 0; bottom: 0; z-index: 45; width: 84vw; max-width: 320px;
    transform: translateX(-100%); transition: transform .25s; box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  .kdec-side.is-open { transform: translateX(0); }
  .kdec-side-toggle { display: inline-block; }
  .kdec-main__c { gap: 8px; }
  .kdec-zoom span { min-width: 34px; }
  .kdec-bottom { flex-direction: column; height: auto; gap: 10px; padding: 12px; align-items: stretch; }
  .kdec-bottom__acts .kdec-btn { flex: 1; }
  .kdec-stagewrap { padding: 12px; }
}
