:root {
    --primary: #4a6cf7;
    --primary-hover: #3a5ce5;
    --primary-light: #eef1fe;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1e293b;
    --text-2: #64748b;
    --text-3: #94a3b8;
    --border: #e2e8f0;
    --success: #22c55e;
    --success-bg: #f0fdf4;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }

/* 头部 */
.header { margin-bottom: 24px; }
.header-title { display: flex; align-items: center; gap: 14px; }
.header-title h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.subtitle { color: var(--text-2); font-size: 14px; margin-top: 2px; }

/* 图标 */
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 32px; height: 32px; color: var(--primary); }
.icon-xl { width: 40px; height: 40px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 卡片 */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header-row .card-title { margin-bottom: 0; }

/* 输入 */
.input-row { display: flex; gap: 12px; }
.input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--text-3); }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    font-family: inherit;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled {
    background: var(--text-3);
    cursor: not-allowed;
}
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #16a34a; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost {
    background: transparent;
    color: var(--text-2);
    padding: 0 12px;
    height: 36px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-warn {
    background: var(--warning);
    color: #fff;
}
.btn-warn:hover { background: #d97706; }
.btn-ai {
    background: #8b5cf6;
    color: #fff;
}
.btn-ai:hover { background: #7c3aed; }

/* AI 工作流 */
.header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.ai-status { margin-top: 12px; }
.ai-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}
.ai-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 3px;
    transition: width .3s;
    animation: aiProgress 1.5s ease-in-out infinite;
}
@keyframes aiProgress {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}
.ai-status-text {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 6px;
    text-align: center;
}
.ai-result {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.ai-result-item {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--card);
}
.ai-result-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* 文件上传 */
.file-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--bg);
}
.file-upload-zone:hover, .file-upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-upload-hint {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}
.file-upload-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 4px;
}
.file-list {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.file-list-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-2);
    max-width: 100%;
}
.file-list-item .thumb {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
}
.file-list-item .remove {
    cursor: pointer;
    color: var(--error);
    font-weight: bold;
    padding: 0 2px;
}

/* 解析结果 */
.result-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.result-cover {
    width: 180px;
    height: 240px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.result-info { flex: 1; min-width: 240px; }
.result-info .label {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 2px;
}
.result-info .value {
    font-size: 14px;
    margin-bottom: 12px;
    word-break: break-all;
}
.media-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.media-badge.video { background: #ede9fe; color: #7c3aed; }
.media-badge.image { background: #fce7f3; color: #db2777; }
.result-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 处理结果 */
#processContent {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.process-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.md5-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.md5-block { flex: 1; min-width: 200px; }
.md5-block .label {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 2px;
}
.md5-block code {
    font-size: 13px;
    font-family: "Consolas", "Monaco", monospace;
    color: var(--text);
    word-break: break-all;
}
.technique-list { list-style: none; padding: 0; }
.technique-list li {
    font-size: 13px;
    color: var(--text-2);
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.technique-list li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

/* 筛选 */
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 素材网格 */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.material-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
    position: relative;
}
.material-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.material-card.marked { border-color: var(--success); }
.material-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg);
    display: block;
}
.material-thumb-placeholder {
    width: 100%;
    height: 160px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
}
.material-body { padding: 10px 12px; }
.material-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}
.material-meta {
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.material-actions {
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
}
.material-actions .btn { height: 30px; font-size: 12px; padding: 0 10px; }
.badge-marked {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--success);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.badge-processed {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.empty-text {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-3);
    padding: 40px 0;
    font-size: 14px;
}

/* 分组标题 */
.group-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.group-header .group-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.group-header .group-actions { display: flex; gap: 6px; }

/* toast */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform .3s;
    max-width: 360px;
}
.toast.show { transform: translateX(0); }
.toast.success { background: var(--success-bg); color: #166534; border: 1px solid #bbf7d0; }
.toast.error { background: var(--error-bg); color: #991b1b; border: 1px solid #fecaca; }
.toast.warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.loading-overlay.show { display: flex; }
.loading-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.loading-box p {
    margin-top: 12px;
    color: var(--text-2);
    font-size: 14px;
}

/* 文件夹卡片 */
.folder-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}
.folder-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.folder-card.marked { border-color: var(--success); background: var(--success-bg); }
.folder-icon { width: 56px; height: 46px; margin-bottom: 8px; }
.folder-label { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.folder-meta { font-size: 12px; color: var(--text-3); line-height: 1.6; }
.folder-actions { margin-top: 10px; }
.folder-actions .btn { width: 100%; justify-content: center; }

/* 文件夹详情页 */
.folder-detail-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.folder-detail-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.folder-images-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.folder-image-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.folder-image-card:hover { box-shadow: var(--shadow-lg); }
.folder-image-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: var(--bg);
}
.folder-image-info {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-3);
}
.folder-image-info span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

