/* ============================================
   政务服务助手 - 专业演示版 CSS
   清新蓝绿 · 现代简约 · 政务风格
   ============================================ */

/* ========== 变量定义 ========== */
:root {
    --primary: #0891b2;
    --primary-light: #22d3ee;
    --primary-dark: #0e7490;
    --gradient-primary: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%);
    --gradient-hero: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 50%, #f0f9ff 100%);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px -12px rgba(0, 0, 0, 0.15);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========== 登录页面 ========== */
.login-container {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--gradient-hero);
    padding: 20px; z-index: 9999;
}
.login-container::before {
    content: ''; position: absolute; top: -50%; right: -30%; width: 80%; height: 150%;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.08) 0%, transparent 60%); pointer-events: none;
}
.login-box {
    position: relative; width: 100%; max-width: 420px;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    border-radius: var(--radius-xl); padding: 48px 40px;
    box-shadow: var(--shadow-xl); border: 1px solid rgba(255, 255, 255, 0.8);
    animation: cardIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.login-header { text-align: center; margin-bottom: 40px; }
.login-logo {
    width: 72px; height: 72px; background: var(--gradient-primary); border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.3);
}
.login-logo svg { width: 40px; height: 40px; fill: white; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.login-header p { font-size: 0.938rem; color: var(--text-muted); }
.login-form { display: flex; flex-direction: column; gap: 20px; }
.login-error {
    padding: 12px; background: rgba(239, 68, 68, 0.1); border-radius: var(--radius);
    color: var(--danger); font-size: 0.875rem; text-align: center;
}
.login-hint {
    text-align: center; margin-top: 16px; font-size: 0.813rem; color: var(--text-muted);
}

/* 登录表单通用样式 */
.login-box .form-group { position: relative; }
.login-box .form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.login-box .form-group input, .login-box .form-group select, .login-box .form-group textarea {
    width: 100%; padding: 14px 16px; background: var(--bg-secondary);
    border: 2px solid transparent; border-radius: var(--radius); font-size: 1rem;
    color: var(--text-primary); transition: var(--transition);
}
.login-box .form-group input:focus, .login-box .form-group select:focus, .login-box .form-group textarea:focus {
    background: white; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}
.login-box .form-group input::placeholder, .login-box .form-group textarea::placeholder { color: var(--text-muted); }
.login-box .login-btn {
    width: 100%; padding: 16px; background: var(--gradient-primary); color: white;
    font-size: 1rem; font-weight: 600; border-radius: var(--radius); margin-top: 8px; transition: var(--transition);
}
.login-box .login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(8, 145, 178, 0.4); }

/* ========== 主应用容器 ========== */
.app-container { display: none; height: 100vh; background: var(--bg-secondary); }

/* ========== 顶部导航 ========== */
.app-header {
    position: fixed; top: 0; left: 0; right: 0; height: 64px;
    background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); display: flex; align-items: center;
    justify-content: space-between; padding: 0 24px; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-logo { display: flex; align-items: center; gap: 12px; }
.header-logo-icon {
    width: 40px; height: 40px; background: var(--gradient-primary); border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.header-logo-icon svg { width: 24px; height: 24px; fill: white; }
.header-logo h1 { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); }

