/* 所有样式保持不变（与您原来相同，此处完整保留） */
header { display: block !important; text-align: left; border-bottom: 2px solid #e9ecef; padding-bottom: 15px; margin-bottom: 25px; }
header h1 { text-align: center !important; font-size: 1.8rem; margin: 0.5rem 0; }
header h1 a { text-decoration: none; color: inherit; }
.user-area { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; margin-bottom: 0.5rem; }
.user-area span { font-size: 0.9rem; white-space: nowrap; color: #333; }
.user-area a, .user-area .btn-publish, .user-area .btn-logout, .user-area .btn-login, .user-area .btn-register { display: inline-block; padding: 5px 10px; font-size: 0.8rem; border-radius: 30px; text-decoration: none; background: #f0f2f5; color: #1e466e; transition: all 0.2s; white-space: nowrap; line-height: 1.2; }
.user-area .btn-publish { background: #1e466e; color: white; }
.user-area .btn-logout { background: #eef2f7; color: #1e466e; }
.user-area .btn-login, .user-area .btn-register { background: #e9ecef; }
@media (max-width: 480px) { .user-area a, .user-area .btn-publish, .user-area .btn-logout, .user-area .btn-login, .user-area .btn-register { padding: 4px 8px; font-size: 0.7rem; } .user-area span { font-size: 0.8rem; } .user-area { gap: 5px; } }
body { font-size: 16px; }
.search-box { margin: 20px 0 30px; text-align: center; }
.search-form { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; max-width: 480px; margin: 0 auto; width: 100%; }
.search-form input[type="text"] { flex: 1 1 auto; min-width: 0; padding: 10px 14px; border: 1px solid #ccc; border-radius: 30px; font-size: 1rem; }
.search-form button, .btn-clear { flex-shrink: 0; white-space: nowrap; background: #1e466e; color: white; border: none; padding: 10px 18px; border-radius: 30px; cursor: pointer; text-decoration: none; font-size: 0.95rem; }
.search-form button:hover { background: #0f2e48; }
.btn-clear { background: #6c757d; }
@media (max-width: 640px) { .search-form { max-width: 100%; margin: 0; gap: 8px; } .search-form input[type="text"] { padding: 9px 12px; } .search-form button, .btn-clear { padding: 9px 14px; } }
.menu-bar { margin: 20px 0 15px; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 8px; }
.menu-list { display: inline-flex; gap: 8px; align-items: center; }
.menu-item { display: inline-flex; align-items: center; background: #f0f2f5; border-radius: 30px; padding: 6px 14px; font-size: 0.9rem; text-decoration: none; color: #1e466e; transition: all 0.2s; white-space: nowrap; cursor: pointer; border: none; font-family: inherit; }
.menu-item.active { background: #1e466e; color: white; }
.menu-item:hover { background: #d0d4dc; }
.menu-item .delete-cat-btn { margin-left: 8px; background: none; border: none; color: #e74c3c; cursor: pointer; font-size: 14px; padding: 0 2px; }
.menu-item .delete-cat-btn:hover { color: #c0392b; }
@media (max-width: 480px) { .menu-item { padding: 4px 10px; font-size: 0.8rem; } .menu-list { gap: 6px; } }
.subcat-item, .book-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #eaeef2; }
.subcat-name, .book-title { font-size: 24px; font-weight: 500; text-decoration: none; color: #1e466e; word-break: break-word; background: none; }
.subcat-name:hover, .book-title:hover { text-decoration: underline; }
.subcat-actions, .action-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.edit-subcat, .delete-subcat, .edit-book-btn, .delete-book-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; border-radius: 20px; transition: background 0.2s; }
.edit-subcat:hover, .edit-book-btn:hover { background: #e9ecef; }
.delete-subcat:hover, .delete-book-btn:hover { background: #fee2e2; color: #e74c3c; }
.delete-subcat, .delete-book-btn { color: #e74c3c; }
.book-excerpt { font-size: 0.85rem; color: #495057; margin-top: 6px; line-height: 1.4; }
.book-excerpt mark { background-color: #ffeb3b; color: #000; padding: 0 2px; border-radius: 3px; }
@media (max-width: 480px) { .subcat-name, .book-title { font-size: 20px; } .edit-subcat, .delete-subcat, .edit-book-btn, .delete-book-btn { font-size: 1rem; padding: 2px 6px; } .book-excerpt { font-size: 0.75rem; } }
.load-more-btn { text-align: center; margin: 30px 0 20px; }
.load-more-btn button { background: #1e466e; color: white; border: none; border-radius: 40px; padding: 10px 25px; font-size: 1rem; cursor: pointer; }
.load-more-btn button:hover { background: #0f2e48; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: white; max-width: 600px; width: 90%; padding: 25px; border-radius: 16px; position: relative; }
.modal-close { position: absolute; top: 12px; right: 18px; font-size: 24px; cursor: pointer; color: #666; }
.modal-content input, .modal-content textarea, .modal-content select { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; box-sizing: border-box; }
.modal-content button { background: #1e466e; color: white; border: none; padding: 10px 20px; border-radius: 30px; cursor: pointer; }
.error-msg { color: #c00; margin-top: 10px; }
.modal-tabs { display: flex; gap: 20px; margin-bottom: 20px; border-bottom: 1px solid #ddd; }
.modal-tab { cursor: pointer; padding: 8px 0; font-weight: bold; color: #555; }
.modal-tab.active { color: #1e466e; border-bottom: 2px solid #1e466e; }
.modal-form { display: none; }
.modal-form.active { display: block; }
.modal-form input { width: 100%; padding: 10px; margin: 8px 0; border: 1px solid #ccc; border-radius: 8px; }
.modal-form button { width: 100%; margin-top: 15px; }
/* 新增公告栏样式 */
.announcement {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 20px;
    margin: 15px 0 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    position: relative;
}
.announcement .edit-announcement {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    color: #856404;
}
.announcement .edit-announcement:hover {
    background: rgba(0,0,0,0.2);
}
.announcement-content {
    padding-right: 60px;
}
.announcement-content p {
    margin: 0;
}