/* 论文辅助生成Agent — 样式 */

:root {
    --pico-font-size: 100%;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --success: #16a34a;
    --error: #dc2626;
}
.container { max-width: 980px; }
body { background: var(--bg); }

h2 { margin: 0; font-size: 1.25rem; }

/* 导航 */
#nav-actions { margin-left: auto; }
.btn-sm {
    padding: 0.4rem 0.9rem; font-size: 0.88rem;
    border-radius: 6px; cursor: pointer;
    background: var(--card); border: 1px solid var(--border);
    color: var(--text); font-weight: 500;
    transition: all 0.15s;
}
.btn-sm:hover { border-color: var(--brand); color: var(--brand); background: #eff6ff; }

/* Hero */
.hero {
    text-align: center; padding: 3.5rem 2rem; margin-bottom: 2rem;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: 16px; color: white;
}
.hero h1 { color: white; font-size: 2rem; margin-bottom: 0.5rem; }
.hero-sub { color: #ffffff; font-size: 1.05rem; margin-bottom: 1.5rem; opacity: 1; }
.hero-btns { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.cta {
    background: white; color: var(--brand-dark); border: none;
    padding: 0.8rem 2rem; border-radius: 8px; font-size: 1rem;
    font-weight: 600; cursor: pointer; transition: transform 0.15s;
}
.cta:hover { transform: translateY(-1px); }
.cta.full { width: 100%; margin-top: 1rem; }
.cta-outline {
    background: transparent; color: white; border: 2px solid white;
    padding: 0.8rem 2rem; border-radius: 8px; font-size: 1rem;
    font-weight: 600; cursor: pointer;
}
.cta-outline:hover { background: rgba(255,255,255,0.1); }

/* Features */
.features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem; margin-bottom: 2.5rem;
}
.feature {
    background: var(--card); padding: 1.2rem; border-radius: 12px;
    border: 1px solid var(--border); text-align: center;
}
.feature h4 { margin: 0 0 0.3rem; color: var(--brand); }
.feature p { margin: 0; font-size: 0.88rem; color: var(--muted); }

/* Section title */
.section-title { margin: 2rem 0 1rem; font-size: 1.3rem; }

/* Intro block */
.intro-block {
    background: var(--card); padding: 1.5rem; border-radius: 12px;
    border: 1px solid var(--border); margin-bottom: 1rem;
}
.intro-block p { margin: 0.5rem 0; line-height: 1.6; }
.intro-list { padding-left: 1.5rem; margin: 0.8rem 0; }
.intro-list li { margin: 0.4rem 0; line-height: 1.5; }
.pricing-note { color: var(--muted); margin: 0 0 1rem; }

/* Pricing */
.pricing-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem; margin-bottom: 2rem;
}
.plan-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.5rem; text-align: center; position: relative; transition: transform 0.15s;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.plan-card.featured { border: 2px solid var(--brand); }
.ribbon {
    position: absolute; top: -10px; right: 16px; background: var(--brand); color: white;
    padding: 0.2rem 0.7rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600;
}
.plan-card h4 { margin: 0 0 0.3rem; }
.price { font-size: 2rem; font-weight: 700; color: var(--text); margin: 0.5rem 0; }
.plan-card ul { list-style: none; padding: 0; text-align: left; font-size: 0.88rem; }
.plan-card li { padding: 0.2rem 0; }
.plan-card li::before { content: "✓ "; color: var(--success); font-weight: bold; }
.plan-tag {
    margin: 0.8rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--border);
    font-size: 0.82rem; color: var(--muted); font-style: italic;
}

/* Auth dialog */
.auth-dialog { padding: 0; border: none; border-radius: 12px; max-width: 420px; }
.auth-card { padding: 2rem; position: relative; }
.auth-close {
    position: absolute; top: 0.8rem; right: 1rem; background: none; border: none;
    font-size: 1.6rem; cursor: pointer; color: var(--muted);
}
.auth-error { color: var(--error); font-size: 0.9rem; min-height: 1.2em; margin: 0.3rem 0; }
.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.9rem; }

/* Workspace */
.user-bar {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 0.7rem 1rem; background: var(--card); border: 1px solid var(--border);
    border-radius: 8px; margin-bottom: 1.5rem;
}
.user-bar-info { font-size: 0.9rem; color: var(--muted); }
.badge {
    padding: 0.25rem 0.7rem; border-radius: 6px; background: var(--brand); color: white;
    font-size: 0.8rem; font-weight: 600;
}

