/* 文章采集工具 —— 现代工具设计，纯白底，统一圆角/hover/active/阴影语言 */

:root {
    --bg: #ffffff;
    --bg-sub: #f7f8fa;
    --bg-hover: #f0f1f3;
    --border: #e6e8eb;
    --border-strong: #d1d5db;
    --border-focus: #64acff;
    --text: #1f2329;
    --text-sub: #646a73;
    --text-muted: #8f959e;
    --accent: #64acff;
    --accent-hover: #4f96f0;
    --accent-active: #3a84e0;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.1);
    --xhs: #ff2442;
    --wechat: #07c160;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

@font-face {
    font-family: "HarmonyOS Sans SC";
    src: local("HarmonyOS Sans SC Regular"), local("HarmonyOS Sans SC"),
         url("https://cdn.jsdelivr.net/npm/@ayahub/webfont-harmony-sans-sc@1.0.0/fonts/HarmonyOS_Sans_SC_Regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "HarmonyOS Sans SC";
    src: local("HarmonyOS Sans SC Medium"),
         url("https://cdn.jsdelivr.net/npm/@ayahub/webfont-harmony-sans-sc@1.0.0/fonts/HarmonyOS_Sans_SC_Medium.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.logo-icon {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    font-family: monospace;
}

.logo-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-box {
    flex: 1;
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #fff;
    transition: var(--transition);
}

.input-box:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(100, 172, 255, 0.12);
}

.input-icon {
    font-size: 11px;
    font-weight: 600;
    margin-right: 10px;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 0.5px;
}

input[type="text"] {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

.btn {
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

.btn:active {
    background: var(--accent-active);
    transform: scale(0.85);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.action-btn {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: var(--bg-sub);
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--accent);
    color: #fff;
}

.action-btn:active {
    transform: scale(0.85);
}

.hint {
    min-height: 22px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.hint.error { color: #e74c3c; }
.hint.success { color: var(--wechat); }
.hint.info { color: var(--accent); }

.hint .badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
}

.hint .badge.xhs { background: rgba(255, 36, 66, 0.08); color: var(--xhs); }
.hint .badge.wechat { background: rgba(7, 193, 96, 0.08); color: var(--wechat); }

main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-sub);
    transition: var(--transition);
}

.empty-state:hover {
    border-color: var(--border-focus);
    background: rgba(100, 172, 255, 0.02);
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 16px;
    opacity: 0.4;
    font-family: monospace;
    font-weight: 600;
}

.empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.panel:hover {
    box-shadow: var(--shadow-hover);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sub);
}

.panel-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-sub);
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.panel-body {
    padding: 20px;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
}

#markdownOutput {
    width: 100%;
    height: calc(100vh - 240px);
    padding: 16px 20px;
    border: none;
    background: #fff;
    font-family: "Cascadia Code", "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text);
    resize: none;
    outline: none;
}

.preview-title {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 8px;
    line-height: 1.5;
    word-break: break-word;
    color: var(--text);
}

.preview-author {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.preview-author b {
    color: var(--text-sub);
    font-weight: 500;
}

.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--bg-sub);
    border-radius: var(--radius);
}

.preview-meta b { color: var(--text-sub); font-weight: 500; }

.preview-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stat .n {
    font-size: 18px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.stat .l {
    font-size: 12px;
    color: var(--text-muted);
}

.preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    background: var(--bg-sub);
    border: 1px solid var(--border);
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 400;
    transition: var(--transition);
}

.tag:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.preview-media {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.preview-media img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-sub);
    transition: var(--transition);
    cursor: pointer;
}

.preview-media img:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.preview-media .video {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--bg-sub);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    transition: var(--transition);
}

.preview-media .video:hover {
    background: var(--bg-hover);
}

.preview-body {
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 16px 18px;
    background: var(--bg-sub);
    border-radius: var(--radius);
    color: var(--text);
}

.preview-body:empty {
    display: none;
}

@media (max-width: 900px) {
    .content { grid-template-columns: 1fr; }
    #markdownOutput { height: 360px; }
    .panel-body { max-height: none; }
}

@media (max-width: 500px) {
    .header-inner { padding: 14px 16px; }
    main { padding: 16px; }
    .input-group { flex-direction: column; }
    .input-box { width: 100%; }
    .btn { width: 100%; }
}

.hidden { display: none; }

/* ====== 模式切换 tabs ====== */
.mode-tabs {
    margin-left: auto;
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--bg-sub);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.mode-tab {
    height: 30px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.mode-tab:hover {
    color: var(--text-sub);
}

.mode-tab.active {
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* ====== 批量输入区 ====== */
#batchMode {
    align-items: stretch;
}

.batch-input-box {
    flex: 1;
    display: flex;
    gap: 10px;
}

#batchInput {
    flex: 1;
    min-height: 110px;
    padding: 12px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

#batchInput:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(100, 172, 255, 0.12);
}

#batchInput::placeholder {
    color: var(--text-muted);
}

.batch-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    min-width: 110px;
    justify-content: center;
}

.batch-actions .action-btn {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.batch-actions .btn {
    width: 100%;
}

.batch-count {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ====== 批量进度 ====== */
.batch-progress-text {
    font-size: 12px;
    color: var(--accent);
    font-weight: 400;
    margin-left: 8px;
}

/* ====== 批量结果列表 ====== */
.batch-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: #fff;
    transition: var(--transition);
}

.batch-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.batch-item-index {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-sub);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.batch-item.success .batch-item-index {
    background: rgba(7, 193, 96, 0.1);
    color: var(--wechat);
}

.batch-item.error .batch-item-index {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.batch-item.pending .batch-item-index {
    background: rgba(100, 172, 255, 0.1);
    color: var(--accent);
}

.batch-item-body {
    flex: 1;
    min-width: 0;
}

.batch-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-item-status {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 500;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-sub);
    color: var(--text-muted);
}

.batch-item.success .batch-item-status {
    background: rgba(7, 193, 96, 0.08);
    color: var(--wechat);
}

.batch-item.error .batch-item-status {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
}

.batch-item.pending .batch-item-status {
    background: rgba(100, 172, 255, 0.08);
    color: var(--accent);
}

.batch-item-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.batch-item-thumbs img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

@media (max-width: 500px) {
    .batch-input-box { flex-direction: column; }
    .batch-actions { flex-direction: row; min-width: 0; }
    .batch-actions .btn { flex: 1; }
}
