/**
 * 安丘门户 - 全局样式表
 * Modern, clean, responsive design
 */

/* ========== CSS Variables ========== */
:root {
    --primary: #1a56db;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --primary-bg: #eff6ff;
    --secondary: #dc2626;
    --secondary-light: #ef4444;
    --success: #16a34a;
    --success-light: #22c55e;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --info: #0ea5e9;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: all 0.2s ease;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --container-max: 1200px;
    --navbar-height: 64px;
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: 0.5rem;
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding-top: var(--navbar-height);
    min-height: calc(100vh - 200px);
}

/* ========== Navigation ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

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

.navbar-brand:hover {
    color: var(--primary-dark);
}

.navbar-brand img {
    height: 36px;
    width: auto;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.navbar-menu a {
    padding: 0.5rem 0.875rem;
    color: var(--gray-600);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--primary);
    background: var(--primary-bg);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--gray-700);
}

.navbar-toggle svg {
    width: 24px;
    height: 24px;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 999;
    overflow-y: auto;
    padding: 1rem;
}

.mobile-menu.open {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 0.875rem 1rem;
    color: var(--gray-700);
    font-size: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background: var(--primary-bg);
    color: var(--primary);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

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

.btn-success:hover:not(:disabled) {
    background: #15803d;
    color: var(--white);
}

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

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.0625rem;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 36px;
    min-height: 36px;
}

/* ========== Cards ========== */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.card-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Horizontal card */
.card-horizontal {
    display: flex;
    flex-direction: row;
}

.card-horizontal .card-img {
    width: 200px;
    height: auto;
    min-height: 140px;
    flex-shrink: 0;
}

.card-horizontal .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ========== Sections ========== */
.section {
    padding: 3rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    position: relative;
    padding-left: 1rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--primary);
    border-radius: 2px;
}

