/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* ========== 法规正文（尽量贴近 Word 的空格/换行排版） ========== */
.regulation-body {
    word-break: break-word;
    line-height: 2.0;
    font-size: 15px;
    text-align: justify;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

/* 法规正文内的段落样式 */
.regulation-body p {
    margin-bottom: 1.2em;
    line-height: 2.0;
    text-indent: 0;
}

/* 法规正文内的标题样式 */
.regulation-body h1,
.regulation-body h2,
.regulation-body h3,
.regulation-body h4 {
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.4;
    color: #1a202c;
}

.regulation-body h1 {
    font-size: 1.5em;
    text-align: center;
}

.regulation-body h2 {
    font-size: 1.3em;
}

.regulation-body h3 {
    font-size: 1.1em;
}

/* 法规正文内的列表样式 */
.regulation-body ul,
.regulation-body ol {
    margin: 1em 0;
    padding-left: 2em;
}

.regulation-body li {
    margin-bottom: 0.5em;
    line-height: 1.9;
}

/* 法规正文内的表格样式 */
.regulation-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 14px;
}

.regulation-body table th {
    background-color: #f7fafc;
    font-weight: 600;
    padding: 10px;
    border: 1px solid #cbd5e0;
    text-align: left;
}

.regulation-body table td {
    padding: 10px;
    border: 1px solid #e2e8f0;
    line-height: 1.6;
}

.regulation-body table tr:hover {
    background-color: #f7fafc;
}

/* 法规正文内的加粗文本 */
.regulation-body strong,
.regulation-body b {
    font-weight: 700;
    color: #2d3748;
}

/* 法规正文内的引用样式 */
.regulation-body blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1em;
    margin: 1em 0;
    color: #4b5563;
    font-style: italic;
}

/* 法规正文内的代码样式 */
.regulation-body code {
    background-color: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9em;
}

/* 法规正文内的链接样式 */
.regulation-body a {
    color: #3b82f6;
    text-decoration: underline;
}

.regulation-body a:hover {
    color: #2563eb;
}

/* 保留空格和换行 */
.regulation-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #f9fafb;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
}

/* ========== 自定义滚动条 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ========== 表格样式 ========== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead {
    background: #f7fafc;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #2d3748;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f7fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格行可点击样式 */
.data-table tbody tr.clickable {
    cursor: pointer;
}

.data-table tbody tr.clickable:hover {
    background-color: #edf2f7;
}

/* ========== 列表项样式 ========== */
.list-item {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.list-item:hover {
    background-color: #f7fafc;
    border-left: 3px solid #3b82f6;
    padding-left: 17px;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 10px;
    line-height: 1.4;
}

.list-item-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #718096;
    flex-wrap: nowrap;
    align-items: center;
}

.list-item-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.list-item-meta-item i {
    flex-shrink: 0;
}

/* ========== 详情页样式 ========== */
.detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.detail-header-content {
    position: relative;
    z-index: 1;
}

.detail-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.detail-meta-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-meta-item i {
    font-size: 18px;
    opacity: 0.9;
}

.detail-meta-label {
    font-weight: 600;
    opacity: 0.9;
    font-size: 13px;
}

.detail-meta-value {
    font-weight: 500;
    font-size: 14px;
}

.detail-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-content {
    background: white;
    margin: 0;
    padding: 0;
}

.detail-section {
    padding: 40px;
    border-bottom: 1px solid #e2e8f0;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 20px;
    padding-left: 16px;
    border-left: 4px solid #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-section-title i {
    color: #667eea;
}

.detail-section-content {
    white-space: pre-wrap;
    line-height: 2;
    font-size: 16px;
    color: #2d3748;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.detail-section-content mark {
    background: #fef08a;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* ========== 搜索框样式 ========== */
.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

/* ========== 按钮样式 ========== */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: white;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

.btn-outline:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* ========== 标签样式 ========== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-approved {
    background: #d1fae5;
    color: #065f46;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* ========== 聊天消息样式 ========== */
.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.message-self {
    background: #3b82f6;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message-other {
    background: white;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 16px;
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .list-item-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .detail-meta {
        flex-direction: column;
        gap: 12px;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

/* ========== 过渡动画 ========== */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from, .fade-leave-to {
    opacity: 0;
}

.slide-enter-active, .slide-leave-active {
    transition: transform 0.3s ease;
}

.slide-enter-from {
    transform: translateX(20px);
}

.slide-leave-to {
    transform: translateX(-20px);
}

