/* 通用上传区与玩家端选择面板（admin.html 与 index.html 共用） */
.dz-native, .picker-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none; overflow: hidden; clip-path: inset(50%); margin: 0 !important; padding: 0 !important; border: 0 !important; }
.field:has(> .dz-native), .field:has(> .picker-native) { position: relative; }

.dropzone { display: block; width: 100%; border: 1.5px dashed #c9d0de; border-radius: 14px; background: #f8f9fc; color: #6b7489; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; outline: none; font-weight: 400; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary, #2f54e8); background: color-mix(in srgb, var(--primary, #2f54e8) 5%, #fff); }
.dropzone:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #2f54e8) 22%, transparent); }
.dropzone.is-dragover, .dz-host.is-dragover { border-color: var(--primary, #2f54e8) !important; border-style: solid; background: color-mix(in srgb, var(--primary, #2f54e8) 9%, #fff) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, #2f54e8) 16%, transparent); }
.dropzone.is-disabled { cursor: not-allowed; opacity: .6; }
.dz-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 26px 16px; text-align: center; min-height: 128px; }
.dz-empty svg, .dz-add svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--primary, #2f54e8); }
.dz-empty strong { font-size: 14px; color: var(--ink, #202b42); font-weight: 600; }
.dz-empty small { font-size: 12px; color: #8a93a6; }
.dz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; padding: 12px; }
.dz-thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e9edf4; box-shadow: 0 1px 2px rgba(20, 22, 27, .08); }
.dz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-thumb figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 10px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(15, 17, 23, .62); color: #fff; font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.dz-remove:hover { background: #e5484d; }
.dz-add { aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed #c9d0de; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; color: #6b7489; background: #fff; }
.dz-add svg { width: 22px; height: 22px; }
.dz-count { display: block; padding: 0 12px 10px; font-size: 12px; color: #8a93a6; }
.dz-strip { display: flex; gap: 8px; padding: 6px 12px 2px; overflow-x: auto; }
.dz-strip[hidden] { display: none; }
.dz-strip .dz-thumb { width: 64px; height: 64px; flex: none; aspect-ratio: auto; }
.dz-strip .dz-thumb figcaption { display: none; }
.dz-strip .dz-remove { width: 20px; height: 20px; font-size: 14px; top: 3px; right: 3px; }

/* 玩家端：大号选择面板 */
.picker-trigger { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border: 1px solid var(--line, #e7ebf2); border-radius: 12px; background: #fff; color: var(--ink, #202b42); font: inherit; font-size: 15px; font-weight: 400; text-align: left; cursor: pointer; }
.picker-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-trigger.placeholder span { color: #9aa3b5; }
.picker-trigger svg { width: 18px; height: 18px; flex: none; stroke: #8a93a6; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.picker-trigger:focus-visible { outline: none; border-color: var(--primary, #5264e4); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #5264e4) 20%, transparent); }
.picker-trigger:disabled { opacity: .55; cursor: not-allowed; }
.picker-trigger.compact { width: auto; min-height: 36px; padding: 0 8px 0 10px; border: 0; background: transparent; font-size: 13px; color: var(--muted, #7c879d); gap: 4px; }
.picker-trigger.compact svg { width: 15px; height: 15px; }
dialog.picker-sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 580px; max-height: 80dvh; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -10px 40px rgba(20, 30, 60, .18); animation: picker-up .2s ease-out; }
dialog.picker-sheet::backdrop { background: rgba(15, 20, 35, .45); }
@keyframes picker-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.picker-panel { display: flex; flex-direction: column; max-height: 80dvh; padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); }
.picker-grip { width: 40px; height: 4px; border-radius: 2px; background: #d6dbe5; margin: 2px auto 10px; flex: none; }
.picker-panel h3 { margin: 0; padding: 0 20px 10px; font-size: 14px; font-weight: 600; color: #7c879d; }
.picker-options { overflow-y: auto; padding: 0 10px; }
.picker-options button { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 16px; color: var(--ink, #202b42); text-align: left; cursor: pointer; }
.picker-options button:hover, .picker-options button:focus-visible { background: #f2f4f9; outline: none; }
.picker-options button[aria-selected="true"] { color: var(--primary, #5264e4); font-weight: 600; background: color-mix(in srgb, var(--primary, #5264e4) 8%, #fff); }
.picker-options button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.picker-options button:disabled { opacity: .45; }
.picker-cancel { margin: 8px 20px 0; min-height: 50px; border: 0; border-radius: 12px; background: #f2f4f9; font: inherit; font-size: 16px; font-weight: 600; color: #4b556b; cursor: pointer; }

/* 弹窗内的提交失败提示：固定在按钮上方 */
.dialog-error { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 20px; background: #fff1f1; border-top: 1px solid #f6c9cb; color: #b42328; font-size: 13.5px; line-height: 1.5; animation: dialog-error-in .2s ease-out; }
.dialog-error[hidden] { display: none; }
.dialog-error svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
@keyframes dialog-error-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 提示放在浏览器顶层（popover），抵消浏览器默认的 popover 定位与边框 */
#toast[popover] { top: auto; right: auto; margin: 0; border: 0; overflow: visible; width: max-content; height: auto; inset-block-start: auto; }
#toast[popover]:not(:popover-open) { display: none; }
#toast.error { background: #c9363b; }

/* 表单提交卡片（对话中显示在对应消息下方，两端共用） */
.form-card { margin-top: 8px; max-width: 420px; background: #fff; border: 1px solid #e3e7f0; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(20, 30, 60, .05); text-align: left; }
.form-card-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: color-mix(in srgb, var(--primary, #2f54e8) 7%, #fff); border-bottom: 1px solid #e3e7f0; color: var(--primary, #2f54e8); }
.form-card-head svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.form-card-head strong { font-size: 13px; color: var(--ink, #202b42); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-card-head span { font-size: 11px; color: #8a93a6; }
.form-card dl { margin: 0; padding: 4px 14px; }
.form-card dl > div { display: grid; grid-template-columns: minmax(72px, 34%) 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #edf0f5; font-size: 13px; line-height: 1.5; }
.form-card dl > div:last-child { border-bottom: 0; }
.form-card dt { color: #7c879d; }
.form-card dd { margin: 0; color: var(--ink, #202b42); white-space: pre-wrap; word-break: break-word; }
.form-card-empty { color: #b0b7c6; }
body.player .message.player .form-card { margin-left: auto; }
.message.flash .bubble, .message.flash .form-card { animation: form-flash 1.4s ease-out; }
@keyframes form-flash { 0%, 30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #2f54e8) 35%, transparent); } 100% { box-shadow: none; } }
.form-jump-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.form-jump { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line, #e7ebf2); border-radius: 10px; background: #fff; font-size: 13px; text-align: left; cursor: pointer; }
.form-jump:hover { border-color: var(--primary, #2f54e8); }
.form-jump span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-jump small { color: #8a93a6; font-size: 11.5px; }

/* 缩略图上的「标注」按钮 */
.dz-edit { position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border: 0; border-radius: 6px; background: rgba(15, 17, 23, .7); color: #fff; font-size: 11px; cursor: pointer; z-index: 1; }
.dz-edit:hover { background: var(--primary, #2f54e8); }
.dz-edit svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dz-thumb:has(.dz-edit) figcaption { display: none; }
.dz-strip .dz-edit { left: 3px; bottom: 3px; height: 20px; padding: 0 5px; }
.dz-strip .dz-edit span { display: none; }

/* 截图标注编辑器 */
dialog.image-editor { width: min(1240px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 16px; background: #1b1e26; color: #e8ebf2; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
dialog.image-editor::backdrop { background: rgba(8, 10, 14, .72); }
.ie-card { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.ie-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #2c303b; }
.ie-group { display: flex; align-items: center; gap: 4px; }
.ie-group + .ie-group { padding-left: 14px; border-left: 1px solid #2c303b; }
.ie-tool { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: #c9cfdb; font-size: 12.5px; cursor: pointer; }
.ie-tool svg { width: 18px; height: 18px; }
.ie-tool:hover:not(:disabled) { background: #2a2e39; color: #fff; }
.ie-tool.active { background: var(--primary, #2f54e8); color: #fff; }
.ie-tool:disabled { opacity: .35; cursor: default; }
.ie-color, .ie-custom { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #1b1e26; background: var(--c); box-shadow: 0 0 0 1px #4a4f5c; cursor: pointer; padding: 0; }
.ie-color.active { box-shadow: 0 0 0 2px #fff; }
.ie-custom { background: conic-gradient(#e5484d, #ffc53d, #30a46c, #0090ff, #8e4ec6, #e5484d); overflow: hidden; }
.ie-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ie-width { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.ie-width i { display: block; border-radius: 50%; background: #c9cfdb; }
.ie-width:hover { background: #2a2e39; }
.ie-width.active { background: #2a2e39; box-shadow: inset 0 0 0 1px #5b6170; }
.ie-width.active i { background: #fff; }
.ie-stage { position: relative; flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 16px; background: repeating-conic-gradient(#20242d 0 25%, #242833 0 50%) 0 0 / 20px 20px; }
.ie-stage canvas { display: block; box-shadow: 0 6px 30px rgba(0, 0, 0, .45); touch-action: none; }
.ie-text-input { position: absolute; min-width: 140px; max-width: 60%; padding: 2px 4px; border: 1px dashed rgba(255, 255, 255, .8); border-radius: 4px; background: rgba(0, 0, 0, .25); font-weight: 600; line-height: 1.25; resize: none; outline: none; }
.ie-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid #2c303b; }
.ie-footer small { color: #8a93a6; font-size: 12px; }
.ie-actions { display: flex; gap: 8px; margin-left: auto; }
.ie-actions .button.secondary { background: #2a2e39; border-color: #3a3f4c; color: #e8ebf2; }
@media (max-width: 720px) { .ie-tool span { display: none; } .ie-group + .ie-group { padding-left: 8px; } .ie-footer small { display: none; } }

/* 图片大图查看 */
dialog.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
dialog.lightbox::backdrop { background: rgba(8, 10, 14, .88); }
.lb-stage { position: absolute; inset: 0; overflow: hidden; cursor: zoom-out; touch-action: none; user-select: none; }
.lb-stage.is-zoomed { cursor: grab; }
.lb-stage.is-zoomed.is-dragging { cursor: grabbing; }
.lb-image { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); opacity: 0; transition: opacity .15s; will-change: transform; }
.lb-image.ready { opacity: 1; }
.lb-toolbar { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 12px; background: rgba(28, 31, 40, .92); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); color: #e8ebf2; }
.lb-toolbar button { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lb-toolbar button:hover { background: rgba(255, 255, 255, .12); }
.lb-toolbar svg { width: 18px; height: 18px; }
.lb-percent { min-width: 52px; text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; color: #c9cfdb; }
.lb-sep { width: 1px; height: 20px; margin: 0 4px; background: rgba(255, 255, 255, .15); }
.lb-hint { position: absolute; left: 0; right: 0; top: 14px; margin: 0; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .55); pointer-events: none; }
.message img, .bubble img { cursor: zoom-in; }

/* 宽屏：贴着按钮展开的下拉菜单 */
dialog.picker-sheet.picker-dropdown { inset: auto; margin: 0; max-width: none; border-radius: 12px; border: 1px solid #e3e6ee; box-shadow: 0 12px 32px rgba(20, 28, 48, .18); overflow: hidden; animation: none; }
dialog.picker-sheet.picker-dropdown::backdrop { background: transparent; }
.picker-dropdown .picker-panel { max-height: inherit; padding: 6px 0; }
.picker-dropdown .picker-grip, .picker-dropdown .picker-cancel { display: none; }
.picker-dropdown .picker-options { padding: 0 6px; }
.picker-dropdown .picker-options button { min-height: 40px; padding: 0 12px; border-radius: 8px; font-size: 14px; }
.picker-dropdown .picker-options button svg { width: 16px; height: 16px; }
dialog.picker-sheet.picker-dropdown::backdrop { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
