/* ========== 弹窗/模态框 ========== */
.tw-modal-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 1rem; animation: overlayFade 0.2s ease; }
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }

.tw-modal { background: var(--tw-bg-card); border-radius: var(--tw-radius); border: 1px solid var(--tw-border); box-shadow: 0 8px 30px rgba(0,0,0,0.3); width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto; animation: modalSlide 0.25s ease; }
@keyframes modalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.tw-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1.2rem; border-bottom: 1px solid var(--tw-border); position: sticky; top: 0; background: var(--tw-bg-card); z-index: 1; border-radius: var(--tw-radius) var(--tw-radius) 0 0; }
.tw-modal-header h3 { font-size: 1rem; font-weight: 600; }
.tw-modal-close { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: transparent; color: var(--tw-text-muted); font-size: 1.1rem; cursor: pointer; transition: all 0.2s; }
.tw-modal-close:hover { background: var(--tw-bg-secondary); color: var(--tw-text-primary); }

.tw-modal-body { padding: 1rem 1.2rem; }
.tw-modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; padding: 0.8rem 1.2rem; border-top: 1px solid var(--tw-border); }

/* 初始化弹窗 */
.tw-modal.init-modal { max-width: 600px; text-align: center; padding: 2rem; }
.init-modal h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.init-modal .upload-area { margin: 1.5rem 0; padding: 2rem; border: 2px dashed var(--tw-border); border-radius: var(--tw-radius); cursor: pointer; transition: all 0.2s; }
.init-modal .upload-area:hover { border-color: var(--tw-accent); background: var(--tw-bg-secondary); }
.init-modal .upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.init-modal .upload-text { color: var(--tw-text-secondary); }

/* Toast */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.4rem; }
.toast { padding: 0.6rem 1rem; border-radius: var(--tw-radius-sm); font-size: 0.85rem; color: #fff; animation: toastIn 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.toast.info { background: #3b82f6; }
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 快捷键面板 */
.shortcut-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0; border-bottom: 1px solid var(--tw-border); }
.shortcut-row:last-child { border-bottom: none; }
.shortcut-row kbd { display: inline-block; padding: 0.2rem 0.5rem; background: var(--tw-bg-secondary); border: 1px solid var(--tw-border); border-radius: 4px; font-family: monospace; font-size: 0.8rem; min-width: 60px; text-align: center; }
.shortcut-row span { font-size: 0.85rem; color: var(--tw-text-secondary); }

/* 滚轮选择器 */
.wheel-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.4); display: flex; align-items: flex-end; justify-content: center; }
.wheel-panel { background: var(--tw-bg-card); border-radius: var(--tw-radius) var(--tw-radius) 0 0; padding: 1rem; width: 100%; max-width: 500px; }
.wheel-cols { display: flex; gap: 0.5rem; max-height: 200px; overflow-y: auto; }
.wheel-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.wheel-item { padding: 0.5rem; font-size: 1rem; cursor: pointer; border-radius: var(--tw-radius-sm); width: 100%; text-align: center; }
.wheel-item.active { background: var(--tw-accent); color: #fff; }
.wheel-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.8rem; }

@media (max-width: 768px) {
  .tw-modal { max-width: 95vw; }
  .toast-container { left: 0.5rem; right: 0.5rem; }
  .toast { text-align: center; }
}
