/**
 * AI标书智能诊断系统 - 前端样式
 * 商务风格：深蓝主色 + 橙金点缀
 */

/* ============================
   CSS 变量与基础设置
   ============================ */
:root {
    --abd-primary: #1a3a5c;
    --abd-primary-light: #2a5298;
    --abd-accent: #e88d2a;
    --abd-accent-light: #f5a623;
    --abd-success: #10b981;
    --abd-warning: #f59e0b;
    --abd-danger: #ef4444;
    --abd-bg: #f7f9fc;
    --abd-white: #ffffff;
    --abd-text: #1e293b;
    --abd-text-light: #64748b;
    --abd-border: #e2e8f0;
    --abd-radius: 12px;
    --abd-radius-lg: 20px;
    --abd-shadow: 0 4px 24px rgba(0,0,0,0.06);
    --abd-shadow-lg: 0 12px 48px rgba(0,0,0,0.1);
    --abd-transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================
   通用布局
   ============================ */
.abd-page {
    background: var(--abd-bg);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: var(--abd-text);
    line-height: 1.6;
}

.abd-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.abd-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: var(--abd-primary);
}

/* ============================
   按钮系统
   ============================ */
.abd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--abd-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--abd-transition);
    white-space: nowrap;
}

.abd-btn-primary {
    background: linear-gradient(135deg, var(--abd-primary), var(--abd-primary-light));
    color: var(--abd-white);
    box-shadow: 0 4px 16px rgba(26, 58, 92, 0.3);
}
.abd-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 58, 92, 0.4);
}

.abd-btn-outline {
    background: var(--abd-white);
    color: var(--abd-primary);
    border: 2px solid var(--abd-border);
}
.abd-btn-outline:hover {
    border-color: var(--abd-primary);
    background: rgba(26, 58, 92, 0.04);
}

.abd-btn-wechat {
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: #fff;
    font-size: 1.1rem;
    padding: 14px 36px;
    border-radius: var(--abd-radius-lg);
    box-shadow: 0 4px 20px rgba(7, 193, 96, 0.3);
}
.abd-btn-wechat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(7, 193, 96, 0.4);
}

.abd-btn-gold {
    background: linear-gradient(135deg, var(--abd-accent), var(--abd-accent-light));
    color: #fff;
    box-shadow: 0 4px 16px rgba(232, 141, 42, 0.3);
}
.abd-btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(232, 141, 42, 0.4);
}

.abd-btn-lg { padding: 16px 40px; font-size: 1.15rem; }
.abd-btn-sm { padding: 8px 18px; font-size: 0.875rem; }
.abd-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================
   Hero区域
   ============================ */
.abd-hero {
    text-align: center;
    padding: 60px 20px 40px;
}
.abd-hero-badge {
    display: inline-block;
    padding: 6px 18px;
    background: rgba(26, 58, 92, 0.08);
    color: var(--abd-primary);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 24px;
}
.abd-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--abd-primary);
    line-height: 1.3;
    margin-bottom: 16px;
}
.abd-highlight {
    background: linear-gradient(135deg, var(--abd-accent), #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.abd-hero-subtitle {
    font-size: 1.1rem;
    color: var(--abd-text-light);
    margin-bottom: 40px;
}

/* ============================
   登录卡片
   ============================ */
.abd-login-card {
    max-width: 420px;
    margin: 0 auto;
    padding: 40px;
    background: var(--abd-white);
    border-radius: var(--abd-radius-lg);
    box-shadow: var(--abd-shadow-lg);
}
.abd-login-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}
.abd-login-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}
.abd-login-card p {
    color: var(--abd-text-light);
    margin-bottom: 24px;
}

/* ============================
   上传区域
   ============================ */
.abd-upload-card {
    max-width: 640px;
    margin: 0 auto;
    background: var(--abd-white);
    border-radius: var(--abd-radius-lg);
    box-shadow: var(--abd-shadow-lg);
    padding: 32px;
}
.abd-user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--abd-border);
}
.abd-welcome { font-weight: 600; }
.abd-credits-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--abd-success);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.875rem;
}

.abd-dropzone {
    border: 2px dashed var(--abd-border);
    border-radius: var(--abd-radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--abd-transition);
    background: var(--abd-bg);
}
.abd-dropzone:hover,
.abd-dropzone.dragover {
    border-color: var(--abd-primary);
    background: rgba(26, 58, 92, 0.03);
}
.abd-dropzone-icon { font-size: 3.5rem; margin-bottom: 12px; }
.abd-dropzone h3 { font-size: 1.1rem; margin-bottom: 8px; }
.abd-dropzone-hint { color: var(--abd-text-light); font-size: 0.875rem; margin-bottom: 16px; }