.section-more {
    font-size: 0.875rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.section-more:hover {
    color: var(--primary);
}

/* ========== Hero Carousel ========== */
.hero-carousel {
    position: relative;
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.carousel-slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: var(--white);
}

.carousel-slide .overlay h2 {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.carousel-slide .overlay p {
    font-size: 0.9375rem;
    opacity: 0.9;
}

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.carousel-dot.active {
    background: var(--white);
    width: 24px;
    border-radius: 5px;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.25rem;
    color: var(--gray-700);
}

.carousel-nav:hover {
    background: var(--white);
}

.carousel-prev { left: 1rem; }
.carousel-next { right: 1rem; }

/* ========== Forms ========== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-800);
    transition: var(--transition);
    font-family: var(--font-sans);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}

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

.form-hint {
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--secondary);
    margin-top: 0.25rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Search input */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box .form-input {
    padding-left: 2.75rem;
    padding-right: 6rem;
    height: 48px;
    font-size: 1rem;
    border-radius: var(--radius-full);
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box .search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-item {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

/* Pill tabs */
.tabs-pills {
    border-bottom: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tabs-pills .tab-item {
    border-bottom: none;
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: var(--gray-100);
}

.tabs-pills .tab-item.active {
    background: var(--primary);
    color: var(--white);
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination button {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

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

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

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--gray-400);
    font-size: 1.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* ========== Loading Spinner ========== */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

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

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
    color: var(--gray-400);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: 0.75rem;
}

.skeleton-img {
    height: 200px;
    width: 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== Toast Notifications ========== */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 1rem);
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 280px;
    max-width: 420px;
    animation: slideIn 0.3s ease;
    background: var(--white);
    border-left: 4px solid var(--gray-400);
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--secondary); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== Badges ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-danger { background: #fee2e2; color: var(--secondary); }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ========== Page Header ========== */
.page-header {
    padding: 2rem 0 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--gray-500);
}

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

.breadcrumb .separator::before {
    content: '/';
}

/* ========== Footer ========== */
.footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
}

.footer-desc {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--gray-400);
}

.footer-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-links a {
    display: block;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--gray-400);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ========== Community Styles ========== */
.post-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.post-card:hover {
    border-color: var(--gray-200);
    box-shadow: var(--shadow);
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.post-author {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--gray-800);
}

.post-date {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.post-card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.post-card-title:hover {
    color: var(--primary);
}

.post-card-text {
    font-size: 0.9375rem;
    color: var(--gray-500);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.post-card-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.post-card-images img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.post-card-footer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    font-size: inherit;
    color: inherit;
    padding: 0;
}

.post-action:hover {
    color: var(--primary);
}

.post-action.liked {
    color: var(--secondary);
}

/* Post detail */
.post-detail {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.post-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.post-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.post-detail-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-700);
    margin-bottom: 1.5rem;
}

.post-detail-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.post-detail-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 1.5rem;
}

/* Comments */
.comment-section {
    margin-top: 1.5rem;
}

.comment-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.comment-form .form-textarea {
    min-height: 80px;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 500;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.comment-text {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.comment-meta {
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin-top: 0.375rem;
    display: flex;
    gap: 1rem;
}

/* ========== Search Page Styles ========== */
.search-hero {
    padding: 3rem 0 2rem;
    text-align: center;
}

.search-hero h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.search-bar-large {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-bar-large .form-input {
    height: 56px;
    padding: 0 4rem 0 1.5rem;
    font-size: 1.0625rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-200);
}

.search-bar-large .form-input:focus {
    border-color: var(--primary);
}

.search-bar-large .search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    height: 42px;
    padding: 0 1.5rem;
    border-radius: var(--radius);
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    z-index: 100;
    display: none;
    overflow: hidden;
}

.autocomplete-dropdown.open {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.autocomplete-item:hover {
    background: var(--gray-50);
}

.autocomplete-item .type-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-500);
}

/* AI Summary Card */
.ai-summary-card {
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.ai-summary-header .ai-icon {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.ai-summary-content {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--gray-700);
}

.ai-summary-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    color: var(--gray-500);
}

/* Search results */
.result-group {
    margin-bottom: 2rem;
}

.result-group-title {
    font-size: 1.125rem;
    font-weight: 600;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-item {
    padding: 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.result-item:hover {
    background: var(--gray-50);
}

.result-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.375rem;
}

.result-item-title mark {
    background: #fef08a;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.result-item-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-item-meta {
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin-top: 0.375rem;
}

/* ========== Admin Panel Styles ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--gray-900);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-700);
}

.admin-sidebar-header h2 {
    color: var(--white);
    font-size: 1.125rem;
}

.admin-sidebar-header p {
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.admin-nav {
    padding: 1rem 0;
}

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

.admin-nav-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.05em;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--gray-300);
    font-size: 0.9375rem;
    transition: var(--transition);
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.admin-nav a.active {
    background: rgba(26,86,219,0.2);
    color: var(--primary-light);
    border-right: 3px solid var(--primary-light);
}

.admin-nav a .icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 1.5rem;
    background: var(--gray-50);
    min-height: 100vh;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.admin-header h1 {
    font-size: 1.5rem;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.stat-card-icon.blue { background: var(--primary-bg); color: var(--primary); }
.stat-card-icon.green { background: #dcfce7; color: var(--success); }
.stat-card-icon.red { background: #fee2e2; color: var(--secondary); }
.stat-card-icon.yellow { background: #fef3c7; color: #b45309; }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Admin tables */
.table-container {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.table-header h3 {
    font-size: 1rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-search {
    width: 200px;
}

.table-search .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--gray-100);
}

table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.8125rem;
    white-space: nowrap;
}

table tr:hover {
    background: var(--gray-50);
}

table td .actions {
    display: flex;
    gap: 0.375rem;
}

/* Admin form panel */
.admin-form-panel {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.admin-form-panel h3 {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

/* Image upload */
.image-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.image-upload:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.image-upload .icon {
    font-size: 2rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.image-upload p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.image-preview {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    overflow: hidden;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Status toggle */
.status-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--gray-300);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.status-toggle.active {
    background: var(--success);
}

.status-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.status-toggle.active::after {
    left: 22px;
}

/* ========== Login Page ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-bg), #f5f3ff);
    padding: 1rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
}

.login-card .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-error {
    background: #fee2e2;
    color: var(--secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.login-error.show {
    display: block;
}

/* ========== Download Page ========== */
.download-hero {
    text-align: center;
    padding: 4rem 0 3rem;
}

.download-hero h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.download-hero p {
    font-size: 1.125rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--gray-900);
    color: var(--white);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.download-btn:hover {
    background: var(--gray-800);
    color: var(--white);
    transform: translateY(-2px);
}

.download-btn .icon {
    font-size: 2rem;
}

.download-btn .text {
    text-align: left;
}

.download-btn .text small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.download-btn .text strong {
    display: block;
    font-size: 1.125rem;
}

.qr-section {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.qr-item {
    text-align: center;
}

.qr-placeholder {
    width: 160px;
    height: 160px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: var(--gray-400);
    font-size: 0.875rem;
    border: 2px dashed var(--gray-300);
}

/* ========== Detail Page ========== */
.detail-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.detail-header {
    margin-bottom: 2rem;
}

.detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--gray-400);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.detail-cover {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    max-height: 400px;
    object-fit: cover;
}

.detail-content {
    font-size: 1.0625rem;
    line-height: 1.9;
    color: var(--gray-700);
}

.detail-content p {
    margin-bottom: 1.25rem;
}

.detail-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.detail-content h2,
.detail-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

/* ========== Utility Classes ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--secondary); }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-100 { width: 100%; }
.hidden { display: none !important; }

/* ========== Mobile Responsive ========== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    
    .navbar-menu {
        display: none;
    }
    
    .navbar-actions .btn {
        display: none;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .hero-carousel {
        height: 240px;
        border-radius: var(--radius);
    }
    
    .carousel-slide .overlay h2 {
        font-size: 1.125rem;
    }
    
    .carousel-slide .overlay p {
        font-size: 0.8125rem;
    }
    
    .carousel-nav {
        width: 32px;
        height: 32px;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .card-grid,
    .card-grid-3,
    .card-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .card-horizontal {
        flex-direction: column;
    }
    
    .card-horizontal .card-img {
        width: 100%;
        height: 180px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card-value {
        font-size: 1.25rem;
    }
    
    /* Admin responsive */
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
        padding: 1rem;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-search {
        width: 100%;
    }
    
    /* Detail page */
    .detail-title {
        font-size: 1.375rem;
    }
    
    .detail-meta {
        gap: 0.75rem;
    }
    
    /* Community */
    .post-card-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Search */
    .search-hero h1 {
        font-size: 1.5rem;
    }
    
    .search-bar-large .form-input {
        height: 48px;
    }
    
    .download-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .qr-section {
        gap: 2rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }
    
    /* Modal */
    .modal {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Tabs */
    .tabs {
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-item {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .card-grid,
    .card-grid-3,
    .card-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .post-card {
        padding: 1rem;
    }
}

/* ========== Admin sidebar toggle for mobile ========== */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.admin-sidebar-overlay.open {
    display: block;
}

.admin-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
    color: var(--gray-700);
}

@media (max-width: 768px) {
    .admin-mobile-toggle {
        display: flex;
    }
}

/* ========== Tab panels ========== */
.tab-panel {
    margin-bottom: 1.5rem;
}

/* ========== Filter bar ========== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-bar .form-select {
    width: auto;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.filter-bar .form-input {
    width: auto;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* ========== Confirm Dialog ========== */
.confirm-dialog {
    text-align: center;
    padding: 1rem;
}

.confirm-dialog .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirm-dialog h3 {
    margin-bottom: 0.5rem;
}

.confirm-dialog p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.confirm-dialog .btn-group {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

/* ========== Character counter ========== */
.char-counter {
    text-align: right;
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: var(--warning);
}

.char-counter.danger {
    color: var(--secondary);
}

/* ========== Category selector (grid of icons) ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.category-option:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.category-option.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

.category-option .icon {
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