/* 拼图选择模式 */
.folder-image-card.selectable { cursor: pointer; }
.folder-image-card.selectable:hover { border-color: var(--primary); }
.folder-image-card.selected { border-color: var(--primary); border-width: 3px; }
.folder-image-card.selected .folder-image-thumb { opacity: .85; }
.select-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: transparent;
}
.folder-image-card { position: relative; }
.folder-image-card.selected .select-check {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    left: 8px;
    right: auto;
}
.folder-image-card.selected {
    cursor: grab;
}
.folder-image-card.selected:active {
    cursor: grabbing;
}
.folder-image-card.dragging {
    opacity: .4;
}
.collage-hint {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff7e6;
    color: #ad6800;
    border: 1px solid #ffe58f;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* 模态对话框 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
}
.modal-dialog {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    width: 520px;
    max-width: 92vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-3);
    padding: 4px;
    border-radius: 4px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}
.form-item { margin-bottom: 14px; }
.form-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
}
.form-item textarea,
.form-item input[type="text"],
.form-item input[type="number"],
.form-item select {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
}
.form-item textarea:focus,
.form-item input:focus,
.form-item select:focus {
    outline: none;
    border-color: var(--primary);
}
.form-item input[type="color"] {
    width: 100%;
    height: 38px;
    padding: 2px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.radio-row {
    display: flex;
    gap: 20px;
    align-items: center;
}
.radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.collage-info {
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13px;
}

/* ==========================================================
   响应式 - 移动端完美适配
   断点说明:
     - 1024px 以下: 平板 / 小笔记本
     - 768px 以下: 平板竖屏 / 大手机
     - 480px 以下: 主流手机 (iPhone 12/13/14, 三星等)
     - 360px 以下: 小屏手机 (iPhone SE, 老款)
   ========================================================== */

/* 全局: 防止 iOS 字体被自动放大、长 URL 撑破容器、容器溢出横向滚动 */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    /* 禁止双指捏合缩放与双击放大 (配合 viewport meta 双保险) */
    touch-action: manipulation;
}
body {
    overflow-x: hidden;
    touch-action: manipulation;
}
img, video { max-width: 100%; height: auto; }
input, select, textarea, button { font-family: inherit; }
/* iOS 输入框默认会放大字体, font-size>=16px 可避免点击聚焦时缩放 */
input, select, textarea { font-size: 16px; }

/* ===== 平板 / 小桌面 ===== */
@media (max-width: 1024px) {
    .container { max-width: 100%; padding: 20px 16px; }
}

/* ===== 大手机 / 平板竖屏 ===== */
@media (max-width: 768px) {
    .container { padding: 16px 14px; }
    .header { gap: 10px; }
    .header-title h1 { font-size: 20px; }
    .subtitle { font-size: 13px; }
    .card { padding: 18px 14px; border-radius: 10px; }
    .card-title { font-size: 15px; }
    .card-header-row { flex-wrap: wrap; gap: 10px; }
    .input-row { flex-direction: column; }
    .input-row .btn { width: 100%; }
    .input { height: 46px; }
    .btn { height: 44px; }
    .btn-sm { height: 36px; }
    .result-content { flex-direction: column; }
    .result-cover { width: 100%; height: auto; max-height: 320px; }
    .result-info { width: 100%; }
    .result-actions .btn { flex: 1 1 calc(50% - 5px); min-width: 0; }
    #processContent { grid-template-columns: 1fr; }
    .md5-row { flex-direction: column; gap: 10px; }
    .materials-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .folder-images-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .form-row { grid-template-columns: 1fr; }
    .filter-row { flex-wrap: wrap; }
    .modal-dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); margin: 12px; }
    .modal-body { padding: 16px; }
    .modal-foot { padding: 12px 16px; flex-direction: column-reverse; }
    .modal-foot .btn { width: 100%; }
    /* Toast 安全居中, 避免遮挡操作 */
    .toast {
        top: 16px;
        left: 16px;
        right: 16px;
        max-width: none;
        text-align: center;
        transform: translateY(-200%);
    }
    .toast.show { transform: translateY(0); }
}

