       * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary: #2563eb;
            --primary-light: #3b82f6;
            --primary-lighter: #dbeafe;
            --bg: #f8fafc;
            --card-bg: #ffffff;
            --text-primary: #0f172a;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --border: #e2e8f0;
            --border-light: #f1f5f9;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --radius-sm: 6px;
            --radius: 12px;
            --radius-lg: 16px;
            --radius-xl: 24px;
        }

        /* 跟随站点日夜主题：深色模式覆盖配色变量 */
        [data-theme="dark"] {
            --primary: #4a9eff;
            --primary-light: #6fb2ff;
            --primary-lighter: #182a44;
            --bg: #0f1420;
            --card-bg: #171d29;
            --text-primary: #e9eff9;
            --text-secondary: #9dabc1;
            --text-tertiary: #6d7c92;
            --border: #26313f;
            --border-light: #1b222f;
            --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
            --shadow: 0 4px 8px rgb(0 0 0 / 0.3);
            --shadow-lg: 0 10px 15px rgb(0 0 0 / 0.35);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
            background: var(--bg);
            min-height: 100vh;
            color: var(--text-primary);
            line-height: 1.6;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 20px;
        }

        /* Header */
        .header {
            text-align: center;
            margin-bottom: 50px;
            padding-top: 20px;
        }

        .header h1 {
            font-size: 3rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 12px;
            letter-spacing: -0.02em;
        }

        .header p {
            font-size: 1.125rem;
            color: var(--text-secondary);
            margin-bottom: 24px;
        }

        .plat-hint {
            margin: 0 0 12px;
            font-size: 0.8125rem;
            color: var(--text-secondary);
        }

        /* 8 个平台标签：一行放不下就换行，手机端两三个一行也不溢出 */
        .platform-tags {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 8px;
            max-width: 100%;
            margin: 0 auto;
            padding: 0;
            background: transparent;
            border: 0;
            box-shadow: none;
        }

        .tag {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 7px 14px;
            background: var(--border-light);
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-secondary);
            white-space: nowrap;
            transition: all 0.2s;
        }

        .tag:hover {
            background: var(--primary-lighter);
            color: var(--primary);
        }

        .tag-icon {
            font-size: 1.1em;
        }

        /* Main Card */
        .main-card {
            background: var(--card-bg);
            border-radius: var(--radius-xl);
            padding: 48px;
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border);
        }

        /* Input Section */
        .input-section {
            margin-bottom: 40px;
        }

        .input-wrapper {
            position: relative;
            margin-bottom: 16px;
        }

        #urlInput {
            width: 100%;
            padding: 20px 24px;
            padding-right: 140px;
            border: 2px solid var(--border);
            border-radius: var(--radius-lg);
            font-size: 1rem;
            background: var(--bg);
            transition: all 0.2s;
            color: var(--text-primary);
        }

        #urlInput:focus {
            outline: none;
            border-color: var(--primary);
            background: var(--card-bg);
            box-shadow: 0 0 0 4px var(--primary-lighter);
        }

        #urlInput::placeholder {
            color: var(--text-tertiary);
        }

        #parseBtn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            padding: 12px 24px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-size: 0.9375rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        #parseBtn:hover:not(:disabled) {
            background: var(--primary-light);
            transform: translateY(-50%) scale(1.02);
        }

        #parseBtn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        #parseBtn.loading {
            background: var(--text-tertiary);
        }

        .tips {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 16px 20px;
            background: var(--primary-lighter);
            border-radius: var(--radius);
            color: var(--primary);
            font-size: 0.875rem;
            line-height: 1.6;
        }

        .tips-icon {
            font-size: 1.25rem;
            flex-shrink: 0;
        }

        /* Loading */
        .loading {
            display: none;
            text-align: center;
            padding: 60px 20px;
        }

        .loading.active {
            display: block;
        }

        .spinner {
            width: 48px;
            height: 48px;
            border: 3px solid var(--border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .loading p {
            color: var(--text-secondary);
            font-size: 0.9375rem;
        }

        /* Error */
        .error-msg {
            display: none;
            padding: 16px 20px;
            background: #fef2f2;
            border: 1px solid #fecaca;
            border-radius: var(--radius);
            color: #dc2626;
            font-size: 0.9375rem;
            margin-bottom: 24px;
            align-items: center;
            gap: 10px;
        }

        .error-msg.active {
            display: flex;
        }

        /* Result */
        .result {
            display: none;
            animation: fadeIn 0.4s ease;
        }

        .result.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Content Info */
        .content-info {
            background: var(--bg);
            border-radius: var(--radius-lg);
            padding: 28px;
            margin-bottom: 32px;
            border: 1px solid var(--border);
        }

        .author-row {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--border);
        }

        .author-avatar {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            object-fit: cover;
            background: var(--border);
            border: 2px solid var(--card-bg);
            box-shadow: var(--shadow-sm);
        }

        .author-meta {
            flex: 1;
        }

        .author-name {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .platform-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.8125rem;
            color: var(--text-secondary);
            background: var(--card-bg);
            padding: 4px 12px;
            border-radius: 100px;
            border: 1px solid var(--border);
        }

        .content-text {
            color: var(--text-primary);
            line-height: 1.8;
            font-size: 1rem;
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        .content-text:empty::before {
            content: '暂无文案内容';
            color: var(--text-tertiary);
            font-style: italic;
        }

        /* Resources Grid */
        .resources-section {
            margin-bottom: 32px;
        }

        .section-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .resources-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 14px;
        }

        /* 视频独立区域：大卡 16:9，一列起步 */
        .videos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 18px;
        }

        .resource-item.is-video {
            aspect-ratio: 16/9;
        }

        .resource-item {
            position: relative;
            border-radius: var(--radius-lg);
            overflow: hidden;
            background: var(--bg);
            aspect-ratio: 3/4;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
        }

        .resource-item:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow-lg);
            border-color: var(--primary-lighter);
        }

        .resource-item img,
        .resource-item video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        /* 骨架屏加载动画 */
        .resource-item.skeleton {
            background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        .resource-type {
            position: absolute;
            top: 12px;
            right: 12px;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            color: white;
            padding: 6px 12px;
            border-radius: 100px;
            font-size: 0.75rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .resource-actions {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(transparent, rgba(0,0,0,0.8));
            padding: 30px 16px 16px;
            opacity: 0;
            transition: opacity 0.3s;
            display: flex;
            gap: 8px;
        }

        .resource-item:hover .resource-actions {
            opacity: 1;
        }

        .btn-icon {
            width: 40px;
            height: 40px;
            border-radius: var(--radius);
            border: none;
            background: rgba(255,255,255,0.9);
            color: var(--text-primary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            font-size: 1.1rem;
        }

        .btn-icon:hover {
            background: var(--border-light);
            transform: scale(1.1);
        }

        .btn-download {
            flex: 1;
            background: var(--primary);
            color: white;
            font-size: 0.875rem;
            font-weight: 500;
        }

        .btn-download:hover {
            background: var(--primary-light);
        }

        /* 图片加载错误状态 */
        .resource-item.error {
            background: var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 12px;
            color: var(--text-secondary);
        }

        .error-icon {
            font-size: 3rem;
            opacity: 0.5;
        }

        .error-text {
            font-size: 0.875rem;
        }

        /* Actions Bar */
        .actions-bar {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
            padding-top: 24px;
            border-top: 1px solid var(--border);
        }

        .action-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 14px 28px;
            border-radius: var(--radius);
            border: none;
            font-size: 0.9375rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow);
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background: var(--primary-light);
        }

        .btn-secondary {
            background: var(--bg);
            color: var(--text-primary);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            background: var(--border-light);
            border-color: var(--primary-lighter);
        }

        /* History */
        .history-section {
            margin-top: 48px;
            padding-top: 48px;
            border-top: 1px solid var(--border);
        }

        .history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .history-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .btn-text {
            font-size: 0.875rem;
            color: var(--text-secondary);
            background: none;
            border: none;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            transition: all 0.2s;
        }

        .btn-text:hover {
            color: var(--primary);
            background: var(--primary-lighter);
        }

        .history-list {
            display: grid;
            gap: 12px;
        }

        .history-item {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
            max-width: 100%;
            overflow: hidden;              /* 长标题/长作者一律裁在卡片内 */
            padding: 14px;
            background: var(--bg);
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid transparent;
        }

        .history-item:hover {
            background: var(--card-bg);
            border-color: var(--border);
            box-shadow: var(--shadow-sm);
        }

        .history-thumb,
        .history-thumb-fallback {
            width: 64px;
            height: 64px;
            border-radius: var(--radius);
            object-fit: cover;
            background: var(--border);
            flex: 0 0 auto;
        }
        .history-thumb-fallback { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }

        .history-info {
            flex: 1 1 0;
            min-width: 0;                   /* flex 子项不显式归零，长文本会把整行撑破 */
            max-width: 100%;
        }

        .history-text {
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 5px;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow-wrap: anywhere;
        }

        .history-meta {
            font-size: 0.8125rem;
            color: var(--text-secondary);
            display: flex;
            flex-wrap: wrap;
            gap: 2px 12px;
            min-width: 0;
            max-width: 100%;
            line-height: 1.5;
        }
        .history-meta span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

        .history-arrow {
            flex: 0 0 auto;
            color: var(--text-tertiary);
            font-size: 1.25rem;
        }

        .empty-state {
            text-align: center;
            padding: 48px 20px;
            color: var(--text-tertiary);
        }

        .empty-icon {
            width: 64px;
            height: 64px;
            margin-bottom: 16px;
            opacity: 0.3;
        }

        /* Toast（pk- 前缀隔离：曾被全站 .toast 兼容规则撞名，
           top+bottom 同时命中把元素拉成整屏竖条，2026-11-11 改名） */
        .pk-toast {
            position: fixed;
            top: 24px;
            left: 50%;
            transform: translateX(-50%) translateY(-100px);
            background: var(--text-primary);
            color: white;
            padding: 14px 28px;
            border-radius: 100px;
            font-size: 0.9375rem;
            font-weight: 500;
            opacity: 0;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 1000;
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            gap: 10px;
            max-width: 82vw;
        }

        .pk-toast.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }

        .pk-toast-icon {
            font-size: 1.2em;
        }

        /* Lightbox */
        .lightbox {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.9);
            z-index: 999;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .lightbox.active {
            display: flex;
        }

        .lightbox img,
        .lightbox video {
            max-width: 90%;
            max-height: 90%;
            border-radius: var(--radius);
        }

        .lightbox-close {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: rgba(255,255,255,0.1);
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }

        .lightbox-close:hover {
            background: rgba(255,255,255,0.2);
        }

        /* Responsive */
        @media (max-width: 768px) {
            .container {
                padding: 20px 16px;
            }

            .header h1 {
                font-size: 2rem;
            }

            .main-card {
                padding: 24px;
            }

            .resources-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 12px;
            }

            .actions-bar {
                flex-direction: column;
            }

            .action-btn {
                width: 100%;
                justify-content: center;
            }
        }

