/* ============================================================
   在线售卖站 · 前台样式（基础风格复用自 download-station，macOS 视觉语言）
   ============================================================ */

@font-face { font-family: "LINE Seed JP"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/LINESeedJP_TTF_Rg.ttf") format("truetype"); }
@font-face { font-family: "LINE Seed JP"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/LINESeedJP_TTF_Bd.ttf") format("truetype"); }
:root {
    --bg: #e8ecf1;
    --sidebar-bg: rgba(245,245,247,0.74);
    --card-bg: rgba(255,255,255,0.84);
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #aeaeb2;
    --border: rgba(0,0,0,0.06);
    --border-strong: rgba(0,0,0,0.1);
    --accent: #007AFF;
    --accent-hover: #0062CC;
    --accent-light: rgba(0,122,255,0.1);
    --sidebar-width: 220px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    /* 统一动画体系（只动 transform / opacity） */
    --dur-fast: 160ms;
    --dur-base: 240ms;
    --dur-slow: 360ms;
    --ease-out: cubic-bezier(.32,.72,0,1);
    --dock-w: 76px;
}
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "LINE Seed JP", "Hiragino Maru Gothic ProN", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text); min-height: 100vh;
    -webkit-font-smoothing: antialiased; display: flex;
}
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.8; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width); height: 100vh; position: fixed; left:0; top:0;
    background: var(--sidebar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 50; padding: 0 12px;
}
.sidebar-header { padding: 28px 10px 20px; display: flex; align-items: center; gap: 10px; }
.sidebar-header .logo {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 8px;
}
.sidebar-header .title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { flex:1; position: relative; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-highlight {
    position: absolute; left: 0; width: 100%; height: 34px; border-radius: var(--radius-sm);
    background: rgba(0,122,255,0.12);
    transition: transform 0.35s cubic-bezier(0.25,0.1,0.25,1), opacity 0.25s ease;
    pointer-events: none; z-index: 0;
}
.nav-item {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 10px; padding: 7px 10px;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 450;
    color: var(--text); cursor: pointer; border: none; background: none; font-family: inherit;
    transition: color 0.3s ease, font-weight 0.3s ease; text-align: left; width: 100%;
}
.nav-item:hover { color: var(--accent); }
.nav-item.active { color: var(--accent); font-weight: 550; }
.nav-item.active .nav-badge, .nav-item:hover .nav-badge { color: var(--accent); opacity: 0.6; }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; transition: transform 0.25s ease; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { transform: scale(1.1); }
.nav-item .nav-badge { margin-left: auto; font-size: 11px; color: var(--text-tertiary); font-weight: 450; transition: color 0.3s ease; }
.nav-sub { max-height: 0; overflow: hidden; transition: max-height 0.35s cubic-bezier(0.25,0.1,0.25,1), opacity 0.3s ease, padding 0.35s cubic-bezier(0.25,0.1,0.25,1); display: flex; flex-direction: column; gap: 1px; padding: 0; opacity: 0; }
.nav-sub.expanded { max-height: 600px; padding: 2px 0; opacity: 1; }
.nav-sub-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 38px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 400; font-family: inherit;
    color: var(--text-secondary); cursor: pointer; border: 0; background: 0;
    text-align: left; width: 100%; transition: all var(--transition); white-space: nowrap;
}
.nav-sub-item:hover { color: var(--accent); background: rgba(0,122,255,0.04); }
.nav-sub-item.active { color: var(--accent); font-weight: 550; background: rgba(0,122,255,0.08); }
.sidebar-footer { padding: 12px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* Main */
.main { margin-left: var(--sidebar-width); flex:1; min-height: 100vh; padding: 32px 36px; max-width: calc(100vw - var(--sidebar-width)); }
.main-content-wrap { animation: contentFadeIn 0.35s cubic-bezier(0.25,0.1,0.25,1); }
@keyframes contentFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Titlebar */
.titlebar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.titlebar-left { display: flex; align-items: center; gap: 14px; }
.titlebar h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.badge { font-size: 12px; font-weight: 550; color: var(--text-secondary); background: rgba(0,0,0,0.04); padding: 3px 10px; border-radius: 20px; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-field { flex:1; min-width: 200px; max-width: 420px; position: relative; }
.search-field .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 14px; pointer-events: none; }
.search-field input {
    width: 100%; height: 36px; padding: 0 36px 0 34px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 13px; font-family: inherit;
    background: var(--card-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: var(--text); outline: none; transition: all var(--transition);
}
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); background: #fff; }
.search-field input::placeholder { color: var(--text-tertiary); }
.search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; border: none; border-radius: 50%;
    background: var(--text-tertiary); color: #fff; font-size: 11px;
    cursor: pointer; display: none; align-items: center; justify-content: center;
}
.search-clear.visible { display: flex; opacity: 0.7; }
.search-clear:hover { opacity: 1; }