/* Form */
.paper-form {
    background: var(--card); padding: 1.8rem; border-radius: 12px;
    border: 1px solid var(--border);
}
.paper-form label { display: block; margin-bottom: 1rem; }
.req { color: var(--error); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

/* Upload */
.upload-section { margin-bottom: 1rem; }
.upload-label { font-weight: 600; margin-bottom: 0.5rem; }
.upload-zone {
    border: 2px dashed var(--border); border-radius: 10px; padding: 1.8rem;
    text-align: center; cursor: pointer; transition: all 0.15s; background: var(--bg);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--brand); background: #eff6ff; }
.upload-hint { margin: 0 0 0.3rem; font-weight: 600; color: var(--text); }
.upload-sub { margin: 0; font-size: 0.82rem; color: var(--muted); }
.upload-status { margin-top: 0.5rem; font-size: 0.88rem; }
.upload-status.success { color: var(--success); }
.upload-status.error { color: var(--error); }

/* Advanced */
.advanced { margin: 1rem 0; }
.advanced summary { cursor: pointer; padding: 0.5rem; font-weight: 600; }
.advanced-body { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.advanced-body fieldset { margin-bottom: 0.8rem; }
.advanced-body label { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; }

/* Panels */
.panel {
    background: var(--card); padding: 1.5rem; border-radius: 12px;
    border: 1px solid var(--border); margin-top: 1rem;
}
.success-panel { border-left: 4px solid var(--success); }
.error-panel { border-left: 4px solid var(--error); }
.progress-msg { margin: 0.5rem 0 0; color: var(--muted); }

/* Phase bar */
.phase-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.2rem;
    margin-top: 0.8rem; font-size: 0.72rem;
}
.pd {
    padding: 0.2rem 0.5rem; border-radius: 4px; background: #e9ecef; color: var(--muted);
    transition: all 0.3s;
}
.pd.active { background: var(--brand); color: white; font-weight: 600; }
.pd.done { background: #d1fae5; color: #065f46; }

progress { width: 100%; height: 8px; border-radius: 4px; }

/* 生成按钮 — 醒目大按钮 */
.generate-btn {
    width: 100%; margin-top: 1.2rem; padding: 1.1rem 2rem;
    font-size: 1.15rem; font-weight: 700; color: white;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none; border-radius: 10px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.2s; letter-spacing: 1px;
}
.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}
.generate-btn:active { transform: translateY(0); }
.generate-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── 支付系统 ── */
.btn-buy {
    display: block; width: 100%; padding: 12px; margin-top: 16px;
    background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-buy:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }
.btn-buy:active { transform: translateY(0); }

/* 弹窗遮罩 */
.modal {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
    animation: modalFade .2s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlide { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-box {
    background: #fff; border-radius: 18px; padding: 36px 40px 32px;
    width: 380px; max-width: 92vw; position: relative; text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    animation: modalSlide .25s cubic-bezier(.16, 1, .3, 1);
}
.modal-close {
    position: absolute; top: 14px; right: 16px; width: 30px; height: 30px;
    background: #f1f5f9; border: none; border-radius: 50%;
    font-size: 18px; line-height: 1; cursor: pointer; color: #64748b;
    display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.modal-close:hover { background: #e2e8f0; color: #1e293b; }

#pay-title { font-size: 17px; font-weight: 600; color: #1e293b; margin: 0 0 6px; }

/* 支付方式按钮 */
.pay-methods { display: flex; gap: 14px; justify-content: center; margin: 22px 0 8px; }
.pay-method {
    flex: 1; padding: 18px 12px; border: 2px solid #e2e8f0; background: #fff;
    border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all .15s; display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: #334155;
}
.pay-method .pm-icon { font-size: 26px; line-height: 1; }
.pay-method[data-method="alipay"] .pm-icon { color: #1677ff; }
.pay-method[data-method="wechat"] .pm-icon { color: #07c160; }
.pay-method:hover { border-color: #cbd5e1; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.pay-method[data-method="alipay"]:hover { border-color: #1677ff; }
.pay-method[data-method="wechat"]:hover { border-color: #07c160; }

/* 金额 + 二维码区 */
.pay-amount {
    font-size: 30px; font-weight: 700; color: #dc2626; margin: 18px 0 4px;
    letter-spacing: -0.5px;
}
.pay-amount::before { content: "¥"; font-size: 20px; margin-right: 2px; }
.pay-qr {
    display: flex; justify-content: center; margin: 16px auto; padding: 16px;
    background: #f8fafc; border-radius: 12px; width: fit-content;
    border: 1px solid #e2e8f0;
}
.pay-qr canvas, .pay-qr img { display: block; border: none !important; }
.pay-hint { color: #64748b; font-size: 13px; margin: 10px 0; }
.pay-status { color: #16a34a; font-size: 14px; margin-top: 14px; min-height: 20px; font-weight: 500; }
.pay-status::before { content: ""; }

#pay-mock-btn {
    margin-top: 14px; padding: 10px 24px; background: #f59e0b; color: #fff;
    border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
#pay-mock-btn:hover { background: #d97706; }