.abd-file-preview {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--abd-bg);
    border-radius: var(--abd-radius);
}
.abd-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.abd-file-icon { font-size: 1.25rem; }
.abd-file-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abd-file-size { color: var(--abd-text-light); font-size: 0.85rem; }
.abd-file-remove {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--abd-danger);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.abd-btn-diagnose {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    font-size: 1.1rem;
}

/* ============================
   进度条
   ============================ */
.abd-progress { margin-top: 24px; }
.abd-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}
.abd-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    transition: opacity var(--abd-transition);
}
.abd-step.active { opacity: 1; }
.abd-step.completed { opacity: 0.7; }
.abd-step-icon { font-size: 1.5rem; }
.abd-step-label { font-size: 0.75rem; color: var(--abd-text-light); }

.abd-progress-bar {
    height: 4px;
    background: var(--abd-border);
    border-radius: 2px;
    overflow: hidden;
}
.abd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--abd-primary), var(--abd-accent));
    border-radius: 2px;
    width: 0;
    transition: width 0.5s ease;
}

.abd-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: abd-spin 0.8s linear infinite;
}
@keyframes abd-spin { to { transform: rotate(360deg); } }

/* ============================
   错误/提示
   ============================ */
.abd-error-msg {
    background: #fef2f2;
    color: var(--abd-danger);
    padding: 12px 16px;
    border-radius: var(--abd-radius);
    margin-top: 12px;
    font-size: 0.9rem;
    border: 1px solid #fecaca;
}
.abd-no-credits { text-align: center; margin-top: 20px; }
.abd-no-credits p { font-size: 1.1rem; margin-bottom: 16px; }
.abd-no-credits-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================
   隐私声明
   ============================ */
.abd-privacy-notice {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    color: var(--abd-text-light);
    font-size: 0.875rem;
    background: rgba(255,255,255,0.8);
    border-radius: 8px;
}
.abd-privacy-notice a { color: var(--abd-primary); }

/* ============================
   三步流程
   ============================ */
.abd-how-it-works {
    padding: 60px 0;
}
.abd-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.abd-step-card {
    background: var(--abd-white);
    padding: 28px 24px;
    border-radius: var(--abd-radius);
    text-align: center;
    box-shadow: var(--abd-shadow);
    flex: 1;
    min-width: 180px;
    max-width: 240px;
    transition: transform var(--abd-transition);
}
.abd-step-card:hover { transform: translateY(-4px); }
.abd-step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--abd-primary), var(--abd-primary-light));
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 12px;
}
.abd-step-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.abd-step-card p { color: var(--abd-text-light); font-size: 0.9rem; }
.abd-step-arrow { font-size: 1.5rem; color: var(--abd-border); }

/* ============================
   功能展示网格
   ============================ */
.abd-features { padding: 40px 0 60px; }
.abd-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.abd-feature-item {
    background: var(--abd-white);
    padding: 24px;
    border-radius: var(--abd-radius);
    border-left: 3px solid var(--abd-primary);
    box-shadow: var(--abd-shadow);
}
.abd-feature-locked { border-left-color: var(--abd-accent); opacity: 0.75; }
.abd-feature-icon { font-size: 1.5rem; display: block; margin-bottom: 8px; }
.abd-feature-item strong { display: block; margin-bottom: 4px; }
.abd-feature-item p { color: var(--abd-text-light); font-size: 0.875rem; margin: 0; }

/* ============================
   FAQ
   ============================ */
.abd-faq { padding-bottom: 60px; }
.abd-faq-list { max-width: 700px; margin: 0 auto; }
.abd-faq-item {
    background: var(--abd-white);
    border-radius: var(--abd-radius);
    margin-bottom: 8px;
    box-shadow: var(--abd-shadow);
    overflow: hidden;
}
.abd-faq-item summary {
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.abd-faq-item summary::after {
    content: '▾';
    font-size: 0.8rem;
    transition: transform var(--abd-transition);
}
.abd-faq-item[open] summary::after { transform: rotate(180deg); }
.abd-faq-item p {
    padding: 0 20px 16px;
    color: var(--abd-text-light);
    margin: 0;
}

/* ============================
   报告页 ======================
   ============================ */
.abd-report-container { padding: 20px 0; }

.abd-disclaimer {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--abd-radius);
    padding: 14px 20px;
    font-size: 0.875rem;
    color: #92400e;
    margin-bottom: 24px;
}