/* Sub-filter chips */
.sub-filter { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.sub-filter-label { font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
.sub-chip {
    display: inline-flex; align-items: center; gap: 4px;
    height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 13px;
    font-size: 12px; font-family: inherit; font-weight: 450; cursor: pointer;
    background: var(--card-bg); color: var(--text-secondary);
    transition: all var(--transition); white-space: nowrap;
}
.sub-chip:hover { border-color: var(--accent); color: var(--accent); }
.sub-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 550; }
.sub-chip .sub-chip-count { opacity: 0.6; font-size: 11px; }

/* File group header */
.file-group-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; font-size: 12px; font-weight: 600; color: var(--text-secondary);
    background: rgba(0,0,0,0.02); border-top: 1px solid var(--border);
}
.file-group-header:first-child { border-top: none; }
.file-group-header .fgh-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.file-group-header .fgh-count { font-weight: 450; opacity: 0.7; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 14px; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-family: inherit; font-weight: 500;
    cursor: pointer; transition: all var(--transition); white-space: nowrap; user-select: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); opacity: 1; }
.btn-ghost { background: rgba(0,0,0,0.04); color: var(--text); }
.btn-ghost:hover { background: rgba(0,0,0,0.08); opacity: 1; }
.btn-outline { background: #fff; border: 1px solid var(--border-strong); color: var(--accent); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); opacity: 1; }

/* Stats */
.stats-row { display: flex; gap: 12px; margin-bottom: 20px; }
.stat-card {
    flex:1; min-width: 0; background: var(--card-bg);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-label { font-size: 11px; font-weight: 550; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -0.5px; }
.stat-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

/* File List */
.file-list {
    background: var(--card-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.file-list-header {
    display: flex; align-items: center; padding: 10px 18px; gap: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 11px; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.flh-icon { width: 36px; flex-shrink: 0; }
.flh-name { flex:1; }
.flh-meta { width: 150px; text-align: right; }
.flh-actions { width: 90px; text-align: right; padding-right: 2px; }

.file-item {
    display: flex; align-items: center; padding: 0 18px; gap: 12px; height: 48px;
    border-bottom: 1px solid var(--border); transition: background var(--transition); cursor: default;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: rgba(0,0,0,0.02); }
.fi-icon { width: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.fi-icon svg { width: 28px; height: 28px; }
.fi-icon img.fi-vivid { width: 28px; height: auto; }
.fi-icon img.fi-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.fi-name { flex:1; min-width: 0; }
.fi-name-text { font-size: 13px; font-weight: 450; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-meta { width: 150px; text-align: right; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); }
.fi-actions { width: 90px; text-align: right; flex-shrink: 0; display: flex; gap: 6px; justify-content: flex-end; }
.fi-actions .btn { opacity: 0; transition: opacity var(--transition); }
.file-item:hover .fi-actions .btn { opacity: 1; }
.fi-actions .btn-dl { opacity: 1; }

/* Loading */
.loading { text-align: center; padding: 60px; color: var(--text-tertiary); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-state .empty-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.empty-state .empty-desc { font-size: 13px; color: var(--text-secondary); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.pagination button, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 8px;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; font-family: inherit;
    background: var(--card-bg); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; transition: all var(--transition);
}
.pagination button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .disabled { color: var(--text-tertiary); pointer-events: none; border-color: transparent; background: transparent; }

/* Login Modal */
.modal-overlay {
    display: none; position: fixed; inset:0; z-index: 200;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: rgba(255,255,255,0.96); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-radius: 14px; width: 90%; max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1); border: 1px solid rgba(0,0,0,0.08);
    animation: modalIn 0.3s cubic-bezier(0.25,0.1,0.25,1);
}
@keyframes modalIn { from { opacity:0; transform: translateY(24px) scale(0.95); } to { opacity:1; transform: translateY(0) scale(1); } }
.modal-header { padding: 18px 20px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border: none; border-radius: 50%; background: rgba(0,0,0,0.06); color: var(--text-secondary); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.modal-close:hover { background: rgba(0,0,0,0.12); }
.modal-body { padding: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 550; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input {
    width: 100%; height: 36px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; outline: none; transition: all var(--transition);
    background: rgba(0,0,0,0.02);
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); background: #fff; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex-shrink: 0; height: 36px; padding: 0 14px; font-size: 12px; white-space: nowrap; }
.code-row .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.error-msg { padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius-sm); background: rgba(255,59,48,0.1); color: #FF3B30; font-size: 13px; font-weight: 500; display: none; }
.error-banner { padding: 14px 18px; margin: 16px 0; border-radius: var(--radius); background: rgba(255,59,48,0.08); color: #D32F2F; font-size: 14px; font-weight: 500; border-left: 3px solid #FF3B30; line-height: 1.5; white-space: pre-wrap; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; padding: 0 8px; }
    .sidebar-header { padding: 20px 4px 16px; justify-content: center; }
    .sidebar-header .title { display: none; }
    .nav-item { justify-content: center; padding: 8px 0; }
    .nav-item span:not(.nav-icon) { display: none; }
    .main { margin-left: 60px; padding: 20px 16px; max-width: calc(100vw - 60px); }
    .titlebar h1 { font-size: 18px; }
    .stats-row { flex-direction: column; }
    .flh-meta, .fi-meta { display: none; }
    .flh-actions, .fi-actions { width: 60px; }
}

/* 支付二维码弹窗 */
.modal-qr { max-width: 360px; }
.qr-box-wrap { display: flex; justify-content: center; padding: 6px 0 12px; }
.qr-box { width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 12px; overflow: hidden; }
.qr-box img, .qr-box canvas { max-width: 220px; max-height: 220px; }
.qr-box iframe { width: 220px; height: 220px; border: 0; }
.qr-status { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.qr-info { border-top: 1px solid var(--border); padding-top: 12px; }
.qr-row { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; }
.qr-label { color: var(--text-tertiary); flex-shrink: 0; margin-right: 10px; }
.qr-value { color: var(--text); font-weight: 550; word-break: break-all; text-align: right; }
.qr-cashier { display: block; text-align: center; margin-top: 12px; font-size: 13px; }

.lang-switch {
    display: inline-flex; align-items: center; gap: 4px;
    height: 28px; padding: 0 10px;
    border: 1px solid var(--border-strong); border-radius: 14px;
    background: var(--card-bg); color: var(--text-secondary);
    font-size: 11px; font-weight: 600; cursor: pointer;
    transition: all var(--transition); font-family: inherit;
}
.lang-switch:hover { color: var(--accent); border-color: var(--accent); }
.lang-switch-icon { font-size: 13px; }
.lang-switch-wrap { position: relative; }
.lang-switch .lang-caret { font-size: 9px; transition: transform 0.25s cubic-bezier(0.22,0.61,0.36,1); }
.lang-switch-wrap.open .lang-caret { transform: rotate(180deg); }
.lang-menu {
    position: absolute; bottom: calc(100% + 10px); left: 0;
    min-width: 128px; padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; gap: 2px;
    opacity: 0; visibility: hidden;
    transform: translateY(12px) scale(0.94);
    transform-origin: bottom left;
    transition: opacity 0.22s cubic-bezier(0.22,0.61,0.36,1), transform 0.22s cubic-bezier(0.22,0.61,0.36,1), visibility 0.22s;
    z-index: 300;
}
.lang-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.lang-menu-item {
    display: flex; align-items: center; width: 100%; padding: 9px 12px;
    border: none; border-radius: 8px; background: transparent;
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    cursor: pointer; text-align: left; font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.lang-menu-item:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.lang-menu-item.active { color: var(--accent); font-weight: 600; }

/* Download progress bar */
.download-bar {
    display: none;
    position: fixed; bottom: 0; left: var(--sidebar-width); right: 0;
    height: 3px; z-index: 300;
}
.download-bar.active { display: block; }
.download-bar-track {
    width: 100%; height: 100%;
    background: rgba(0,122,255,0.08);
    position: relative; overflow: hidden;
}
.download-bar-indicator {
    position: absolute; top: 0; height: 100%;
    width: 28%;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    border-radius: 2px;
    animation: downloadShuttle 1.6s cubic-bezier(0.45,0,0.55,1) infinite alternate;
}
@keyframes downloadShuttle {
    from { left: -28%; }
    to { left: 100%; }
}

/* ================= 在线售卖站 · 前台扩展样式 ================= */
/* 覆盖旧侧边栏布局为顶栏布局（视觉语言保持一致） */
body {
    display: block;
    background:
        radial-gradient(1100px 520px at 50% -180px, rgba(0,122,255,0.10), transparent 70%),
        var(--bg);
    background-attachment: fixed;
    padding-bottom: 0;
}
html[data-theme="dark"] {
    --bg: #0d0d0f;
    --sidebar-bg: rgba(28,28,30,0.72);
    --card-bg: rgba(38,38,41,0.84);
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #8e8e93;
    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.14);
    --accent: #0A84FF;
    --accent-hover: #409CFF;
    --accent-light: rgba(10,132,255,0.16);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.36);
    --shadow: 0 2px 16px rgba(0,0,0,0.46);
}
html[data-theme="dark"] body {
    background:
        radial-gradient(1100px 520px at 50% -180px, rgba(10,132,255,0.16), transparent 70%),
        var(--bg);
}
html[data-theme="dark"] .btn-ghost { background: rgba(255,255,255,0.08); }
html[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,0.13); }
html[data-theme="dark"] .btn-outline { background: rgba(255,255,255,0.05); }
html[data-theme="dark"] .lang-menu-item:hover { background: rgba(255,255,255,0.08); }

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 120;
    height: 60px; display: flex; align-items: center; gap: 14px;
    padding: 0 24px;
    background: var(--sidebar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 9px; cursor: pointer; flex-shrink: 0; }
.brand img { width: 26px; height: 26px; border-radius: 7px; box-shadow: var(--shadow-sm); }
.brand span { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); }
.topnav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.topnav a {
    padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); transition: all var(--transition);
}
.topnav a:hover { background: rgba(0,0,0,0.05); color: var(--text); opacity: 1; }
.topnav a.active { color: var(--accent); background: var(--accent-light); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
    width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-strong); border-radius: 50%;
    background: var(--card-bg); color: var(--text-secondary); cursor: pointer;
    transition: all var(--transition); font-size: 13px;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.topbar .lang-menu { top: calc(100% + 10px); bottom: auto; right: 0; left: auto; }

/* ---------- 容器与页头 ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 26px 24px 60px; }
.hero { padding: 26px 0 18px; }
.hero h1 {
    font-size: 30px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.24;
    background: linear-gradient(92deg, var(--text) 20%, var(--accent) 130%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { margin-top: 9px; font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.hero-search { margin-top: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box {
    position: relative; flex: 1; min-width: 240px; max-width: 420px;
}
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text-tertiary); fill: none; stroke-width: 2; }
.search-box input {
    width: 100%; height: 40px; padding: 0 14px 0 36px;
    border: 1px solid var(--border-strong); border-radius: 20px;
    background: var(--card-bg); color: var(--text); font-size: 13.5px; font-family: inherit;
    transition: all var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); }
.search-box input::placeholder { color: var(--text-tertiary); }

/* 公告条 */
.notice-bar {
    display: none; align-items: center; gap: 10px; margin-bottom: 16px;
    padding: 11px 16px; border-radius: var(--radius);
    background: var(--accent-light); border: 1px solid rgba(0,122,255,0.18);
    font-size: 12.5px; color: var(--accent); line-height: 1.5;
}
.notice-bar.show { display: flex; }
.notice-bar svg { width: 15px; height: 15px; flex-shrink: 0; fill: currentColor; }

/* 分类胶囊 */
.cat-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 20px; }
.chip {
    height: 30px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--border-strong); border-radius: 15px;
    background: var(--card-bg); color: var(--text-secondary);
    font-size: 12.5px; font-weight: 500; font-family: inherit; cursor: pointer;
    transition: all var(--transition);
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(0,122,255,0.28); }
.chip .chip-count { font-size: 11px; opacity: 0.72; }

/* 工具栏 */
.list-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list-toolbar .result-count { font-size: 12.5px; color: var(--text-secondary); }
.select-mini {
    height: 30px; padding: 0 10px; border-radius: 8px; font-family: inherit;
    border: 1px solid var(--border-strong); background: var(--card-bg);
    color: var(--text-secondary); font-size: 12.5px; cursor: pointer;
}
.select-mini:focus { outline: none; border-color: var(--accent); }

/* ---------- 商品网格 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.product-card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    cursor: pointer; transition: transform 0.25s cubic-bezier(0.22,0.61,0.36,1), box-shadow 0.25s, border-color 0.25s;
    opacity: 0; animation: cardIn var(--dur-slow) var(--ease-out) both; animation-delay: var(--d, 0ms);
}
@keyframes cardIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform:none; } }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,0.10); border-color: var(--border-strong); }
html[data-theme="dark"] .product-card:hover { box-shadow: 0 14px 34px rgba(0,0,0,0.55); }
.pc-cover {
    position: relative; aspect-ratio: 16 / 10; overflow: hidden;
    background: linear-gradient(140deg, rgba(0,122,255,0.10), rgba(0,122,255,0.02));
    display: flex; align-items: center; justify-content: center;
}
.pc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-cover .pc-ph { font-size: 40px; opacity: 0.5; }
.pc-cover .pc-ph img { width: 44px; height: 44px; }
.pc-tag {
    position: absolute; top: 10px; left: 10px;
    padding: 3px 9px; border-radius: 8px;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 10.5px; font-weight: 600;
    backdrop-filter: blur(8px); letter-spacing: 0.2px;
}
.pc-tag.free { background: rgba(52,199,89,0.92); }
.pc-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-title {
    font-size: 14px; font-weight: 600; line-height: 1.42; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-sub {
    font-size: 12px; color: var(--text-secondary); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 4px; }
.pc-price { display: flex; align-items: baseline; gap: 5px; }
.pc-price .cur { font-size: 11px; font-weight: 600; color: var(--accent); }
.pc-price .num { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: -0.4px; }
.pc-price .num.free { color: #34C759; }
.pc-price .old { font-size: 11.5px; color: var(--text-tertiary); text-decoration: line-through; }
.pc-meta { font-size: 11px; color: var(--text-tertiary); display: flex; gap: 8px; }

/* 骨架屏 */
.skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.skel {
    height: 246px; border-radius: var(--radius-lg);
    background: linear-gradient(100deg, rgba(0,0,0,0.045) 30%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.045) 70%);
    background-size: 220% 100%; animation: shimmer 1.3s infinite linear;
}
html[data-theme="dark"] .skel {
    background: linear-gradient(100deg, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.05) 70%);
    background-size: 220% 100%;
}
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -60% 0; } }