/* 顶部菜单导航 */
.header-nav {
    display: flex; gap: 4px; align-items: center;
}
.nav-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; background: transparent; border-radius: var(--radius);
    font-size: 0.875rem; color: var(--text-secondary); font-weight: 500;
    transition: var(--transition-fast); white-space: nowrap;
}
.nav-btn svg { width: 18px; height: 18px; fill: currentColor; }
.nav-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.nav-btn.active { background: rgba(8, 145, 178, 0.1); color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--bg-secondary); border-radius: var(--radius-full); }
.user-avatar { width: 32px; height: 32px; background: var(--gradient-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.875rem; font-weight: 600; }
.user-name { font-size: 0.875rem; color: var(--text-primary); font-weight: 500; }
.header-btn {
    width: 40px; height: 40px; background: var(--bg-secondary); border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; transition: var(--transition-fast);
}
.header-btn:hover { background: var(--bg-tertiary); }
.header-btn svg { width: 20px; height: 20px; fill: var(--text-secondary); }

/* ========== 主内容区 ========== */
.main-content { padding-top: 64px; min-height: 100vh; }
.page { display: none; min-height: calc(100vh - 64px); animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ========== 智能助手页面 ========== */
.chat-page { display: flex; height: calc(100vh - 64px); }
.chat-sidebar { width: 280px; background: white; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.new-chat-btn {
    width: 100%; padding: 12px 16px; background: var(--gradient-primary); color: white;
    border-radius: var(--radius); font-size: 0.875rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition);
}
.new-chat-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3); }
.new-chat-btn svg { width: 18px; height: 18px; fill: currentColor; }
.role-btn { background: var(--bg-secondary); color: var(--text-primary); margin-top: 8px; border: 1px solid var(--border); }
.role-btn:hover { background: var(--bg-tertiary); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.chat-history { flex: 1; overflow-y: auto; padding: 12px; }
.history-item { 
    padding: 12px; border-radius: var(--radius); cursor: pointer; transition: var(--transition-fast); 
    margin-bottom: 4px; position: relative; display: flex; align-items: center;
}
.history-item:hover { background: var(--bg-secondary); }
.history-item.active { background: rgba(8, 145, 178, 0.08); }
.history-item-content { flex: 1; min-width: 0; }
.history-item-title { font-size: 0.875rem; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.history-item-delete {
    width: 28px; height: 28px; border-radius: var(--radius-sm); background: transparent;
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: var(--transition-fast);
    flex-shrink: 0; margin-left: 8px;
}
.history-item:hover .history-item-delete { opacity: 1; }
.history-item-delete:hover { background: rgba(239, 68, 68, 0.1); }
.history-item-delete:hover svg { fill: var(--danger); }
.history-item-delete svg { width: 16px; height: 16px; fill: var(--text-muted); transition: var(--transition-fast); }
.history-empty { text-align: center; padding: 24px 12px; color: var(--text-muted); font-size: 0.875rem; }
.history-role-tag { display: inline-block; margin-right: 4px; font-size: 0.875rem; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.model-section { margin-bottom: 12px; }
.model-section-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.model-btn {
    padding: 10px 12px; background: var(--bg-secondary); border-radius: var(--radius);
    font-size: 0.813rem; color: var(--text-secondary); text-align: left; transition: var(--transition-fast); border: 2px solid transparent;
}
.model-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.model-btn.active { background: rgba(8, 145, 178, 0.1); border-color: var(--primary); color: var(--primary); font-weight: 500; }
.model-btn-name { display: block; font-weight: 500; }
.model-btn-desc { display: block; font-size: 0.688rem; color: var(--text-muted); margin-top: 2px; }

/* 对话区域 */
.chat-area { flex: 1; display: flex; flex-direction: column; background: var(--bg-secondary); }
.chat-header { padding: 20px 24px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.chat-header-info { display: flex; align-items: center; gap: 16px; }
.chat-header h2 { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); }
.model-badge {
    display: flex; align-items: center; gap: 8px; padding: 6px 12px;
    background: rgba(8, 145, 178, 0.1); border-radius: var(--radius-full);
    font-size: 0.813rem; color: var(--primary); font-weight: 500;
}
.badge-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.chat-header-actions { display: flex; gap: 8px; }
.action-btn {
    padding: 8px 16px; background: var(--bg-secondary); border-radius: var(--radius);
    font-size: 0.813rem; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; transition: var(--transition-fast);
}
.action-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.action-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* 消息区域 */
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; }
.welcome-message { text-align: center; padding: 60px 20px; animation: slideUp 0.5s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.welcome-icon {
    width: 80px; height: 80px; background: var(--gradient-primary); border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 24px;
    box-shadow: 0 12px 32px rgba(8, 145, 178, 0.3);
}
.welcome-icon svg { width: 44px; height: 44px; fill: white; }
.welcome-message h3 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.welcome-message p { font-size: 1rem; color: var(--text-secondary); max-width: 400px; margin: 0 auto 32px; }
.quick-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 600px; margin: 0 auto; }
.quick-prompt {
    padding: 12px 20px; background: white; border: 1px solid var(--border);
    border-radius: var(--radius-full); font-size: 0.875rem; color: var(--text-secondary); transition: var(--transition);
}
.quick-prompt:hover { background: white; border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }

/* 消息气泡 */
.message { display: flex; gap: 12px; margin-bottom: 24px; animation: messageIn 0.3s ease; }
@keyframes messageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message.user { flex-direction: row-reverse; }
.message-avatar { width: 36px; height: 36px; background: var(--gradient-primary); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.message.user .message-avatar { background: var(--bg-tertiary); }
.message-avatar svg { width: 20px; height: 20px; fill: white; }
.message.user .message-avatar svg { fill: var(--text-secondary); }
.message-content { max-width: 70%; }
.message-bubble {
    padding: 16px 20px; background: white; border-radius: var(--radius-lg);
    border-top-left-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
    font-size: 0.938rem; line-height: 1.7; color: var(--text-primary);
}
.message.user .message-bubble { background: var(--gradient-primary); color: white; border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-sm); }
.message-bubble p { margin-bottom: 12px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble ul, .message-bubble ol { margin: 12px 0; padding-left: 20px; }
.message-bubble li { margin-bottom: 6px; }
.message-bubble strong { font-weight: 600; }
.message-bubble code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: 0.875em; }
.message.user .message-bubble code { background: rgba(255,255,255,0.2); }
.message-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; padding: 0 4px; }
.message.user .message-time { text-align: right; }

/* 加载动画 */
.typing-indicator { display: flex; gap: 4px; padding: 16px 20px; }
.typing-indicator span { width: 8px; height: 8px; background: var(--text-muted); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out; }
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* 输入区域 */
.chat-input-area { padding: 20px 24px; background: white; border-top: 1px solid var(--border); }
.chat-input-container { display: flex; gap: 12px; align-items: flex-end; background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 8px; border: 2px solid transparent; transition: var(--transition); }
.chat-input-container:focus-within { border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1); }
.chat-input { flex: 1; padding: 12px 16px; background: transparent; border: none; font-size: 0.938rem; color: var(--text-primary); resize: none; min-height: 48px; max-height: 120px; }
.chat-input::placeholder { color: var(--text-muted); }
.send-btn { width: 48px; height: 48px; background: var(--gradient-primary); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }
.send-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3); }
.send-btn:active { transform: scale(0.95); }
.send-btn svg { width: 20px; height: 20px; fill: white; }
.send-btn:disabled { background: var(--bg-tertiary); cursor: not-allowed; transform: none; box-shadow: none; }
.send-btn:disabled svg { fill: var(--text-muted); }