/* 健康分 */
.abd-score-section {
    text-align: center;
    padding: 32px 0;
}
.abd-score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
}
.abd-score-svg { width: 100%; height: 100%; }
.abd-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.abd-score-number {
    font-size: 3.5rem;
    font-weight: 800;
    display: block;
    line-height: 1;
}
.abd-score-label {
    font-size: 0.9rem;
    color: var(--abd-text-light);
    display: block;
    margin-top: 4px;
}
.abd-score-grade {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
}
.grade-excellent { background: #ecfdf5; color: #065f46; }
.grade-good { background: #fffbeb; color: #92400e; }
.grade-average { background: #fff7ed; color: #9a3412; }
.grade-poor { background: #fef2f2; color: #991b1b; }
.grade-danger { background: #fef2f2; color: #7f1d1d; }

/* 风险统计 */
.abd-risk-stats {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.abd-stat-item {
    background: var(--abd-white);
    padding: 16px 24px;
    border-radius: var(--abd-radius);
    text-align: center;
    box-shadow: var(--abd-shadow);
    min-width: 100px;
}
.abd-stat-count {
    font-size: 2rem;
    font-weight: 800;
    display: block;
}
.abd-stat-label { font-size: 0.8rem; color: var(--abd-text-light); }
.abd-stat-high .abd-stat-count { color: var(--abd-danger); }
.abd-stat-medium .abd-stat-count { color: var(--abd-warning); }
.abd-stat-low .abd-stat-count { color: var(--abd-success); }
.abd-stat-total .abd-stat-count { color: var(--abd-primary); }

/* 总结框 */
.abd-summary-box {
    background: linear-gradient(135deg, rgba(26,58,92,0.03), rgba(42,82,152,0.06));
    border-radius: var(--abd-radius);
    padding: 20px;
    margin-bottom: 28px;
    border-left: 3px solid var(--abd-primary);
}
.abd-summary-title { font-weight: 700; margin-bottom: 8px; color: var(--abd-primary); }
.abd-summary-content { font-size: 0.95rem; }

/* 问题列表 */
.abd-issues-section { margin-bottom: 32px; }
.abd-no-issues { text-align: center; padding: 40px; }
.abd-no-issues-icon { font-size: 3rem; margin-bottom: 12px; }
.abd-no-issues p { font-size: 1.1rem; }
.abd-hint { color: var(--abd-text-light) !important; font-size: 0.9rem !important; }

.abd-issue-item {
    background: var(--abd-white);
    border-radius: var(--abd-radius);
    margin-bottom: 10px;
    box-shadow: var(--abd-shadow);
    overflow: hidden;
    border: 1px solid var(--abd-border);
}
.abd-issue-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: background var(--abd-transition);
}
.abd-issue-header:hover { background: var(--abd-bg); }
.abd-issue-icon { font-size: 1.1rem; }
.abd-issue-badge {
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}
.abd-issue-category { flex: 1; font-weight: 600; font-size: 0.95rem; }
.abd-issue-toggle {
    color: var(--abd-text-light);
    transition: transform var(--abd-transition);
}
.abd-issue-item.expanded .abd-issue-toggle { transform: rotate(180deg); }

.abd-issue-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 18px;
}
.abd-issue-item.expanded .abd-issue-body {
    max-height: 800px;
    padding: 0 18px 16px;
}
.abd-issue-location { font-size: 0.85rem; color: var(--abd-text-light); margin-bottom: 8px; }
.abd-issue-description { font-size: 0.95rem; margin-bottom: 8px; line-height: 1.6; }

/* 修改建议（付费） */
.abd-issue-suggestion {
    background: #ecfdf5;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 10px;
}
.abd-suggestion-label { font-weight: 700; color: #065f46; margin-bottom: 4px; font-size: 0.875rem; }
.abd-suggestion-text { color: #065f46; font-size: 0.9rem; line-height: 1.5; }

/* 锁定提示（免费版） */
.abd-issue-locked {
    background: #fefce8;
    border-radius: 8px;
    padding: 14px;
    margin-top: 10px;
    text-align: center;
}
.abd-locked-hint { margin-bottom: 10px; font-size: 0.9rem; }

/* 文件元信息 */
.abd-file-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 0;
    border-top: 1px solid var(--abd-border);
    font-size: 0.85rem;
    color: var(--abd-text-light);
}

/* CTA引导 */
.abd-cta-section { margin-top: 24px; }
.abd-cta-card {
    background: var(--abd-white);
    border-radius: var(--abd-radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--abd-shadow);
    margin-bottom: 16px;
}
.abd-cta-card h3 { margin-bottom: 8px; }
.abd-cta-card p { color: var(--abd-text-light); margin-bottom: 16px; }
.abd-cta-paid {
    background: linear-gradient(135deg, #fff7ed, #fff1f2);
    border: 2px solid var(--abd-accent);
}
.abd-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) {
    .abd-cta-row { grid-template-columns: 1fr; }
}
.abd-price-amount { font-size: 2.5rem; font-weight: 800; color: var(--abd-accent); }
.abd-price-unit { color: var(--abd-text-light); }
.abd-cta-price-text { display: block; font-weight: 700; color: var(--abd-primary); margin-bottom: 8px; }

/* ============================
   个人中心
   ============================ */
.abd-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--abd-primary);
}
.abd-profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--abd-white);
    padding: 24px;
    border-radius: var(--abd-radius-lg);
    box-shadow: var(--abd-shadow);
    margin-bottom: 24px;
}
.abd-profile-avatar img { border-radius: 50%; }
.abd-profile-info h2 { margin-bottom: 4px; }
.abd-profile-info p { color: var(--abd-text-light); margin: 0; }
.abd-profile-date { font-size: 0.85rem; }

.abd-credit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.abd-credit-card {
    background: var(--abd-white);
    padding: 20px;
    border-radius: var(--abd-radius);
    box-shadow: var(--abd-shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}
.abd-credit-card-icon { font-size: 2rem; }
.abd-credit-card-value { font-size: 2rem; font-weight: 800; display: block; line-height: 1; }
.abd-credit-card-label { font-size: 0.8rem; color: var(--abd-text-light); }

.abd-actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.abd-share-section {
    background: linear-gradient(135deg, rgba(26,58,92,0.03), rgba(42,82,152,0.06));
    padding: 24px;
    border-radius: var(--abd-radius);
    margin-bottom: 24px;
    text-align: center;
}
.abd-share-section h2 { margin-bottom: 8px; }
.abd-share-section p { color: var(--abd-text-light); margin-bottom: 16px; }
.abd-share-box {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}
.abd-share-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--abd-border);
    border-radius: var(--abd-radius);
    font-size: 0.85rem;
    background: var(--abd-white);
}
.abd-share-tip {
    margin-top: 12px;
    color: var(--abd-success);
    font-weight: 500;
}