/* ===== 主流手机 ===== */
@media (max-width: 480px) {
    .container { padding: 12px 10px; }
    .header { flex-direction: column; align-items: stretch; }
    .header-title { gap: 10px; }
    .header-title h1 { font-size: 18px; line-height: 1.3; }
    .header > .btn,
    .header > a.btn { align-self: flex-end; height: 36px; padding: 0 14px; font-size: 13px; }
    .card { padding: 14px 12px; margin-bottom: 14px; }
    .icon-lg { width: 26px; height: 26px; }
    .btn { padding: 0 14px; font-size: 13px; }
    .btn-sm { padding: 0 10px; font-size: 12px; }
    .materials-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .folder-images-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .material-thumb,
    .material-thumb-placeholder { height: 130px; }
    .folder-image-thumb { height: 140px; }
    .folder-card { padding: 16px 10px 10px; }
    .folder-icon { width: 44px; height: 36px; }
    .folder-label { font-size: 14px; }
    .folder-meta { font-size: 11px; }
    .material-actions { padding: 6px 8px; flex-wrap: wrap; }
    .material-actions .btn { flex: 1 1 auto; height: 30px; font-size: 12px; }
    .filter-btn { padding: 6px 10px; font-size: 12px; }
    .result-actions { gap: 8px; }
    .result-actions .btn { flex: 1 1 100%; }
    .badge-marked, .badge-processed { font-size: 10px; padding: 2px 6px; }
    .group-header { padding: 6px 0; }
    .group-header .group-title { font-size: 13px; }
    .loading-box { padding: 24px 28px; }
    .file-upload-zone { padding: 18px 12px; }
    .file-upload-hint { font-size: 13px; }
    .file-upload-sub { font-size: 11px; }
    /* 模态对话框使用全屏卡片样式更适合手机 */
    .modal-dialog {
        width: 100vw;
        max-width: 100vw;
        max-height: 92vh;
        margin: 0;
        border-radius: 14px 14px 0 0;
        align-self: flex-end;
    }
    .modal { align-items: flex-end; }
}

/* ===== 小屏手机 (iPhone SE 1st / 老款 Android) ===== */
@media (max-width: 360px) {
    .container { padding: 10px 8px; }
    .card { padding: 12px 10px; }
    .header-title h1 { font-size: 16px; }
    .materials-grid,
    .folder-images-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .material-thumb,
    .material-thumb-placeholder { height: 110px; }
    .folder-image-thumb { height: 120px; }
    .btn { font-size: 12px; padding: 0 10px; }
    .btn-lg { height: 44px; font-size: 13px; padding: 0 18px; }
}

/* iOS 安全区 (刘海/底部 Home Indicator) */
@supports (padding: env(safe-area-inset-bottom)) {
    .container {
        padding-left: max(env(safe-area-inset-left), 10px);
        padding-right: max(env(safe-area-inset-right), 10px);
        padding-bottom: max(env(safe-area-inset-bottom), 12px);
    }
    .toast { top: max(env(safe-area-inset-top), 16px); }
}

/* 触摸优化: 移除桌面 hover 残留, 防止移动端"悬停状态卡死" */
@media (hover: none) {
    .btn:hover,
    .btn-primary:hover,
    .btn-success:hover,
    .btn-outline:hover,
    .btn-ghost:hover,
    .btn-warn:hover,
    .btn-ai:hover { filter: none; background-color: inherit; }
    .btn-primary:hover { background: var(--primary); }
    .btn-success:hover { background: var(--success); }
    .btn-warn:hover { background: var(--warning); }
    .btn-ai:hover { background: #8b5cf6; }
    .folder-card:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border); }
    .folder-card.marked:hover { border-color: var(--success); }
    .material-card:hover { box-shadow: var(--shadow); border-color: var(--border); }
}

/* 横屏手机时给 toast 多留点空间 */
@media (max-height: 480px) and (orientation: landscape) {
    .modal-dialog { max-height: 86vh; }
    .loading-box { padding: 18px 24px; }
}
