/* 豆图工坊 Modern Editor UI - warm orange glass system */
:root{
  --dt-orange:#ff8a2a;
  --dt-orange-2:#ffb15c;
  --dt-ink:#253042;
  --dt-muted:#7b8492;
  --dt-card:rgba(255,255,255,.72);
  --dt-card-strong:rgba(255,255,255,.9);
  --dt-line:rgba(35,48,66,.09);
  --dt-shadow:0 18px 48px rgba(37,48,64,.10);
}
body.light-theme .editor-page{
  background:
    radial-gradient(circle at 8% 8%,rgba(255,164,85,.15),transparent 28%),
    radial-gradient(circle at 92% 18%,rgba(255,220,177,.28),transparent 26%),
    linear-gradient(135deg,#fffaf5 0%,#f7f9fc 52%,#fff 100%);
  color:var(--dt-ink);
}
.editor-page{
  position:relative;
}
/* shared top toolbar */
.editor-topbar{
  grid-column:1/-1;
  grid-row:1;
  min-height:64px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 18px;
  background:rgba(255,255,255,.68);
  border-bottom:1px solid var(--dt-line);
  backdrop-filter:blur(22px) saturate(145%);
  -webkit-backdrop-filter:blur(22px) saturate(145%);
  box-shadow:0 8px 28px rgba(31,41,55,.06);
  z-index:80;
}
.editor-brand{display:flex;align-items:center;gap:10px;min-width:220px}
.editor-brand-mark{width:38px;height:38px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(145deg,#ff9d3d,#ff7a18);color:#fff;box-shadow:0 8px 20px rgba(255,122,24,.25);font-size:19px}
.editor-brand-title{font-weight:800;font-size:15px;letter-spacing:-.3px;color:var(--dt-ink)}
.editor-brand-sub{font-size:10px;color:var(--dt-muted);margin-top:2px}
.editor-top-actions{display:flex;align-items:center;gap:7px;margin-left:auto;flex-wrap:wrap;justify-content:flex-end}
.editor-top-btn{height:38px;padding:0 13px;border-radius:12px;border:1px solid rgba(31,41,55,.08);background:rgba(255,255,255,.66);color:#566071;font-size:12px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);transition:.18s ease}
.editor-top-btn:hover{transform:translateY(-1px);border-color:rgba(255,138,42,.35);color:var(--dt-orange);background:#fff}
.editor-top-btn.primary{background:linear-gradient(135deg,#ff9b3f,#ff7a18);border:none;color:#fff;box-shadow:0 8px 18px rgba(255,122,24,.22)}
.editor-top-btn.icon-only{width:38px;padding:0}
.editor-top-status{display:flex;align-items:center;gap:6px;margin-left:4px;padding:8px 11px;border-radius:12px;background:rgba(255,138,42,.08);color:#d96f18;font-size:11px}
.editor-top-status i{width:7px;height:7px;border-radius:50%;background:#2bc48a;box-shadow:0 0 0 4px rgba(43,196,138,.12)}
/* desktop grid */
@media(min-width:768px){
  .editor-page{display:grid!important;width:100vw;height:100vh;grid-template-columns:340px minmax(0,1fr) 430px;grid-template-rows:64px minmax(0,1fr);overflow:hidden}
  body.light-theme .panel{background:rgba(255,255,255,.58);border-color:rgba(31,41,55,.08);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
  .panel-left{grid-column:1;grid-row:2;width:auto!important}
  .canvas-area{grid-column:2;grid-row:2}
  .panel-right{grid-column:3;grid-row:2;width:auto!important}
  .panel-header{background:rgba(255,255,255,.45);border-bottom-color:var(--dt-line);color:var(--dt-orange)}
  .section{background:rgba(255,255,255,.52);border:1px solid rgba(31,41,55,.07);border-radius:18px;padding:15px;margin-bottom:13px;box-shadow:0 8px 22px rgba(37,48,64,.045)}
  .section-title{font-size:12px;color:#364152;border-left:0;padding-left:0;text-transform:none;letter-spacing:0;font-weight:800;margin-bottom:11px}
  .panel-content{padding:14px;gap:0}
  .palette-section{background:rgba(255,255,255,.58);border:1px solid rgba(31,41,55,.07);border-radius:18px;padding:14px}
  .canvas-area{background:transparent;padding:14px 14px 12px;gap:10px}
  .canvas-wrapper{border:1px solid rgba(31,41,55,.07);border-radius:24px;background:rgba(255,255,255,.66);box-shadow:var(--dt-shadow);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
  .view-toggle-btn{top:16px;right:16px;border-radius:13px;background:rgba(255,255,255,.72);color:#5b6575;border-color:rgba(31,41,55,.08);font-size:18px}
  .change-image-btn{top:64px;right:16px;border-radius:13px;background:rgba(255,255,255,.72);color:#5b6575;border-color:rgba(31,41,55,.08);font-size:18px}
  .change-image-btn:hover{background:linear-gradient(135deg,#ff9b3f,#ff7a18);color:#fff;border-color:transparent}
  .view-toggle-btn:hover{background:linear-gradient(135deg,#ff9b3f,#ff7a18);color:#fff;border-color:transparent}
  /* 导出按钮强制橙色（深浅色模式都生效） */
  .editor-top-btn.export-orange-btn,
  .editor-top-btn.primary.export-orange-btn{
    background:linear-gradient(135deg,#ff9b3f,#ff7a18)!important;
    border:none!important;
    color:#fff!important;
    box-shadow:0 8px 18px rgba(255,122,24,.28)!important;
    width:auto;
    padding:0 16px;
    font-size:13px;
    font-weight:700;
  }
  .editor-top-btn.export-orange-btn .txt{display:inline}
  .editor-top-btn.export-orange-btn:hover{
    background:linear-gradient(135deg,#ffa84d,#ff8a2e)!important;
    color:#fff!important;
    transform:translateY(-1px);
    box-shadow:0 10px 22px rgba(255,122,24,.36)!important;
  }
  .bottom-area{border-radius:18px;border:1px solid rgba(31,41,55,.07);background:rgba(255,255,255,.68);box-shadow:0 12px 30px rgba(37,48,64,.07);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
}
/* mobile: canvas-first long-form app */
@media(max-width:767px){
  html,body{overflow-x:hidden!important;overflow-y:auto!important;scrollbar-width:none!important;-ms-overflow-style:none!important;background:#f8f9fb}
  html::-webkit-scrollbar,body::-webkit-scrollbar,*::-webkit-scrollbar{width:0!important;height:0!important;display:none!important}
  body{overscroll-behavior-y:auto!important}
  .editor-page{display:none;position:relative!important;inset:auto!important;width:100%!important;height:auto!important;min-height:100dvh!important;overflow:visible!important;background:linear-gradient(145deg,#fff9f4,#f7f9fc 45%,#fff)!important;padding-bottom:88px}
  body.douTu-editor-active .editor-page{display:block!important}
  body.douTu-editor-active .upload-page{display:none!important}
  .editor-topbar{position:sticky;top:0;min-height:62px;height:62px;padding:8px 12px;gap:8px;z-index:200;background:rgba(255,255,255,.76);border-bottom:1px solid rgba(31,41,55,.06)}
  .editor-brand{min-width:0;flex:1;gap:8px}.editor-brand-mark{width:36px;height:36px;border-radius:12px;font-size:17px}.editor-brand-title{font-size:14px}.editor-brand-sub{font-size:9px}
  .editor-top-actions{margin-left:0;gap:5px;flex-wrap:nowrap}.editor-top-btn{height:36px;width:36px;padding:0;border-radius:11px;font-size:0}.editor-top-btn .txt{display:none}.editor-top-btn.primary{width:40px}.editor-top-btn.icon-only{width:36px}
  .editor-top-btn.export-orange-btn{width:auto;padding:0 14px;font-size:13px;background:linear-gradient(135deg,#ff9b3f,#ff7a18)!important;border:none!important;color:#fff!important;box-shadow:0 8px 18px rgba(255,122,24,.22)!important}
  .editor-top-btn.export-orange-btn .txt{display:inline}
  .editor-top-btn.export-orange-btn:hover{background:linear-gradient(135deg,#ffa84d,#ff8a2e)!important;color:#fff!important;transform:translateY(-1px)}
  .editor-top-status{display:none}
  .panel-left,.panel-right{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;top:auto!important;width:auto!important;height:auto!important;max-height:none!important;transform:none!important;border:none!important;background:transparent!important;display:block!important;overflow:visible!important;z-index:auto!important}
  .panel-left.active,.panel-right.active{transform:none!important}
  .panel-header{margin:0 14px 10px;padding:13px 15px;border-radius:17px;background:rgba(255,255,255,.72);border:1px solid rgba(31,41,55,.07);box-shadow:0 8px 24px rgba(37,48,64,.05);color:#273142}
  .panel-header .btn{display:none}
  .panel-content{height:auto!important;overflow:visible!important;padding:0 14px 4px;display:block}
  .panel-left{padding-top:12px}.panel-right{padding-top:4px}
  .section{background:rgba(255,255,255,.72);border:1px solid rgba(31,41,55,.07);border-radius:20px;padding:16px;margin-bottom:12px;box-shadow:0 12px 28px rgba(37,48,64,.055);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
  .section-title{font-size:14px;color:#273142;border-left:0;padding:0;text-transform:none;letter-spacing:0;font-weight:800;margin-bottom:12px}
  .select-wrapper select,.input-row input[type=number],.btn{min-height:40px;border-radius:11px}.btn{font-size:12px}.btn:hover{transform:none}
  .canvas-area{display:block!important;width:auto!important;height:auto!important;min-height:0!important;padding:12px 14px 0!important;background:transparent!important;overflow:visible!important}
  .canvas-wrapper{height:min(56vh,520px)!important;min-height:340px!important;position:relative!important;overflow:hidden!important;border-radius:24px!important;border:1px solid rgba(31,41,55,.07)!important;background:rgba(255,255,255,.74)!important;box-shadow:0 18px 42px rgba(37,48,64,.10)!important;backdrop-filter:blur(20px)!important;-webkit-backdrop-filter:blur(20px)!important}
  .canvas-container{max-width:none!important}.view-toggle-btn{top:12px!important;right:12px!important;width:38px!important;height:38px!important;border-radius:13px!important;background:rgba(255,255,255,.78)!important;color:#5c6675!important;border-color:rgba(31,41,55,.08)!important}
  .change-image-btn{top:58px!important;right:12px!important;width:38px!important;height:38px!important;border-radius:13px!important;background:rgba(255,255,255,.78)!important;color:#5c6675!important;border-color:rgba(31,41,55,.08)!important}
  .bottom-area{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;width:auto!important;max-height:160px!important;overflow:hidden!important;margin-top:10px;border-radius:18px;background:rgba(255,255,255,.72);border:1px solid rgba(31,41,55,.07);box-shadow:0 10px 26px rgba(37,48,64,.05);transform:none!important;padding:10px 12px!important}
  .bottom-resize-handle{display:none!important}.legend-area{display:none!important}.stats-section{width:100%!important;display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important}.stats-list{max-height:70px!important;overflow:auto!important;scrollbar-width:none!important;flex:1!important;min-height:0!important}
  .mobile-tab-bar{position:fixed!important;display:flex!important;left:10px!important;right:10px!important;bottom:10px!important;width:auto!important;height:64px!important;padding:6px!important;box-sizing:border-box!important;border:1px solid rgba(255,255,255,.78)!important;border-radius:22px!important;background:rgba(255,255,255,.78)!important;box-shadow:0 16px 42px rgba(31,41,55,.16)!important;backdrop-filter:blur(22px) saturate(145%)!important;-webkit-backdrop-filter:blur(22px) saturate(145%)!important;z-index:500!important}
  .mobile-tab-btn{min-height:52px!important;border-radius:16px!important;color:#7b8492!important;font-size:9px!important;font-weight:700!important;gap:3px!important}.mobile-tab-btn span{font-size:19px!important}.mobile-tab-btn.active{color:#fff!important;background:linear-gradient(145deg,#ff9f45,#ff7a18)!important;box-shadow:0 8px 18px rgba(255,122,24,.22)!important}
  .mobile-tab-btn:nth-child(3){flex:1.2}.mobile-tab-btn:nth-child(3) span{font-size:23px!important}
  .current-color-display{border-radius:15px!important;background:rgba(255,255,255,.58)!important;border:1px solid rgba(31,41,55,.06)!important;padding:11px!important}
  .palette-grid{grid-template-columns:repeat(6,1fr)!important;max-height:none!important;gap:6px!important}.color-swatch{min-height:42px!important;border-radius:10px!important}
  .tool-group{display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:7px!important}.tool-group .btn{min-height:48px!important;flex-direction:column!important;gap:2px!important}.tool-group .btn span{font-size:18px}
  .hand-draw-only{border-radius:14px;background:rgba(255,138,42,.06);padding:10px;margin-top:10px}
  body.light-theme .panel-right .section{background:rgba(255,255,255,.72)}
  /* Prevent inline body overflow:hidden from old hand-draw code */
  body.hand-draw-mode{overflow-y:auto!important}
}
/* modern glass controls */
.modern-card-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.modern-card-title .hint{font-size:10px;color:#9aa2ae;font-weight:500}.modern-chip-row{display:flex;gap:7px;flex-wrap:wrap}.modern-chip{padding:8px 12px;border-radius:999px;border:1px solid rgba(31,41,55,.08);background:rgba(255,255,255,.72);font-size:11px;color:#677184}.modern-chip.active{background:linear-gradient(135deg,#ff9c40,#ff7a18);border-color:transparent;color:#fff;box-shadow:0 7px 15px rgba(255,122,24,.18)}

/* Final desktop panel collapse override */
@media (min-width: 1025px) {
  .editor-page { grid-template-columns: 340px minmax(0,1fr) 430px; }
  .editor-page .panel-left, .editor-page .panel-right { min-width:0 !important; width:auto !important; }
  .editor-page .panel-left.collapsed, .editor-page .panel-right.collapsed { width:0 !important; min-width:0 !important; overflow:visible !important; }
  .editor-page .panel-float-toggle {
    position:fixed !important; top:50% !important; transform:translateY(-50%) !important;
    z-index:10000 !important; width:20px !important; height:46px !important;
    min-width:20px !important; min-height:46px !important; padding:0 !important;
    display:flex !important; align-items:center !important; justify-content:center !important;
    pointer-events:auto !important; opacity:1 !important; visibility:visible !important; cursor:pointer !important;
  }
  .editor-page #btn-collapse-left { left:calc(var(--left-panel-width,340px) - 10px) !important; right:auto !important; }
  .editor-page #btn-collapse-right { right:calc(var(--right-panel-width,430px) - 10px) !important; left:auto !important; }
}

/* Final top navigation arrangement: mode, home, export, import, account */
@media (min-width:768px){
  #editor-page .editor-top-actions{
    margin-left:auto!important;
    justify-content:flex-end!important;
    gap:6px!important;
  }
  #editor-page .editor-top-actions .editor-top-btn{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    min-width:70px!important;
  }
  #editor-page .editor-top-actions .editor-top-btn .svg-icon{
    display:inline-flex!important;
    width:19px!important;
    height:19px!important;
  }
  #editor-page .editor-top-actions .editor-top-btn .svg-icon svg{
    width:19px!important;
    height:19px!important;
  }
}

/* 2026-08-13 editor brand icon: match the introduction page's 🎨 icon. */
.editor-brand-mark{font-size:20px!important;line-height:1!important;}