/* ---------- 详情页 ---------- */
.detail-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 26px; align-items: start; }
.d-cover {
    border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
    background: linear-gradient(140deg, rgba(0,122,255,0.10), rgba(0,122,255,0.02));
    aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
}
.d-cover img { width: 100%; height: 100%; object-fit: cover; }
.d-cover .pc-ph img { width: 72px; height: 72px; }
.d-info { display: flex; flex-direction: column; gap: 14px; }
.d-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-light); padding: 4px 10px; border-radius: 8px; width: fit-content; }
.d-title { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.32; color: var(--text); }
.d-sub { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; margin-top: -6px; }
.d-price-box {
    display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
    padding: 16px 18px; border-radius: var(--radius);
    background: var(--card-bg); border: 1px solid var(--border);
}
.d-price-box .cur { font-size: 13px; font-weight: 600; color: var(--accent); }
.d-price-box .num { font-size: 32px; font-weight: 700; color: var(--accent); letter-spacing: -1px; line-height: 1; }
.d-price-box .num.free { color: #34C759; }
.d-price-box .old { font-size: 13px; color: var(--text-tertiary); text-decoration: line-through; margin-bottom: 4px; }
.d-price-box .sold { margin-left: auto; font-size: 11.5px; color: var(--text-tertiary); }
.d-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-lg { height: 44px; padding: 0 26px; font-size: 14px; font-weight: 600; border-radius: var(--radius); }
.btn-block { width: 100%; justify-content: center; }
.d-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.spec-item { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(0,0,0,0.025); border: 1px solid var(--border); }
html[data-theme="dark"] .spec-item { background: rgba(255,255,255,0.04); }
.spec-k { font-size: 10.5px; color: var(--text-tertiary); letter-spacing: 0.3px; text-transform: uppercase; }
.spec-v { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--text); word-break: break-all; }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.d-desc {
    padding: 20px 22px; border-radius: var(--radius);
    background: var(--card-bg); border: 1px solid var(--border);
    font-size: 13.5px; line-height: 1.85; color: var(--text-secondary);
    white-space: pre-wrap; word-break: break-word;
}
.pay-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.pay-opt {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    border: 1.5px solid var(--border-strong); border-radius: var(--radius);
    background: var(--card-bg); cursor: pointer; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); transition: all var(--transition); font-family: inherit;
}
.pay-opt:hover { border-color: var(--accent); }
.pay-opt.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.pay-opt .dot { width: 15px; height: 15px; border-radius: 50%; }
.pay-opt .dot.alipay { background: #1677FF; }
.pay-opt .dot.wxpay { background: #07C160; }
.pay-opt .dot.qqpay { background: #12B7F5; }
.buy-tip { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.6; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.back-link:hover { color: var(--accent); }
.qr-hint { font-size: 12px; color: var(--text-secondary); text-align: center; }

/* ---------- 订单查询 ---------- */
.panel-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 22px;
}
.order-search-box { display: flex; gap: 10px; flex-wrap: wrap; }
.order-search-box input {
    flex: 1; min-width: 240px; height: 44px; padding: 0 16px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: var(--bg); color: var(--text); font-size: 13.5px; font-family: inherit;
}
.order-search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); }
.order-result { margin-top: 18px; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.order-no { font-size: 12.5px; color: var(--text-secondary); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.order-no b { color: var(--text); font-weight: 600; }
.order-rows { display: flex; flex-direction: column; gap: 0; }
.order-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.order-row:last-child { border-bottom: none; }
.order-row .k { color: var(--text-secondary); flex-shrink: 0; }
.order-row .v { color: var(--text); font-weight: 500; text-align: right; word-break: break-all; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.status-badge.paid { background: rgba(52,199,89,0.14); color: #248A3D; }
.status-badge.pending { background: rgba(255,159,10,0.16); color: #B36B00; }
.status-badge.closed { background: rgba(142,142,147,0.16); color: var(--text-secondary); }
html[data-theme="dark"] .status-badge.paid { color: #30D158; }
html[data-theme="dark"] .status-badge.pending { color: #FF9F0A; }
.dl-box { margin-top: 16px; padding: 15px 16px; border-radius: var(--radius); background: rgba(52,199,89,0.08); border: 1px solid rgba(52,199,89,0.22); }
.dl-box .dl-title { font-size: 12.5px; font-weight: 600; color: #248A3D; margin-bottom: 8px; }
html[data-theme="dark"] .dl-box .dl-title { color: #30D158; }
.dl-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dl-link input {
    flex: 1; min-width: 200px; height: 34px; padding: 0 10px; font-size: 11.5px;
    border: 1px solid rgba(52,199,89,0.28); border-radius: 8px;
    background: rgba(255,255,255,0.7); color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
html[data-theme="dark"] .dl-link input { background: rgba(0,0,0,0.28); }
.hint { font-size: 12px; color: var(--text-tertiary); line-height: 1.7; }

/* ---------- 页脚 ---------- */
.site-footer {
    margin-top: 56px; padding: 26px 24px 34px; border-top: 1px solid var(--border);
    text-align: center; font-size: 11.5px; color: var(--text-tertiary); line-height: 1.9;
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }

/* ---------- 购买成功 / 等待支付 ---------- */
.pay-state { text-align: center; padding: 26px 18px; }
.pay-state .ic { font-size: 34px; margin-bottom: 10px; }
.pay-state h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.pay-state p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .d-cover { aspect-ratio: 16 / 10; }
}
@media (max-width: 768px) {
    .topbar { height: 56px; padding: 0 14px; }
    .topnav { display: none; }
    .brand span { font-size: 14px; }
    .container { padding: 18px 14px 46px; }
    .hero { padding: 14px 0 12px; }
    .hero h1 { font-size: 23px; }
    .product-grid, .skel-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
    .pc-body { padding: 10px 11px 12px; }
    .pc-title { font-size: 12.8px; }
    .pc-price .num { font-size: 15px; }
    .d-title { font-size: 20px; }
    .d-price-box .num { font-size: 26px; }
    .btn-lg { height: 42px; padding: 0 18px; font-size: 13.5px; }
    .panel-card { padding: 16px; }
    .order-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .order-row .v { text-align: left; }
}

/* ---------------- 自定义交付（付费后展示内容） ---------------- */
.order-delivery {
    margin-top: 14px;
    padding: 16px 16px 14px;
    border-radius: 14px;
    background: rgba(175, 82, 222, 0.06);
    border: 1px solid rgba(175, 82, 222, 0.18);
}
.order-delivery .od-ready { font-size: 13px; font-weight: 600; color: #AF52DE; margin-bottom: 8px; }
.order-delivery .delivery-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.order-delivery .delivery-content {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 320px;
    overflow: auto;
}
.order-delivery .od-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-maxfile { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
@media (max-width: 640px) {
    .order-delivery { padding: 14px; }
}



/* ============================================================
   交互与动画体系（统一耗时/缓动，只动 transform 与 opacity）
   ============================================================ */

/* ---------- 1. Dock 侧边栏 ---------- */
.shop-dock {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--dock-w); z-index: 110;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 8px 14px;
    background: var(--sidebar-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-right: 1px solid var(--border);
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
body.dock-collapsed .shop-dock { transform: translateX(-100%); opacity: 0; pointer-events: none; }
.dock-brand {
    width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
    margin-bottom: 6px; flex-shrink: 0; overflow: hidden;
    transition: transform var(--dur-fast) var(--ease-out);
}
.dock-brand:hover { transform: scale(1.06); }
.dock-brand img { width: 100%; height: 100%; object-fit: contain; }
.dock-nav {
    position: relative; width: 100%; flex: 1; min-height: 0;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    overflow-y: auto; overflow-x: hidden; padding: 2px 0;
    scrollbar-width: none;
}
.dock-nav::-webkit-scrollbar { display: none; }
.dock-highlight {
    position: absolute; left: 8px; right: 8px; top: 0; height: 44px; border-radius: 13px;
    background: rgba(0,122,255,0.14); box-shadow: inset 0 0 0 1px rgba(0,122,255,0.16);
    opacity: 0; z-index: 0; pointer-events: none;
    transition: transform var(--dur-base) var(--ease-out), height var(--dur-base) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.dock-highlight.on { opacity: 1; }
html[data-theme="dark"] .dock-highlight { background: rgba(10,132,255,0.26); }
.dock-item {
    position: relative; z-index: 1; flex-shrink: 0;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 13px; background: transparent; color: var(--text-secondary);
    cursor: pointer; font-family: inherit;
    transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}
.dock-item img { width: 22px; height: 22px; display: block; transition: transform var(--dur-fast) var(--ease-out); }
.dock-item svg { stroke: currentColor; }
.dock-item:hover { background: rgba(0,0,0,0.05); color: var(--text); transform: translateY(-2px) scale(1.05); }
.dock-item.active { color: var(--accent); }
.dock-item.active img { transform: scale(1.08); }
.dock-item:active { transform: scale(0.95); }
.dock-item::after {
    content: attr(data-label); position: absolute; left: calc(100% + 10px); top: 50%;
    transform: translateY(-50%) translateX(-4px);
    padding: 5px 10px; border-radius: 8px; white-space: nowrap;
    background: var(--card-bg); color: var(--text); font-size: 12px; font-weight: 550;
    border: 1px solid var(--border); box-shadow: var(--shadow);
    opacity: 0; pointer-events: none; z-index: 5;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.dock-item:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.dock-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 6px; border-top: 1px solid var(--border); width: 100%; }
.dock-collapse svg { transition: transform var(--dur-base) var(--ease-out); }
body.dock-collapsed .dock-collapse svg { transform: rotate(180deg); }
.dock-reveal {
    position: fixed; left: 10px; top: 12px; z-index: 115;
    width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--border);
    background: var(--card-bg); color: var(--text-secondary); cursor: pointer;
    display: none; align-items: center; justify-content: center;
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow-sm);
    transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
body.dock-collapsed .dock-reveal { display: flex; }
.dock-reveal:hover { transform: scale(1.06); color: var(--accent); }

body.has-dock { padding-left: var(--dock-w); transition: padding-left var(--dur-base) var(--ease-out); }
body.has-dock.dock-collapsed { padding-left: 0; }

/* ---------- 2. 中置置顶搜索 ---------- */
.search-dock {
    position: sticky; top: 60px; z-index: 95;
    margin: 2px -8px 16px; padding: 12px 8px;
}
.search-dock::before {
    content: ""; position: absolute; inset: 0; border-radius: 0 0 14px 14px;
    background: transparent; border-bottom: 1px solid transparent;
    transition: background var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.search-dock.is-stuck::before {
    background: rgba(255,255,255,0.72);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-bottom-color: var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
html[data-theme="dark"] .search-dock.is-stuck::before { background: rgba(28,28,30,0.74); }
.search-dock-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.search-dock .search-box { max-width: none; min-width: 0; width: 100%; transform-origin: center; transition: transform var(--dur-base) var(--ease-out); }
.search-dock .search-box:focus-within { transform: scale(1.015); }
.search-dock .search-box input { height: 46px; border-radius: 23px; padding: 0 74px 0 42px; font-size: 14px; }
.search-dock .search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light), 0 10px 28px rgba(0,122,255,0.16);
}
.sb-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); display: flex; pointer-events: none; }
.sb-icon svg { position: static; transform: none; width: 16px; height: 16px; stroke: var(--text-tertiary); transition: transform var(--dur-base) var(--ease-out), stroke var(--dur-base) var(--ease-out); }
.search-box:focus-within .sb-icon svg { transform: translateX(2px); stroke: var(--accent); }
.search-kbd {
    position: absolute; right: 42px; top: 50%; transform: translateY(-50%);
    padding: 2px 7px; border-radius: 6px; font-family: inherit; font-size: 10.5px; font-weight: 600;
    color: var(--text-tertiary); background: rgba(0,0,0,0.05); border: 1px solid var(--border);
    pointer-events: none; transition: opacity var(--dur-fast) var(--ease-out);
}
.search-box:focus-within .search-kbd { opacity: 0; }
.search-clear {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%) scale(0.8);
    width: 22px; height: 22px; border: none; border-radius: 50%; cursor: pointer;
    background: rgba(0,0,0,0.08); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.search-box.has-value .search-clear { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }
.search-clear:hover { background: rgba(0,0,0,0.16); }

/* 搜索建议浮层 */
.search-suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 3;
    max-height: min(58vh, 420px); overflow-y: auto; overflow-x: hidden;
    padding: 6px; border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.92);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid var(--border); box-shadow: 0 20px 48px rgba(0,0,0,0.16);
    opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.99);
    transform-origin: top center;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out),
                visibility var(--dur-fast) var(--ease-out);
}
html[data-theme="dark"] .search-suggest { background: rgba(30,30,32,0.94); }
.search-suggest.open { opacity: 1; visibility: visible; transform: none; }
.sg-item {
    width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
    padding: 8px 10px; border: none; border-radius: 10px; background: transparent;
    cursor: pointer; font-family: inherit;
    transition: background var(--dur-fast) var(--ease-out);
}
.sg-item.active, .sg-item:hover { background: rgba(0,122,255,0.09); }
.sg-thumb {
    width: 42px; height: 34px; border-radius: 8px; flex-shrink: 0; object-fit: cover;
    background: rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sg-thumb .sg-ph { width: 16px; height: 16px; opacity: .6; }
.sg-main { flex: 1; min-width: 0; }
.sg-title { font-size: 13px; font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-meta { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 11px; color: var(--text-tertiary); }
.sg-badge { padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 600; }
.sg-badge.file { color: #0071E3; background: rgba(0,113,227,0.12); }
.sg-badge.custom { color: #AF52DE; background: rgba(175,82,222,0.12); }
.sg-price { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--accent); }
.sg-price.free { color: #34C759; }
.sg-empty { padding: 26px 14px; text-align: center; font-size: 12.5px; color: var(--text-secondary); }
.sg-empty img { width: 32px; height: 32px; opacity: .35; display: block; margin: 0 auto 8px; }
.sg-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 4px; padding: 8px 10px 4px; border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--text-tertiary);
}
.sg-foot kbd { padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border); background: rgba(0,0,0,0.04); font-family: inherit; font-size: 10.5px; }
mark.sg-hl { background: rgba(0,122,255,0.16); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- 3. 视图切换 / 卡片入场 ---------- */
.view-enter { animation: viewIn var(--dur-base) var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.product-grid.grid-swap { animation: gridFade var(--dur-base) var(--ease-out); }
@keyframes gridFade { from { opacity: 0.35; } to { opacity: 1; } }
.product-card:hover { transform: translateY(-3px); }
.product-card .pc-cover img { transition: transform var(--dur-base) var(--ease-out); will-change: transform; }
.product-card:hover .pc-cover img { transform: scale(1.02); }
.detail-grid > * { animation: viewIn var(--dur-slow) var(--ease-out) both; }
.detail-grid > *:nth-child(1) { animation-delay: 0ms; }
.detail-grid > *:nth-child(2) { animation-delay: 60ms; }
.detail-grid > *:nth-child(3) { animation-delay: 120ms; }

/* ---------- 4. 弹窗（淡入 + 面板缩放位移，关闭反向） ---------- */
.modal-overlay {
    display: flex; opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out), visibility var(--dur-base) var(--ease-out);
}
.modal-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.modal {
    animation: none !important;
    opacity: 0; transform: translateY(10px) scale(0.96);
    transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.modal-overlay.active .modal { opacity: 1; transform: none; }
body.modal-open { overflow: hidden; }

/* ---------- 5. 按钮按压 / loading ---------- */
.btn { transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out),
                   box-shadow var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn[disabled], .btn.is-loading { pointer-events: none; opacity: 0.68; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 15px; height: 15px;
    margin: -7.5px 0 0 -7.5px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.45); border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}
.btn-ghost.is-loading::after, .btn-outline.is-loading::after {
    border-color: rgba(0,0,0,0.18); border-top-color: var(--accent);
}

/* ---------- 6. 轻提示堆叠（前台） ---------- */
.toast-stack {
    position: fixed; left: 50%; top: 18px; z-index: 400;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transform: translateX(-50%); pointer-events: none; width: min(92vw, 480px);
}
.toast-item {
    pointer-events: auto; display: flex; align-items: center; gap: 9px; width: fit-content; max-width: 100%;
    padding: 9px 12px; border-radius: 12px; font-size: 13px; font-weight: 500;
    background: rgba(255,255,255,0.94); color: var(--text);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    animation: toastIn var(--dur-base) var(--ease-out) both;
}
.toast-item.out { animation: toastOut var(--dur-fast) var(--ease-out) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.toast-item .ti-ic { width: 16px; height: 16px; flex-shrink: 0; display: flex; }
.toast-item.success .ti-ic { color: #34C759; }
.toast-item.error .ti-ic { color: #FF3B30; }
.toast-item.warn .ti-ic { color: #FF9F0A; }
.toast-item.info .ti-ic { color: var(--accent); }
.toast-item .ti-msg { flex: 1; min-width: 0; word-break: break-word; }
.toast-item .ti-close {
    flex-shrink: 0; width: 18px; height: 18px; border: none; border-radius: 50%; cursor: pointer;
    background: rgba(0,0,0,0.06); color: var(--text-secondary); font-size: 11px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--dur-fast) var(--ease-out);
}
.toast-item .ti-close:hover { background: rgba(0,0,0,0.14); }

/* ---------- 7. 响应式 ---------- */
@media (max-width: 900px) {
    .search-dock { top: 56px; margin-left: -4px; margin-right: -4px; }
}
@media (max-width: 768px) {
    :root { --dock-w: 64px; }
    .dock-item { width: 40px; height: 40px; }
    .dock-highlight { height: 40px; }
    .search-dock-inner { max-width: 100%; }
    .search-dock .search-box input { height: 44px; font-size: 16px; padding: 0 40px 0 40px; }
    .search-kbd { display: none; }
    .search-suggest { max-height: 62vh; }
}
@media (max-width: 640px) {
    body.has-dock { padding-left: 0; }
    .shop-dock { transform: translateX(-100%); opacity: 0; pointer-events: none; }
    body.dock-open .shop-dock { transform: none; opacity: 1; pointer-events: auto; }
    body.dock-open .dock-reveal { display: none; }
    .dock-reveal { display: flex; }
}

/* ---------- 8. 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important; animation-delay: 0ms !important;
        transition-duration: 1ms !important; transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
    .product-card, .view-enter, .view-enter *, .modal, .search-dock .search-box,
    .detail-grid > *, .toast-item { transform: none !important; }
    .product-card { opacity: 1 !important; }
    .product-card:hover .pc-cover img { transform: none !important; }
}
