* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: "PingFang SC","Microsoft YaHei",sans-serif; background: #1a1a1a; }
#scene { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }

/* 升级专业版 */
.pro-btn { background: linear-gradient(135deg,#e0aa3e,#c98a1e) !important; color: #fff !important; font-weight: 600; }
.pro-panel { max-width: 560px; }
.pro-status { text-align: center; font-size: 13px; color: #8a6d2f; margin-bottom: 12px; min-height: 18px; }
.pro-status.pro-on { color: #2e7d4f; font-weight: 600; }
.pro-plans { display: flex; gap: 14px; margin: 6px 0 18px; }
.pro-card { flex: 1; border: 1.5px solid #e2d3ab; border-radius: 12px; padding: 14px 16px; background: #fbf7ec; }
.pro-card-hot { border-color: #c9a24a; background: linear-gradient(160deg,#fdf4dd,#f7ead0); box-shadow: 0 4px 14px rgba(201,162,74,.25); }
.pro-card-name { font-weight: 700; font-size: 15px; color: #4a3c22; display: flex; align-items: center; gap: 6px; }
.pro-badge { font-size: 10px; background: #c9a24a; color: #fff; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.pro-card-price { font-size: 20px; font-weight: 700; color: #b0442a; margin: 6px 0 8px; }
.pro-card-price small { font-size: 12px; color: #a8842e; font-weight: 500; }
.pro-card ul { list-style: none; }
.pro-card li { font-size: 12.5px; color: #6a5a35; padding: 3px 0 3px 16px; position: relative; }
.pro-card li::before { content: '✓'; position: absolute; left: 0; color: #c9a24a; font-weight: 700; }
.pro-redeem { border-top: 1px dashed #e0d2ab; padding-top: 14px; }
.pro-redeem-tip { font-size: 13px; color: #5a4c2e; margin-bottom: 8px; }
.pro-redeem-row { display: flex; gap: 10px; }
.pro-redeem-row input { flex: 1; padding: 10px 12px; border: 1px solid #d8c89a; border-radius: 8px; font-size: 14px; letter-spacing: 1px; }
.pro-redeem-row button { white-space: nowrap; }
.pro-buy-tip { font-size: 12px; color: #a8842e; margin-top: 10px; }
@media (max-width: 560px) { .pro-plans { flex-direction: column; } }
/* 锁定的画框/场景选项 */
.opt-locked { opacity: .5; }
/* 展厅免费版水印 */
#wm { position: fixed; right: 14px; bottom: 12px; z-index: 15; pointer-events: none; font-size: 13px; font-weight: 600; color: rgba(244,239,230,.38); letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0,0,0,.3); font-family: Georgia, serif; }

/* 顶部栏 */
#topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: linear-gradient(rgba(10,10,12,.6), transparent); color: #f4efe6; pointer-events: none; }
#topbar .brand { display: flex; align-items: center; gap: 8px; font-size: 18px; letter-spacing: 1px; pointer-events: auto; }
#topbar .logo { color: #d9a84e; font-size: 22px; }
#topbar .actions { display: flex; gap: 8px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; }
.tbtn { background: rgba(255,255,255,.12); color: #f4efe6; border: 1px solid rgba(255,255,255,.25); padding: 7px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; backdrop-filter: blur(6px); transition: .2s; }
.tbtn:hover { background: rgba(255,255,255,.24); }
.tbtn.primary { background: #d9a84e; border-color: #d9a84e; color: #241a08; font-weight: 600; }
.tbtn.primary:hover { background: #e8bb62; }
#btnMenu { display: none; pointer-events: auto; font-size: 18px; line-height: 1; padding: 6px 12px; }

/* 进入卡 */
#enterCard { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(20,18,14,.35), rgba(8,8,10,.78)); backdrop-filter: blur(3px); }
#enterCard .card { text-align: center; color: #f4efe6; max-width: 520px; padding: 40px; }
#enterCard h1 { font-size: 40px; letter-spacing: 4px; margin-bottom: 12px; font-weight: 600; text-shadow: 0 4px 24px rgba(0,0,0,.6); }
#enterCard #enterSub { color: #d9a84e; letter-spacing: 2px; margin-bottom: 26px; font-size: 15px; }
#enterCard .keys { display: flex; gap: 18px; justify-content: center; margin-bottom: 30px; flex-wrap: wrap; }
#enterCard .keys span { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); padding: 8px 14px; border-radius: 10px; font-size: 13px; }
#enterCard .keys b { color: #d9a84e; margin-right: 5px; }
#btnEnter { background: #d9a84e; color: #241a08; border: none; padding: 14px 54px; font-size: 17px; border-radius: 30px; cursor: pointer; font-weight: 700; letter-spacing: 3px; transition: .2s; box-shadow: 0 8px 30px rgba(217,168,78,.35); }
#btnEnter:hover { transform: translateY(-2px); background: #e8bb62; }
#enterCard .tip { margin-top: 16px; font-size: 12px; color: rgba(244,239,230,.6); }

/* 准星 / 提示 / toast */
#crosshair { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); color: rgba(255,255,255,.75); font-size: 20px; z-index: 10; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
/* 手机虚拟摇杆 */
#joystick { position: fixed; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25); z-index: 11; pointer-events: none; transform: translate(-50%,-50%); backdrop-filter: blur(2px); }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%; background: rgba(217,168,78,.85); border: 2px solid rgba(255,255,255,.5); transform: translate(-50%,-50%); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
#hint { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); color: rgba(244,239,230,.8); font-size: 12.5px; background: rgba(10,10,12,.5); padding: 8px 18px; border-radius: 20px; z-index: 10; pointer-events: none; backdrop-filter: blur(4px); letter-spacing: 1px; }
#toast { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); background: rgba(20,20,24,.92); color: #f4efe6; padding: 11px 22px; border-radius: 10px; z-index: 60; font-size: 14px; border: 1px solid rgba(217,168,78,.4); box-shadow: 0 8px 30px rgba(0,0,0,.4); }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(6,6,8,.62); backdrop-filter: blur(4px); padding: 20px; }
.modal .panel { background: #f7f3ea; color: #2a2118; border-radius: 16px; padding: 28px 28px 24px; width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.modal .panel.wide { max-width: 560px; }
.modal h2 { font-size: 20px; margin-bottom: 16px; letter-spacing: 1px; }
.modal .muted { color: #8a7f6a; font-size: 13px; margin: 4px 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: #ece5d5; border-radius: 10px; padding: 4px; }
.tab { flex: 1; border: none; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px; color: #6a5f4a; }
.tab.active { background: #fff; color: #2a2118; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.field { display: block; margin-bottom: 13px; }
.field span { display: block; font-size: 12.5px; color: #7a6f5a; margin-bottom: 5px; }
.field input, .field textarea { width: 100%; border: 1px solid #d8cfba; border-radius: 9px; padding: 10px 12px; font-size: 14px; background: #fff; color: #2a2118; font-family: inherit; }
.field input:focus, .field textarea:focus { outline: 2px solid #d9a84e; border-color: transparent; }
.row { display: flex; gap: 8px; margin-top: 16px; }
.row button { flex: 1; padding: 11px 6px; border-radius: 10px; border: 1px solid #cfc5ab; background: #fff; cursor: pointer; font-size: 14px; transition: .15s; white-space: nowrap; }
.row button:hover { background: #f2ecdd; }
.row button.primary { background: #d9a84e; border-color: #d9a84e; color: #241a08; font-weight: 700; }
.row button.primary:hover { background: #e8bb62; }
.row button.danger { background: #b8382a; border-color: #b8382a; color: #fff; }
.err { color: #b8382a; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* 上传 */
#dropZone { border: 2px dashed #cfc5ab; border-radius: 12px; padding: 34px 18px; text-align: center; color: #7a6f5a; cursor: pointer; font-size: 14px; transition: .2s; margin-bottom: 14px; }
#dropZone:hover, #dropZone.drag { border-color: #d9a84e; background: #faf3e2; color: #a8842e; }
#pendingList { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 10px; margin-bottom: 14px; }
#pendingList .pv { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid #ddd; }
#pendingList img { width: 100%; height: 90px; object-fit: cover; display: block; }
#pendingList .frm { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 3px 2px; text-align: center; border: none; width: 100%; cursor: pointer; }
select { font-family: inherit; }
.field select { width: 100%; padding: 9px 12px; border: 1px solid #cfc5ab; border-radius: 8px; background: #fff; font-size: 14px; color: #2a2118; }

/* 作品管理 */
#manageList { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
#manageList .mrow { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid #e5dcc6; border-radius: 10px; padding: 8px; }
#manageList img { width: 74px; height: 56px; object-fit: cover; border-radius: 6px; }
#manageList .mi { flex: 1; min-width: 0; }
#manageList .mt { font-size: 14px; font-weight: 600; }
#manageList .mm { font-size: 12px; color: #8a7f6a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#manageList button { padding: 6px 12px; border-radius: 8px; border: 1px solid #cfc5ab; background: #fff; cursor: pointer; font-size: 12px; }
#manageList button.edit { color: #2f5d3a; border-color: #b3d3ba; }
#manageList button.del { color: #b8382a; border-color: #e5b3ac; }
#manageList .empty { text-align: center; color: #8a7f6a; padding: 30px 0; font-size: 14px; }

/* 场景选择 */
#sceneList { display: grid; gap: 10px; margin-bottom: 12px; }
#sceneList .sc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid #e5dcc6; border-radius: 12px; background: #fff; cursor: pointer; text-align: left; transition: border-color .15s; }
#sceneList .sc:hover { border-color: #c9a24a; }
#sceneList .sc.active { border-color: #c9a24a; background: #fdf8ec; }
#sceneList .sc .ico { font-size: 26px; }
#sceneList .sc .sn { font-size: 15px; font-weight: 600; color: #2a2118; }
#sceneList .sc .sd { font-size: 12px; color: #8a7f6a; margin-top: 2px; }

#shareCanvas { width: 100%; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.2); }

/* ===== 画作详情页（优化版） ===== */
.info-panel { max-width: 560px; padding: 0 0 20px; overflow: hidden; }
.info-panel .info-hero { position: relative; width: 100%; background: #fff; max-height: 420px; overflow: hidden; cursor: zoom-in; }
.info-panel .info-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info-panel .info-hero::after { content: "⤢ 点击放大"; position: absolute; right: 10px; bottom: 8px; background: rgba(30,24,14,.55); color: #f4ecd8; font-size: 11px; padding: 3px 9px; border-radius: 20px; letter-spacing: .5px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.info-panel .info-hero:hover::after { opacity: 1; }
/* 详情页多图翻页 */
.gal-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(20,16,10,.5); color: #f4ecd8; font-size: 22px; line-height: 1; cursor: pointer; transition: background .15s; }
.gal-arrow:hover { background: rgba(20,16,10,.75); }
.gal-prev { left: 10px; } .gal-next { right: 10px; }
.gal-tag { position: absolute; left: 10px; bottom: 8px; z-index: 3; background: rgba(20,16,10,.6); color: #f4ecd8; font-size: 11px; padding: 3px 10px; border-radius: 20px; letter-spacing: .5px; }
.gal-dots { position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px; z-index: 3; display: flex; gap: 6px; }
.gal-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(244,236,216,.45); cursor: pointer; transition: .15s; }
.gal-dots span.on { background: #fff; transform: scale(1.25); }
/* 上传预览：主图/细节图标注 */
.pv { position: relative; }
.pv-tag { position: absolute; top: 6px; left: 6px; z-index: 2; background: rgba(20,16,10,.65); color: #f4ecd8; font-size: 10px; padding: 2px 8px; border-radius: 12px; letter-spacing: .5px; }
.pv-main .pv-tag { background: linear-gradient(135deg,#e0aa3e,#c98a1e); color: #fff; }
.pv-tip { flex-basis: 100%; font-size: 12px; color: #b0442a; padding: 4px 2px; }
.info-body { padding: 0 24px; }
.info-panel .info-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding: 0; }
.info-panel .info-head h2 { margin: 0; font-size: 24px; letter-spacing: 1px; padding: 0; font-family: "Songti SC","STSong",serif; font-weight: 700; color: #2b2114; }
.info-panel .info-chip { background: linear-gradient(180deg,#e2b45c,#d9a84e); color: #241a08; font-size: 11px; padding: 3px 12px; border-radius: 20px; font-weight: 600; letter-spacing: 1px; box-shadow: 0 1px 3px rgba(160,120,40,.3); }
.info-panel .info-artist { display: flex; align-items: center; gap: 7px; margin: 9px 0 0; color: #8a6d2f; font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.info-panel .info-artist::before { content: "✒"; font-size: 13px; opacity: .8; }
.info-divider { height: 1px; margin: 14px 0 0; background: linear-gradient(90deg, #d9c9a0 0%, #ece0c4 60%, transparent 100%); }
.info-panel .info-desc { margin: 13px 0 0; color: #43392a; font-size: 14px; line-height: 1.85; text-align: justify; }
.info-panel .info-bio { margin: 16px 0 0; background: linear-gradient(180deg,#f3ecd9,#efe6d0); border-left: 3px solid #d9a84e; border-radius: 8px; padding: 11px 15px 12px; box-shadow: 0 2px 6px rgba(120,95,40,.08); }
.info-panel .info-bio-label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #a8842e; font-weight: 700; letter-spacing: 2px; margin-bottom: 5px; }
.info-panel .info-bio-label::after { content: ""; flex: 1; height: 1px; background: #e0d2ac; }
.info-panel .info-bio p { margin: 0; font-size: 13px; color: #6a5f4a; line-height: 1.7; }
.info-panel .info-specs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; }
.info-panel .info-specs span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #6a5a35; background: #f2ead6; border: 1px solid #e3d5b2; padding: 3px 10px; border-radius: 20px; }
.info-panel .info-price { display: flex; align-items: baseline; gap: 8px; margin: 15px 0 0; padding: 10px 16px; background: linear-gradient(90deg,#fdf6e3,#f8eec9); border-radius: 8px; }
.info-panel .info-price-label { font-size: 12px; color: #a8842e; font-weight: 600; letter-spacing: 1px; }
.info-panel .info-price #infoPrice { font-size: 20px; font-weight: 700; color: #b0442a; font-family: Georgia, serif; }
.frow { display: flex; gap: 12px; }
.frow .field { flex: 1; }
.info-actions { padding: 0 24px; margin-top: 20px; }
#infoEdit { padding: 22px; }

/* ===== 画作全屏放大 ===== */
#artZoom { position: fixed; inset: 0; z-index: 300; background: rgba(12,10,6,.93); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: grab; }
#artZoom:active { cursor: grabbing; }
#artZoom img { max-width: 92vw; max-height: 88vh; user-select: none; -webkit-user-drag: none; box-shadow: 0 20px 60px rgba(0,0,0,.6); transition: transform .08s linear; }
#artZoomTip { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #cfc3a6; font-size: 12px; letter-spacing: .5px; background: rgba(0,0,0,.35); padding: 5px 14px; border-radius: 20px; pointer-events: none; }
#artZoomClose { position: absolute; top: 16px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
#artZoomClose:hover { background: rgba(255,255,255,.25); }
#infoEdit h2 { margin-bottom: 14px; }

/* ===== 移动端 / 窄屏适配 ===== */
@media (max-width: 640px) {
  #topbar { padding: 8px 10px; }
  #topbar .brand .name { font-size: 14px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tbtn { padding: 6px 9px; font-size: 11px; }
  /* 窄屏：右侧菜单收进汉堡按钮 */
  #btnMenu { display: block; }
  #topbar .actions {
    position: absolute; top: calc(100% + 6px); right: 10px;
    display: none; flex-direction: column; align-items: stretch; gap: 6px;
    background: rgba(16,16,18,.92); border: 1px solid rgba(255,255,255,.15);
    border-radius: 12px; padding: 10px; min-width: 150px;
    backdrop-filter: blur(8px); box-shadow: 0 12px 32px rgba(0,0,0,.4);
  }
  #topbar .actions.open { display: flex; }
  #topbar .actions .tbtn { width: 100%; text-align: left; padding: 8px 12px; font-size: 13px; }
  #enterCard h1 { font-size: 26px; letter-spacing: 2px; }
  #enterCard #enterSub { font-size: 13px; margin-bottom: 18px; }
  #enterCard .card { padding: 20px 16px; max-width: 92vw; }
  #enterCard .keys { gap: 8px; margin-bottom: 22px; }
  #enterCard .keys span { padding: 6px 10px; font-size: 11px; }
  #btnEnter { padding: 12px 40px; font-size: 15px; }
  .modal { padding: 10px; }
  .modal .panel { padding: 20px 16px 16px; max-height: 92vh; border-radius: 14px; }
  .info-panel { padding: 0 0 16px; }
  .modal h2 { font-size: 18px; }
  #hint { font-size: 11px; padding: 6px 12px; bottom: 14px; max-width: 92vw; text-align: center; white-space: normal; line-height: 1.5; }
  #toast { font-size: 13px; padding: 9px 16px; max-width: 90vw; text-align: center; }
  #dropZone { padding: 24px 12px; font-size: 13px; }
  #pendingList { grid-template-columns: repeat(auto-fill, minmax(86px,1fr)); }
}

/* 手机横屏（高度小）：压缩进入卡与提示，避免溢出 */
@media (max-height: 480px) and (orientation: landscape) {
  #enterCard .card { padding: 14px 20px; }
  #enterCard h1 { font-size: 22px; margin-bottom: 6px; }
  #enterCard #enterSub { font-size: 12px; margin-bottom: 10px; }
  #enterCard .keys { margin-bottom: 12px; gap: 8px; }
  #enterCard .keys span { padding: 5px 9px; font-size: 11px; }
  #btnEnter { padding: 9px 34px; font-size: 14px; }
  #enterCard .tip { margin-top: 8px; font-size: 11px; }
  #hint { bottom: 8px; font-size: 10.5px; padding: 4px 12px; }
  .modal .panel { max-height: 94vh; }
  .info-panel .info-hero { max-height: 190px; }
  .info-panel .info-hero img { max-height: 190px; }
  .info-panel .info-head h2 { font-size: 20px; }
  .info-body, .info-actions { padding: 0 18px; }
}