.abd-history-section { margin-bottom: 40px; }
.abd-history-section h2 { margin-bottom: 16px; }
.abd-empty { text-align: center; padding: 40px; }

.abd-report-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.abd-report-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--abd-white);
    padding: 16px 20px;
    border-radius: var(--abd-radius);
    box-shadow: var(--abd-shadow);
}
.abd-report-item-score {
    font-size: 2rem;
    font-weight: 800;
    min-width: 60px;
    text-align: center;
}
.abd-report-item-info { flex: 1; min-width: 0; }
.abd-report-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.abd-report-item-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--abd-text-light);
    flex-wrap: wrap;
}
.abd-report-item-badge {
    padding: 1px 8px;
    border-radius: 50px;
    font-weight: 600;
}
.abd-report-item-badge.paid { background: #ecfdf5; color: #065f46; }
.abd-report-item-badge.free { background: #f1f5f9; color: #475569; }

/* ============================
   错误页
   ============================ */
.abd-error-page {
    text-align: center;
    padding: 80px 20px;
}
.abd-error-icon { font-size: 4rem; margin-bottom: 16px; }
.abd-error-page h2 { margin-bottom: 8px; }
.abd-error-page p { color: var(--abd-text-light); margin-bottom: 24px; }

/* ============================
   管理员弹窗
   ============================ */
.abd-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.abd-modal-content {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
}
.abd-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* ============================
   响应式
   ============================ */
@media (max-width: 640px) {
    .abd-hero { padding: 40px 16px 24px; }
    .abd-upload-card { padding: 20px; }
    .abd-dropzone { padding: 32px 16px; }
    .abd-steps { flex-direction: column; }
    .abd-step-arrow { transform: rotate(90deg); }
    .abd-step-card { max-width: 100%; }
    .abd-report-item { flex-direction: column; text-align: center; }
}
