* {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK", sans-serif;
    background: #f3f4f6;
    color: #111827;
}
a {
    color: #4f46e5;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}
header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}
header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
}
header h1 {
    margin: 0;
    display: flex;
    align-items: center;
}
.site-logo {
    height: 60px;
    width: auto;
    vertical-align: middle;
    margin-right: 8px;
    transform: scaleX(-1);
}
nav a {
    margin-left: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #374151;
}
nav a.active {
    background: #e0e7ff;
    color: #4f46e5;
}
main.container {
    padding: 20px 16px;
}
.top-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.search-box {
    display: flex;
    gap: 8px;
}
input[type="text"], input[type="url"], input[type="email"], input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    background: white;
}
input[readonly], textarea[readonly] {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    border-color: #d1d5db;
}
.btn {
    display: inline-block;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.05s ease-in;
}
.btn:active {
    transform: translateY(1px);
}
.btn-primary {
    background: #4f46e5;
    color: white;
}
.btn-success {
    background: #10b981;
    color: white;
}
.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-outline-primary {
    border: 1px solid #4f46e5;
    background: white;
    color: #4f46e5;
}
.btn-secondary {
    background: #6b7280;
    color: white;
}
.card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.loading {
    background: #fff7ed;
    color: #9a3412;
    border: 1px dashed #fdba74;
    padding: 10px 14px;
    border-radius: 8px;
    display: inline-block;
}
.news-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.news-item {
    display: flex;
    gap: 16px;
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.news-image {
    width: 180px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    background: #e5e7eb;
    flex-shrink: 0;
}
.news-content {
    flex: 1;
    min-width: 0;
}
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}
.news-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
    line-height: 1.4;
}
.news-title a {
    color: inherit;
    text-decoration: none;
}
.news-title a:hover {
    color: #667eea;
}
.news-category {
    display: inline-block;
    padding: 4px 10px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}
.news-summary {
    color: #6b7280;
    margin: 10px 0;
    line-height: 1.6;
}
.news-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: #9ca3af;
    margin-top: 8px;
    flex-wrap: wrap;
}
.no-news {
    color: #9ca3af;
    text-align: center;
    padding: 16px 0;
}
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    background: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.filters {
    display: flex;
    align-items: center;
    gap: 12px;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.events-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 20px;
}
.event-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}
.event-title {
    font-size: 1.4rem;
    color: #1f2937;
    margin: 0;
}
.event-desc {
    color: #6b7280;
    font-size: 0.95rem;
}
.event-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.event-news-item {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.event-news-item:last-child {
    border-bottom: none;
}
.event-news-title {
    color: #374151;
    text-decoration: none;
    font-size: 1.05rem;
    flex: 1;
}
.event-news-title:hover {
    color: #667eea;
}
.event-news-meta {
    font-size: 0.85rem;
    color: #9ca3af;
    white-space: nowrap;
}
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}
.message.success {
    background: #10b981;
    color: white;
}
.message.error {
    background: #ef4444;
    color: white;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.close:hover,
.close:focus {
    color: #333;
    text-decoration: none;
}
.view-title {
    margin: 16px 0;
    padding-left: 12px;
    border-left: 5px solid #667eea;
    color: #1f2937;
}
footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 24px 0;
    margin-top: 30px;
}
#fetchLogSidebar {
    position: fixed;
    right: 16px;
    top: 80px;
    width: 380px;
    max-height: 75vh;
    background: #0b1020;
    color: #a6e3a1;
    border: 1px solid #1f2937;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 1000;
    display: none;
    overflow: hidden;
}
#fetchLogSidebar.min {
    width: 44px;
    right: 8px;
    border-radius: 10px;
}
#fetchLogSidebar.min .fetchlog-header {
    padding: 10px;
}
#fetchLogSidebar.min .fetchlog-actions {
    display: none;
}
#fetchLogSidebar.min #fetchLogSidebarOutput {
    display: none;
}
.fetchlog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #111827;
    color: #e5e7eb;
}
.fetchlog-actions {
    display: flex;
    gap: 8px;
}
#fetchLogSidebarOutput {
    margin: 0;
    padding: 12px;
    max-height: calc(75vh - 48px);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 6px;
}
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 10px;
    }
    nav {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .news-item {
        flex-direction: column;
    }
    .news-image {
        width: 100%;
        height: 200px;
    }
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        width: 100%;
    }
    .events-list {
        grid-template-columns: 1fr;
    }
}
.news-item.quick-mode {
    padding: 15px;
    background: #fafafa;
    border-left: 4px solid #10b981;
}
.news-ai-summary {
    background: #f0fdf4;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 10px 0;
    color: #374151;
}
.news-ai-summary ul {
    margin: 0;
    padding-left: 20px;
}
.news-ai-summary li {
    margin-bottom: 5px;
    line-height: 1.5;
}
.news-item.quick-mode .news-title {
    margin-bottom: 5px;
}
.news-item.quick-mode .news-meta {
    margin-top: 5px;
}