/* 扩展问题区域 */
.suggested-questions { padding: 0 24px 16px; background: var(--bg-secondary); animation: slideUp 0.3s ease; }
.suggested-label { font-size: 0.813rem; color: var(--text-muted); margin-bottom: 12px; font-weight: 500; }
.suggested-list { display: flex; flex-wrap: wrap; gap: 10px; }
.suggested-item {
    padding: 10px 16px; background: white; border: 1px solid var(--border);
    border-radius: var(--radius-full); font-size: 0.875rem; color: var(--text-secondary);
    cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 8px;
}
.suggested-item::before { content: '?'; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: rgba(8, 145, 178, 0.1); border-radius: 50%; font-size: 0.75rem; color: var(--primary); font-weight: 600; }
.suggested-item:hover { background: var(--gradient-primary); color: white; border-color: transparent; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(8, 145, 178, 0.2); }
.suggested-item:hover::before { background: rgba(255,255,255,0.2); color: white; }

/* ========== 案例库页面 ========== */
.cases-page { padding: 32px; max-width: 1200px; margin: 0 auto; }
.page-hero { text-align: center; margin-bottom: 48px; animation: slideUp 0.6s ease; }
.page-hero h1 { font-size: 2.25rem; font-weight: 800; color: var(--text-primary); margin-bottom: 16px; }
.page-hero p { font-size: 1.125rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }
.filter-bar { display: flex; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; animation: slideUp 0.6s ease 0.1s both; }
.search-box { flex: 1; min-width: 280px; position: relative; }
.search-box input { width: 100%; padding: 14px 20px 14px 48px; background: white; border: 2px solid var(--border); border-radius: var(--radius); font-size: 0.938rem; transition: var(--transition); }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1); }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: var(--text-muted); }
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tab { padding: 12px 20px; background: white; border: 2px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; transition: var(--transition); }
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--gradient-primary); border-color: transparent; color: white; }
.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.case-card { background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); cursor: pointer; animation: slideUp 0.5s ease both; }
.case-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.case-card:nth-child(1) { animation-delay: 0.1s; }
.case-card:nth-child(2) { animation-delay: 0.15s; }
.case-card:nth-child(3) { animation-delay: 0.2s; }
.case-card:nth-child(4) { animation-delay: 0.25s; }
.case-card:nth-child(5) { animation-delay: 0.3s; }
.case-card:nth-child(6) { animation-delay: 0.35s; }
.case-card-image { height: 160px; background: var(--gradient-hero); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.case-card-image::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230891b2' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.case-icon { width: 64px; height: 64px; background: white; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); position: relative; z-index: 1; }
.case-icon svg { width: 32px; height: 32px; fill: var(--primary); }
.case-category { position: absolute; top: 16px; left: 16px; padding: 6px 12px; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; color: var(--primary); }
.case-card-body { padding: 24px; }
.case-card-title { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; line-height: 1.4; }
.case-card-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.case-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--border); }
.case-tag { padding: 4px 10px; background: var(--bg-secondary); border-radius: var(--radius-full); font-size: 0.75rem; color: var(--text-muted); }
.case-status { display: flex; align-items: center; gap: 6px; font-size: 0.813rem; color: var(--success); font-weight: 500; }
.case-status-dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }

