/* PaperAI 公共样式 */
:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-bg: #f5f3ff;
    --sidebar-w: 220px;
}
[x-cloak] { display: none !important; }
* { box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f8f9fc; margin: 0; }
body.body-locked { overflow: hidden; }
.is-hidden { display: none !important; }

.recharge-item { padding: 16px; border: 2px solid #eee; border-radius: 10px; text-align: center; font-size: 20px; font-weight: 700; color: #333; cursor: pointer; transition: all .15s; }
.recharge-item { width: 100%; background: #fff; }
.recharge-item:hover, .recharge-item.active { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

/* Main content */
.main { margin-left: var(--sidebar-w); margin-top: 56px; padding: 32px; min-height: calc(100vh - 56px); }
.app-loading { text-align: center; padding: 100px 20px; color: #888; }
.app-loading__icon { font-size: 48px; }
.app-loading__text { margin-top: 20px; }
.app-loading--error { color: #888; }
.app-loading__icon--error { color: #dc3545; }

/* Page header */
.page-title { text-align: center; margin-bottom: 8px; font-size: 24px; font-weight: 700; color: #333; }
.page-desc { text-align: center; color: #888; font-size: 14px; margin-bottom: 32px; line-height: 1.6; }

/* Content layout */
.content-row { display: flex; gap: 24px; }
.content-left { flex: 1; min-width: 0; }
.content-right { width: 340px; flex-shrink: 0; }

/* Card */
.card-box { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }

/* Section header */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.section-title { font-size: 18px; font-weight: 600; color: #333; }
.section-hint { font-size: 12px; color: #999; margin-bottom: 16px; line-height: 1.6; }
.section-hint a { color: var(--primary); text-decoration: none; }

/* Pills */
.platform-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.platform-label { font-size: 14px; color: #666; white-space: nowrap; }
.pill { padding: 7px 20px; border-radius: 20px; border: 1px solid #ddd; font-size: 13px; cursor: pointer; transition: all .15s; background: #fff; color: #555; user-select: none; }
.pill:hover { border-color: var(--primary-light); color: var(--primary); }
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill-outline { padding: 7px 16px; border-radius: 20px; border: 1px solid var(--primary-light); font-size: 12px; color: var(--primary); cursor: pointer; background: #fff; text-decoration: none; }
.pill-outline:hover { background: var(--primary-bg); }

/* Tabs */
.detect-tabs { display: flex; gap: 24px; border-bottom: 2px solid #f0f0f0; margin-bottom: 20px; }
.detect-tab { padding: 8px 0; font-size: 14px; color: #999; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.detect-tab:hover { color: #666; }
.detect-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* Upload zone */
.upload-zone { border: 2px dashed #d9d9f0; border-radius: 12px; padding: 48px 20px; text-align: center; cursor: pointer; transition: all .2s; background: #fafaff; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-bg); }
.upload-zone .icon { font-size: 28px; color: var(--primary); margin-bottom: 12px; }
.upload-zone .hint { color: #999; font-size: 12px; margin-top: 8px; }
.upload-zone .hint2 { color: #bbb; font-size: 12px; margin-top: 4px; }
.upload-zone a { color: var(--primary); text-decoration: none; }
.file-selected { margin-top: 12px; font-size: 13px; color: #333; }

/* Textarea */
.detect-textarea { width: 100%; min-height: 200px; border: 2px dashed #d9d9f0; border-radius: 12px; padding: 16px; font-size: 14px; resize: vertical; background: #fafaff; transition: border-color .2s; }
.detect-textarea:focus { outline: none; border-color: var(--primary); background: #fff; }

/* Form row */
.form-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.form-row label { font-size: 14px; color: #333; white-space: nowrap; min-width: 48px; text-align: right; }
.form-row label .req { color: #e74c3c; }
.form-row input { flex: 1; border: none; border-bottom: 1px solid #e8e8e8; padding: 8px 0; font-size: 14px; outline: none; background: transparent; }
.form-row input:focus { border-bottom-color: var(--primary); }
.form-row .char-count { font-size: 12px; color: #ccc; white-space: nowrap; }

/* Submit button */
.btn-submit { display: block; width: 100%; margin-top: 24px; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; transition: background .15s; }
.btn-submit:hover { background: #5b4bd5; }
.btn-submit:disabled { background: #ccc; cursor: not-allowed; }

/* Right info card */
.info-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.info-card .warn { display: flex; align-items: flex-start; gap: 8px; padding: 16px; background: #fff8f0; border-radius: 8px; margin-bottom: 20px; }
.warn-icon { color: #e74c3c; font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.warn-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 4px; }
.warn-text { font-size: 12px; color: #888; line-height: 1.6; }
.service-title { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 16px; }
.service-item { display: flex; gap: 14px; margin-bottom: 20px; }
.service-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--primary-bg), #e8e4ff); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.service-icon i { font-size: 22px; color: var(--primary); }
.service-item h6 { font-size: 14px; font-weight: 600; color: #333; margin: 0 0 4px; }
.service-item p { font-size: 12px; color: #888; margin: 0; line-height: 1.5; }

/* Footer */
.footer { text-align: center; padding: 24px; color: #bbb; font-size: 12px; margin-top: 32px; }
.footer a { color: #999; text-decoration: none; margin: 0 8px; }
.footer a:hover { color: var(--primary); }

.editor-page-card {
    min-height: 500px;
}

.editor-page-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.editor-page-textarea {
    min-height: 400px;
}

.editor-page-submit {
    max-width: 300px;
    margin: 24px auto 0;
}

/* ===== 响应式布局 ===== */

/* 平板及以下：统一抽屉侧栏，避免窄侧栏挤压内容区 */
@media (max-width: 1023px) {
    :root { --sidebar-w: 0; }

    .main {
        margin-left: 0;
        padding: 24px 20px;
    }

    .content-row { flex-direction: column; }
    .content-right { width: 100%; }
}

/* 手机端：隐藏侧边栏，显示菜单按钮 (< 768px) */
@media (max-width: 767px) {
    :root { --sidebar-w: 0; }

    .main {
        margin-left: 0;
        padding: 20px 12px;
    }

    .content-row { flex-direction: column; }
    .content-right { width: 100%; }

    .page-title { font-size: 20px; }
    .page-desc { font-size: 13px; }

    .card-box { padding: 16px; }

    /* Pills 优化 */
    .platform-row { gap: 8px; }
    .pill { padding: 6px 16px; font-size: 12px; }
    .pill-outline { padding: 6px 14px; font-size: 11px; }

    /* 上传区域 */
    .upload-zone { padding: 32px 16px; min-height: 160px; }
    .upload-zone .icon { font-size: 24px; }

    /* 表单行 */
    .form-row { flex-wrap: wrap; gap: 8px; }
    .form-row label { min-width: auto; text-align: left; width: 100%; }
    .form-row input, .form-row select { width: 100%; }

}

/* Feature grid for placeholder pages */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}
.feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: all .3s;
    text-align: center;
    border: 1px solid #f0f0f0;
}
.feature-card:hover {
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.12);
    transform: translateY(-4px);
    border-color: var(--primary-light);
}
.feature-card .fc-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-bg), #e8e4ff);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.feature-card .fc-icon i {
    font-size: 26px;
    color: var(--primary);
}
.feature-card h5 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px;
}
.feature-card p {
    font-size: 13px;
    color: #888;
    margin: 0;
    line-height: 1.6;
}

/* Coming soon badge */
.badge-soon { display: inline-block; padding: 3px 10px; border-radius: 10px; background: #fff3e0; color: #e67e22; font-size: 11px; font-weight: 500; }

/* ===== 历史记录基础样式 ===== */

/* 文件历史行 */
.history-file-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 20px;
    background: #fff; border-radius: 12px; margin-bottom: 10px;
    border: 1px solid #f0f0f0; transition: box-shadow .2s; flex-wrap: wrap;
}
.history-file-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.hfi-name { font-size: 14px; color: #333; font-weight: 500; flex: 1; min-width: 120px; }
.hfi-status { font-size: 12px; padding: 3px 10px; border-radius: 10px; font-weight: 500; }
.hfi-time { font-size: 12px; color: #bbb; }
.hfi-download { font-size: 13px; color: var(--primary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.hfi-download:hover { text-decoration: underline; }

/* 状态标签 */
.status-success { background: #e8f5e9; color: #2e7d32; }
.status-completed { background: #e8f5e9; color: #2e7d32; }
.status-processing { background: #fff3e0; color: #e65100; }
.status-pending { background: #f3e5f5; color: #7b1fa2; }
.status-failed { background: #ffebee; color: #c62828; }

/* 功能类型标签 */
.type-tag {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: 12px; font-weight: 500;
}
.type-1 { background: #e3f2fd; color: #1565c0; }
.type-2 { background: #f3e5f5; color: #7b1fa2; }
.type-3 { background: #fff3e0; color: #e65100; }
.type-4 { background: #e8f5e9; color: #2e7d32; }
