/* PRIME 医疗纠纷普法平台样式表 */
:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --accent: #c5a24a;
    --accent-light: #e6c76a;
    --bg: #f7f9fc;
    --card-bg: #ffffff;
    --text: #1a202c;
    --text-light: #4a5568;
    --border: #e2e8f0;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

.header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; padding: 1rem 2rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.header h1 { font-size: 1.4rem; font-weight: 600; }
.header-nav { display: flex; gap: 1.5rem; }
.header-nav a { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.header-nav a:hover { color: var(--accent); }
.header-nav a.active { color: var(--accent); font-weight: 500; }

.container { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #2d3748 100%); color: white; padding: 3rem 2rem; text-align: center; border-radius: 12px; margin-bottom: 2rem; }
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { opacity: 0.9; font-size: 1.1rem; }

/* Search Box */
.search-box { background: var(--card-bg); border-radius: 12px; padding: 2rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08); margin-bottom: 2rem; }
.search-box h2 { color: var(--primary); margin-bottom: 1rem; font-size: 1.2rem; }
.search-form { display: flex; gap: 0.75rem; }
.search-form input { flex: 1; padding: 0.75rem 1rem; border: 2px solid var(--border); border-radius: 8px; font-size: 1rem; transition: border-color 0.2s; }
.search-form input:focus { outline: none; border-color: var(--accent); }
.search-form button { padding: 0.75rem 1.5rem; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; transition: background 0.2s; }
.search-form button:hover { background: var(--primary-light); }
.search-form select { padding: 0.75rem 1rem; border: 2px solid var(--border); border-radius: 8px; font-size: 1rem; }

/* Cards */
.card { background: var(--card-bg); border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 1rem; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.card-title { font-size: 1.1rem; font-weight: 600; color: var(--primary); }
.card-badge { padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 500; }
.badge-reg { background: #ebf8ff; color: #2b6cb0; }
.badge-law { background: #f0fff4; color: #276749; }
.badge-case { background: #fffaf0; color: #c05621; }
.card-meta { color: var(--text-light); font-size: 0.85rem; margin-bottom: 0.5rem; }
.card-text { color: var(--text); line-height: 1.7; }
.card-footer { margin-top: 1rem; display: flex; justify-content: space-between; align-items: center; }
.card-link { color: var(--primary); text-decoration: none; font-size: 0.9rem; }
.card-link:hover { text-decoration: underline; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); gap: 1rem; }

/* Answer Box */
.answer-box { background: var(--card-bg); border-radius: 12px; padding: 2rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08); margin-bottom: 2rem; }
.answer-box h3 { color: var(--primary); margin-bottom: 1rem; }
.answer-text { line-height: 1.8; white-space: pre-wrap; }
.sources { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.sources h4 { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.5rem; }
.source-item { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.25rem; }

/* Loading */
.loading { text-align: center; padding: 2rem; color: var(--text-light); }
.spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chat */
.chat-container { max-width: 800px; margin: 0 auto; }
.chat-messages { max-height: 60vh; overflow-y: auto; margin-bottom: 1rem; }
.chat-message { margin-bottom: 1rem; padding: 1rem; border-radius: 12px; }
.chat-message.user { background: var(--primary); color: white; margin-left: 10%; }
.chat-message.assistant { background: var(--card-bg); box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-right: 10%; }
.chat-input { display: flex; gap: 0.5rem; }
.chat-input input { flex: 1; padding: 0.75rem; border: 2px solid var(--border); border-radius: 8px; font-size: 1rem; }
.chat-input button { padding: 0.75rem 1.5rem; background: var(--primary); color: white; border: none; border-radius: 8px; cursor: pointer; }

/* Lists */
.list-page { background: var(--card-bg); border-radius: 12px; padding: 1.5rem; }
.list-page table { width: 100%; border-collapse: collapse; }
.list-page th { text-align: left; padding: 0.75rem; border-bottom: 2px solid var(--border); color: var(--primary); font-size: 0.9rem; }
.list-page td { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.list-page tr:hover { background: var(--bg); }
.pagination { margin-top: 1rem; display: flex; gap: 0.5rem; justify-content: center; }
.pagination button { padding: 0.5rem 1rem; border: 1px solid var(--border); background: white; border-radius: 6px; cursor: pointer; }
.pagination button.active { background: var(--primary); color: white; }

/* Footer */
.footer { text-align: center; padding: 2rem; color: var(--text-light); font-size: 0.85rem; margin-top: 3rem; border-top: 1px solid var(--border); }

/* Responsive */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .search-form { flex-direction: column; }
    .chat-message { margin-left: 0; margin-right: 0; }
}
