/* 专利金矿 - 科技成果转换报告系统 - 样式表 */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #16a34a;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --nav-grad: linear-gradient(135deg, #1e3a5f, #2563eb);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

/* Navbar */
.navbar { background: var(--nav-grad); color: white; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.nav-container { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: white; }
.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 700; }
.logo-sub { font-size: 12px; opacity: 0.8; margin-left: 4px; }
.nav-menu { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link { color: rgba(255,255,255,0.85); text-decoration: none; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 14px; transition: all 0.2s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.2); color: white; }

/* Container */
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 28px; font-weight: 700; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* Breadcrumb */
.breadcrumb { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: white; color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn:hover { background: var(--bg); border-color: var(--secondary); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 18px; font-weight: 600; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-muted); font-size: 13px; text-transform: uppercase; }
.table tbody tr:hover { background: var(--bg); }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gray { background: #f1f5f9; color: var(--secondary); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; transition: border-color 0.2s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); }
.form-textarea { min-height: 100px; resize: vertical; }

/* Flash messages */
.flash-messages { margin-bottom: 16px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.flash-success { background: var(--success-light); color: var(--success); }
.flash-error { background: var(--danger-light); color: var(--danger); }
.flash-info { background: var(--primary-light); color: var(--primary); }

/* Loading overlay */
.ai-loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 9999; display: none; justify-content: center; align-items: center; }
.ai-loading-overlay.show { display: flex; }
.ai-loading-box { background: white; padding: 32px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow-lg); }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; display: none; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal { background: white; border-radius: var(--radius); max-width: 600px; width: 90%; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* Progress steps */
.progress-steps { display: flex; gap: 0; margin-bottom: 24px; }
.progress-step { flex: 1; text-align: center; padding: 12px; background: var(--bg); border: 1px solid var(--border); position: relative; }
.progress-step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.progress-step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.progress-step.active { background: var(--primary); color: white; border-color: var(--primary); }
.progress-step.completed { background: var(--success); color: white; border-color: var(--success); }
.progress-step-num { font-size: 16px; font-weight: 700; }
.progress-step-label { font-size: 12px; margin-top: 2px; }

/* Report sections */
.report-section { margin-bottom: 32px; }
.report-section h2 { font-size: 22px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }
.report-section h3 { font-size: 17px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
.report-section p { margin-bottom: 8px; line-height: 1.8; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab { padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 14px; color: var(--text-muted); transition: all 0.2s; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* Footer */
.footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 24px; }

/* Patent cards */
.patent-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--primary); }
.patent-card.risk-green { border-left-color: var(--success); }
.patent-card.risk-yellow { border-left-color: var(--warning); }
.patent-card.risk-red { border-left-color: var(--danger); }
.patent-number { font-size: 13px; color: var(--text-muted); }
.patent-title { font-size: 16px; font-weight: 600; margin: 4px 0; }
.patent-abstract { font-size: 14px; color: var(--text-muted); margin-top: 8px; }

/* Dimension bars */
.dim-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dim-label { width: 100px; font-size: 13px; text-align: right; }
.dim-value { flex: 1; font-size: 13px; }
.dim-bar-fill { height: 8px; border-radius: 4px; background: var(--primary); transition: width 0.3s; }

/* JSON viewer */
.json-view { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: var(--radius-sm); font-family: 'Courier New', monospace; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