/* ============================================================
   清空历史确认层（2026-11 替换原生 confirm）
   ============================================================
   原生 confirm 在手机上是一个带域名标题的系统框，和页面完全两套语言，
   而且部分内置浏览器会直接禁用。这里做成页面内的居中卡片：
   背景遮罩 + 圆角卡片 + 两个 44px 高的按钮，窄屏自动缩边距。
*/
.pk-confirm {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(12, 20, 34, .48);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.pk-confirm.active { display: flex; animation: pkFade .16s ease-out; }
@keyframes pkFade { from { opacity: 0 } to { opacity: 1 } }

.pk-confirm-box {
  width: 100%; max-width: 340px;
  padding: 20px 20px 16px;
  border-radius: 16px;
  background: var(--card, #fff);
  box-shadow: 0 24px 60px -20px rgba(10, 24, 48, .45);
  animation: pkPop .18s ease-out;
}
@keyframes pkPop { from { transform: translateY(8px) scale(.98); opacity: .6 } to { transform: none; opacity: 1 } }

.pk-confirm-box h4 { margin: 0 0 8px; font-size: 15.5px; font-weight: 600; color: var(--text, #1a2433); }
.pk-confirm-box p { margin: 0 0 18px; font-size: 13px; line-height: 1.75; color: var(--text-secondary, #64748b); }

.pk-confirm-ops { display: flex; gap: 10px; }
.pk-confirm-btn {
  flex: 1; height: 44px; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-family: inherit;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #f6f8fb); color: var(--text, #1a2433);
  transition: background .14s, border-color .14s;
}
.pk-confirm-btn:hover { background: var(--border, #e9eef6); }
.pk-confirm-btn.is-danger {
  border-color: transparent;
  background: #ef4444; color: #fff; font-weight: 600;
}
.pk-confirm-btn.is-danger:hover { background: #dc2626; }

/* 深色主题（本站 data-theme=dark 时） */
html[data-theme="dark"] .pk-confirm-box { background: #161d29; }
html[data-theme="dark"] .pk-confirm-box h4 { color: #e6ebf5; }
html[data-theme="dark"] .pk-confirm-box p { color: #98a4b8; }
html[data-theme="dark"] .pk-confirm-btn { background: #1e2633; border-color: #2a3444; color: #dbe3ef; }

/* ============================================================
   2026-11-11 修复补充
   ============================================================ */

/* 灯箱里的「打开视频」入口（视频地址有 Referer 校验，内嵌播放必失败） */
.pk-lightbox-open {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 18px; padding: 12px 22px;
    border-radius: 12px; text-decoration: none;
    background: #2b7fff; color: #fff; font-size: 0.95rem; font-weight: 600;
}
.pk-lightbox-open:hover { background: #1f6ae0; }

/* 历史记录的本机口径提示 */
.history-hint {
    margin: -4px 0 12px;
    font-size: 0.8rem; color: var(--text-secondary, #94a3b8);
}

/* 灯箱媒体：手机上留出关闭按钮与安全区，长图按原比例 contain */
.lightbox img,
.lightbox video {
    max-width: 92%;
    max-height: 82vh;
    object-fit: contain;
}
@media (max-width: 768px) {
    .lightbox { padding: 44px 10px 20px; }
    .lightbox-close { top: 10px; right: 10px; width: 42px; height: 42px; }
}

/* ---------- 笔记文案防撑爆（2026-11-11） ---------- */
/* 长话题串没有空格，word-break 才能换行；最多 6 行，其余收起 */
#contentText {
    word-break: break-all;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 10.8em;
}
#contentText.is-open {
    -webkit-line-clamp: unset;
    max-height: none;
}
#contentExpand {
    display: inline-block; margin-top: 6px;
    background: none; border: none; cursor: pointer;
    color: #2b7fff; font-size: 0.85rem; padding: 0;
}

/* ============================================================
   2026-11-11 第六轮：预览弹窗 + 历史溢出 + 8 平台标签
   ============================================================ */

/* 预览一律在页内灯箱（弹窗）完成，不再 window.open 新标签页 */
.pk-lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    max-width: 94vw;
    max-height: 88vh;
}
.lightbox .pk-lightbox-inner img,
.lightbox .pk-lightbox-inner video {
    display: block;
    max-width: 100%;
    max-height: 76vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    background: #000;
}
.lightbox .pk-lightbox-inner video { width: min(92vw, 960px); }
.pk-lightbox-open {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px;
    border-radius: 10px; text-decoration: none;
    background: #2b7fff; color: #fff; font-size: 0.9rem; font-weight: 600;
    cursor: pointer;
}
.pk-lightbox-open:hover { background: #1f6ae0; color: #fff; }
.pk-lightbox-msg { color: #cbd5e1; font-size: 0.85rem; text-align: center; max-width: 92vw; }

/* 历史记录：窄屏缩尺寸 + 时间列让位，保证不同设备都不横向溢出 */
@media (max-width: 768px) {
    .history-item { gap: 10px; padding: 11px; }
    .history-thumb, .history-thumb-fallback { width: 54px; height: 54px; }
    .history-text { font-size: 0.875rem; margin-bottom: 3px; }
    .history-meta { font-size: 0.75rem; gap: 1px 8px; }
    .history-meta span:nth-child(3) { display: none; }   /* 时间 */
    .history-arrow { display: none; }
    .platform-tags { gap: 6px; }
    .tag { padding: 6px 10px; font-size: 0.78rem; }
    .plat-hint { font-size: 0.75rem; }
    .container { padding: 24px 12px; }
    .pk-lightbox-inner video { width: 92vw; }
}
@media (max-width: 380px) {
    .tag { padding: 5px 8px; font-size: 0.74rem; }
    .history-thumb, .history-thumb-fallback { width: 46px; height: 46px; }
    .history-meta span:nth-child(2) { display: none; }   /* 作者 */
}
