/* 朱律师的法律工具箱 - 全局样式 */
/* 清新风格设计 */

:root {
    --primary-color: #2c5282;
    --secondary-color: #4299e1;
    --accent-color: #38a169;
    --background-color: #f7fafc;
    --card-background: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: var(--card-background);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.navbar-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--primary-color);
    background: rgba(44, 82, 130, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1a365d;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #2b6cb0;
}

.btn-success {
    background: var(--accent-color);
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* 卡片 */
.card {
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.card-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* 头部区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 搜索框 */
.search-box {
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.search-btn:hover {
    background: #1a365d;
}

/* 分类标签 */
.category-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    justify-content: center;
}

.category-tag {
    padding: 0.5rem 1.25rem;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
}

.category-tag:hover,
.category-tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 页脚 */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 提示信息 */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #c6f6d5;
    border-color: var(--accent-color);
    color: #22543d;
}

.alert-error {
    background: #fed7d7;
    border-color: #e53e3e;
    color: #742a2a;
}

.alert-warning {
    background: #feebc8;
    border-color: #dd6b20;
    color: #7c2d12;
}

.alert-info {
    background: #bee3f8;
    border-color: var(--secondary-color);
    color: #2c5282;
}

/* 表单 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* 工具详情 */
.tool-content {
    background: var(--card-background);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
}

.tool-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.tool-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

/* 后台管理 */
.admin-sidebar {
    background: var(--card-background);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    height: fit-content;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin-bottom: 0.5rem;
}

.admin-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--primary-color);
    color: white;
}

.admin-content {
    flex: 1;
}

.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 1rem;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-background);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-primary);
}

.table tr:hover {
    background: var(--background-color);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-warning {
    background: #feebc8;
    color: #7c2d12;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.badge-info {
    background: #bee3f8;
    color: #2c5282;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .tool-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-sidebar {
        margin-bottom: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* 工具内容区域样式 */
.tool-body {
    line-height: 1.8;
}

.tool-body h1,
.tool-body h2,
.tool-body h3,
.tool-body h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tool-body p {
    margin-bottom: 1rem;
}

.tool-body ul,
.tool-body ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.tool-body li {
    margin-bottom: 0.5rem;
}

.tool-body a {
    color: var(--secondary-color);
    text-decoration: none;
}

.tool-body a:hover {
    text-decoration: underline;
}

.tool-body pre {
    background: var(--background-color);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.tool-body code {
    background: var(--background-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(44, 82, 130, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