/* ========== 服务黄页页面 ========== */
.yellow-page { padding: 32px; max-width: 1200px; margin: 0 auto; }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.contact-card { background: white; border-radius: var(--radius-lg); padding: 24px; display: flex; gap: 16px; box-shadow: var(--shadow-sm); transition: var(--transition); cursor: pointer; animation: slideUp 0.5s ease both; }
.contact-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.contact-icon { width: 56px; height: 56px; background: var(--gradient-primary); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-icon svg { width: 28px; height: 28px; fill: white; }
.contact-icon.green { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); }
.contact-icon.orange { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.contact-icon.purple { background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%); }
.contact-icon.red { background: linear-gradient(135deg, #ef4444 0%, #f87171 100%); }
.contact-info { flex: 1; }
.contact-name { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.contact-department { font-size: 0.813rem; color: var(--text-muted); margin-bottom: 12px; }
.contact-phone { font-size: 1.125rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.contact-phone svg { width: 20px; height: 20px; fill: currentColor; }
.call-btn { padding: 8px 16px; background: var(--bg-secondary); border-radius: var(--radius); font-size: 0.813rem; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; transition: var(--transition-fast); margin-top: 12px; }
.contact-card:hover .call-btn { background: var(--primary); color: white; }
.call-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ========== 文书生成页面 ========== */
.document-page { padding: 32px; max-width: 1400px; margin: 0 auto; }
.document-container { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; animation: slideUp 0.5s ease; }
.document-form { background: white; border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.form-section { margin-bottom: 32px; }
.form-section:last-child { margin-bottom: 0; }
.form-section h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.ai-generate-btn {
    padding: 8px 14px; background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    color: white; border-radius: var(--radius); font-size: 0.813rem; font-weight: 500;
    display: flex; align-items: center; gap: 6px; transition: var(--transition); cursor: pointer;
}
.ai-generate-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.ai-generate-btn svg { width: 16px; height: 16px; fill: currentColor; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
    padding: 14px 24px; border-radius: var(--radius); font-size: 0.938rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); cursor: pointer;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-primary { background: var(--gradient-primary); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3); }
.btn-secondary { background: white; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* 文书预览 */
.document-preview { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.preview-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.preview-header h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.preview-hint { font-size: 0.813rem; color: var(--text-muted); }
.preview-content { flex: 1; padding: 32px; overflow-y: auto; background: #fafafa; min-height: 500px; }
.preview-placeholder { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.preview-placeholder svg { width: 80px; height: 80px; fill: var(--border); margin-bottom: 16px; }
.preview-placeholder p { font-size: 0.938rem; }

/* 文书内容样式 */
.doc-content { background: white; padding: 48px; border-radius: var(--radius); box-shadow: var(--shadow-sm); font-size: 0.938rem; line-height: 2; }
.doc-title { text-align: center; font-size: 1.5rem; font-weight: 700; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 2px solid var(--border); }
.doc-section { margin-bottom: 24px; }
.doc-section-title { font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.doc-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.doc-table td { padding: 12px; border: 1px solid var(--border); }
.doc-table td:first-child { font-weight: 500; width: 120px; background: var(--bg-secondary); }
.doc-signature { display: flex; justify-content: space-between; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.signature-item { text-align: center; }
.signature-item p { margin-bottom: 8px; }
.signature-line { display: inline-block; width: 150px; border-bottom: 1px solid var(--text-muted); }

/* ========== 法条库页面 ========== */
.law-page { padding: 32px; max-width: 1400px; margin: 0 auto; }
.law-container { display: grid; grid-template-columns: 240px 1fr; gap: 32px; animation: slideUp 0.5s ease; }
.law-sidebar { background: white; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); height: fit-content; position: sticky; top: 96px; }
.law-sidebar h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; }
.law-categories { display: flex; flex-direction: column; gap: 8px; }
.law-cat-btn { padding: 12px 16px; background: var(--bg-secondary); border-radius: var(--radius); font-size: 0.875rem; color: var(--text-secondary); text-align: left; transition: var(--transition-fast); }
.law-cat-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.law-cat-btn.active { background: rgba(8, 145, 178, 0.1); color: var(--primary); font-weight: 500; }
.law-content { display: flex; flex-direction: column; gap: 24px; }
.law-search { position: relative; }
.law-search input { width: 100%; padding: 14px 20px 14px 48px; background: white; border: 2px solid var(--border); border-radius: var(--radius); font-size: 0.938rem; transition: var(--transition); }
.law-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1); }
.law-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: var(--text-muted); }
.law-list { display: flex; flex-direction: column; gap: 16px; }
.law-item { background: white; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); transition: var(--transition); cursor: pointer; }
.law-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.law-item-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.law-item-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.law-item-code { padding: 4px 10px; background: rgba(8, 145, 178, 0.1); border-radius: var(--radius-full); font-size: 0.75rem; color: var(--primary); font-weight: 500; }
.law-item-content { font-size: 0.938rem; color: var(--text-secondary); line-height: 1.8; }

/* ========== 用户管理页面 ========== */
.users-page { padding: 32px; max-width: 1200px; margin: 0 auto; animation: slideUp 0.5s ease; }
.users-container { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.users-toolbar { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.users-table-wrapper { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); }
.users-table th { background: var(--bg-secondary); font-weight: 600; color: var(--text-primary); font-size: 0.875rem; }
.users-table td { color: var(--text-secondary); font-size: 0.875rem; }
.users-table tr:hover td { background: var(--bg-secondary); }
.users-table .role-badge { padding: 4px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 500; }
.users-table .role-badge.admin { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.users-table .role-badge.user { background: rgba(8, 145, 178, 0.1); color: var(--primary); }
.users-table .actions { display: flex; gap: 8px; }
.users-table .action-btn { padding: 6px 12px; border-radius: var(--radius); font-size: 0.75rem; cursor: pointer; border: none; transition: var(--transition-fast); }
.users-table .action-btn.reset { background: rgba(8, 145, 178, 0.1); color: var(--primary); }
.users-table .action-btn.reset:hover { background: rgba(8, 145, 178, 0.2); }
.users-table .action-btn.delete { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.users-table .action-btn.delete:hover { background: rgba(239, 68, 68, 0.2); }
.table-loading { text-align: center; color: var(--text-muted); padding: 40px !important; }
.reset-pwd-info { margin-bottom: 16px; color: var(--text-secondary); }
.law-item-actions { display: flex; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.law-action-btn { padding: 8px 14px; background: var(--bg-secondary); border-radius: var(--radius); font-size: 0.813rem; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; transition: var(--transition-fast); }
.law-action-btn:hover { background: var(--primary); color: white; }
.law-action-btn svg { width: 14px; height: 14px; fill: currentColor; }

/* ========== 弹窗 ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 1000; animation: fadeIn 0.2s ease; }
.modal-overlay.active { display: flex; }
.modal { width: 100%; max-width: 600px; max-height: 80vh; background: white; border-radius: var(--radius-xl); overflow: hidden; animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: 24px; background: var(--gradient-hero); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.modal-meta { display: flex; gap: 16px; font-size: 0.875rem; color: var(--text-secondary); }
.modal-close { width: 36px; height: 36px; background: white; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; transition: var(--transition-fast); }
.modal-close:hover { background: var(--bg-secondary); }
.modal-close svg { width: 20px; height: 20px; fill: var(--text-secondary); }
.modal-body { padding: 24px; overflow-y: auto; max-height: 50vh; }
.modal-section { margin-bottom: 24px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.modal-section-title svg { width: 18px; height: 18px; fill: var(--primary); }
.modal-section p { font-size: 0.938rem; color: var(--text-secondary); line-height: 1.7; }
.modal-footer { padding: 20px 24px; background: var(--bg-secondary); border-top: 1px solid var(--border); display: flex; gap: 12px; }
.modal-btn { flex: 1; padding: 14px 20px; border-radius: var(--radius); font-size: 0.938rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); }
.modal-btn svg { width: 18px; height: 18px; fill: currentColor; }
.modal-btn-primary { background: var(--gradient-primary); color: white; }
.modal-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3); }
.modal-btn-secondary { background: white; color: var(--text-secondary); border: 1px solid var(--border); }
.modal-btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ========== Toast ========== */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); padding: 14px 24px; background: var(--text-primary); color: white; border-radius: var(--radius); font-size: 0.875rem; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: var(--transition); z-index: 2000; }
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state svg { width: 80px; height: 80px; fill: var(--border); margin-bottom: 24px; }
.empty-state h3 { font-size: 1.25rem; color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { font-size: 0.938rem; color: var(--text-muted); }

/* ========== 底部导航 ========== */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 72px; background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(12px); border-top: 1px solid var(--border); justify-content: space-around; align-items: center; padding: 0 16px 8px; z-index: 100; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08); }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 16px; border: none; background: transparent; cursor: pointer; border-radius: var(--radius); transition: var(--transition-fast); min-width: 70px; }
.bottom-nav-item svg { width: 24px; height: 24px; fill: var(--text-muted); transition: var(--transition-fast); }
.bottom-nav-item span { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; transition: var(--transition-fast); }
.bottom-nav-item.active svg { fill: var(--primary); }
.bottom-nav-item.active span { color: var(--primary); }
.bottom-nav-item:active { background: rgba(8, 145, 178, 0.08); }

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
    .document-container { grid-template-columns: 1fr; }
    .law-container { grid-template-columns: 1fr; }
    .law-sidebar { position: static; }
    .law-categories { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 1024px) {
    .header-nav { display: none; }
    .bottom-nav { display: flex; }
    .nav-btn { min-width: 70px; }
    .cases-page, .yellow-page, .document-page, .law-page { padding: 24px 16px; }
    .page-hero h1 { font-size: 1.75rem; }
    .cases-grid { grid-template-columns: 1fr; }
}

/* ========== 角色选择弹窗 ========== */
.role-modal, .model-modal {
    max-width: 500px;
    width: 90%;
}

.modal-header {
    text-align: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.role-list {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.role-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.role-item:last-child {
    margin-bottom: 0;
}

.role-item:hover {
    background: white;
    border-color: var(--primary);
    transform: translateX(4px);
}

.role-item.selected {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.role-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: white;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.role-info h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.role-info p {
    font-size: 0.813rem;
    color: var(--text-muted);
}

/* ========== 模型选择弹窗 ========== */
.model-list {
    padding: 16px;
}

.model-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.model-item:last-child {
    margin-bottom: 0;
}

.model-item:hover {
    background: white;
    border-color: var(--info);
}

.model-item.active {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.model-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.model-badge.pro {
    background: rgba(8, 145, 178, 0.1);
    color: var(--primary);
}

.model-badge.fast {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.model-badge.deep {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.model-badge.comprehensive {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.model-info h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.model-info p {
    font-size: 0.813rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .app-header { padding: 0 16px; }
    .header-logo h1 { display: none; }
    .user-name { display: none; }
    .chat-header { padding: 16px; }
    .chat-header h2 { font-size: 1rem; }
    .chat-header-actions { gap: 6px; }
    .action-btn { padding: 8px 12px; font-size: 0.75rem; }
    .action-btn span { display: none; }
    .message-content { max-width: 85%; }
    .welcome-icon { width: 64px; height: 64px; }
    .welcome-icon svg { width: 32px; height: 32px; }
    .welcome-message h3 { font-size: 1.25rem; }
    .quick-prompts { flex-direction: column; }
    .quick-prompt { width: 100%; text-align: center; }
    .form-row { grid-template-columns: 1fr; }
    .document-form { padding: 20px; }
    .doc-content { padding: 24px; }
    .doc-title { font-size: 1.25rem; }
    .doc-signature { flex-direction: column; gap: 24px; }
    .modal { max-height: 90vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: 100%; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .chat-messages { padding: 16px; }
    .chat-input-area { padding: 12px 16px 80px; }
    
    /* 移动端侧边栏优化 */
    .chat-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 300px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-xl);
    }
    .chat-sidebar.open {
        left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .sidebar-toggle {
        display: flex !important;
    }
    
    /* 移动端聊天头部显示侧边栏按钮 */
    .chat-header-info {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .sidebar-menu-btn {
        display: block;
        width: 36px;
        height: 36px;
        background: var(--bg-secondary);
        border-radius: var(--radius);
        display: none;
        align-items: center;
        justify-content: center;
    }
    .sidebar-menu-btn svg { width: 20px; height: 20px; fill: var(--text-secondary); }
    
    /* 移动端输入框优化 */
    .chat-input-wrapper {
        display: flex;
        gap: 8px;
        align-items: flex-end;
    }
    .chat-input {
        flex: 1;
        min-height: 44px;
        max-height: 120px;
        padding: 12px 16px;
        border: 2px solid var(--border);
        border-radius: 22px;
        font-size: 16px;
        resize: none;
        line-height: 1.4;
    }
    .chat-input:focus {
        border-color: var(--primary);
    }
    .send-btn {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--gradient-primary);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .send-btn svg { width: 20px; height: 20px; fill: white; }
    
    /* 移动端用户管理页面 */
    .users-page { padding: 16px; }
    .users-table { font-size: 0.813rem; }
    .users-table th, .users-table td { padding: 12px 8px; }
    .users-table .actions { flex-direction: column; gap: 4px; }
    .users-table .action-btn { padding: 6px 8px; font-size: 0.688rem; width: 100%; }
    
    /* 移动端欢迎页优化 */
    .welcome-container { padding: 24px 16px; }
    .suggested-questions { padding: 0 16px; }
    .suggested-question { padding: 10px 14px; font-size: 0.813rem; }
    
    /* 移动端案例库 */
    .cases-grid { gap: 12px; }
    .case-card { padding: 16px; }
    .case-card-title { font-size: 0.938rem; }
}

@media (max-width: 768px) {
    .sidebar-menu-btn { display: flex !important; }
}
