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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-selector label {
    font-weight: 500;
}

.date-selector input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.button-group {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-info {
    background: #8e44ad;
    color: white;
}

.btn-info:hover {
    background: #7d3c98;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

select.btn {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
    background-color: white;
    border: 1px solid #ddd;
    outline: none;
    cursor: pointer;
}

select.btn:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
}

select.btn:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.left-panel, .right-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.panel-header {
    margin-bottom: 15px;
}

.panel-header h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.search-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-controls input[type="text"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-controls select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.playlist-controls {
    display: flex;
    gap: 10px;
}

/* Category filter toolbar */
.category-filter-toolbar {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
    flex-shrink: 0;
}

.category-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-filter-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
    white-space: nowrap;
}

.category-filter-btn:hover {
    background: #e3f2fd;
    border-color: #3498db;
    color: #2c3e50;
}

.category-filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.category-filter-btn.active:hover {
    background: #2980b9;
    border-color: #2980b9;
}

#filtered-count {
    color: #e74c3c;
    font-weight: 500;
}

.news-stats {
    padding: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
}

.news-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.news-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    position: relative;
}

.news-item:hover {
    background: #f8f9fa;
}

.news-item.dragging {
    opacity: 0.5;
}


.news-content {
    flex: 1;
    min-width: 0;
}

.news-title {
    font-weight: 500;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.news-category {
    background: #2c3e50;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    margin-right: 8px;
}

.news-time {
    color: #7f8c8d;
}

.news-tags {
    color: #8e44ad;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.news-actions {
    display: flex;
    gap: 5px;
}

.drag-handle {
    cursor: move;
    padding: 0 10px;
    color: #7f8c8d;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.2s;
}

.drag-handle:hover {
    color: #3498db;
    transform: scale(1.2);
}

.draggable {
    cursor: move;
}

.draggable.dragging {
    opacity: 0.5;
    background: #e3f2fd;
}

.news-order {
    padding: 0 10px;
    font-weight: bold;
    color: #3498db;
    min-width: 30px;
    font-size: 16px;
}

.drag-hint {
    font-size: 12px;
    color: #95a5a6;
    margin-left: 10px;
    font-style: italic;
}

/* News image styles */
.news-image {
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 12px;
}

.news-img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.news-img:hover {
    transform: scale(1.05);
}

/* Modal image styles */
.modal-image {
    margin: 20px 0;
    text-align: center;
}

.modal-img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.selected-item {
    background: #e8f4f8;
}

.selected-item:hover {
    background: #d4ecf5;
}

.playlist-notes {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.playlist-notes label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.playlist-notes textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
}

.recent-playlists {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recent-playlists h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2c3e50;
}

#recent-playlists-list ul {
    list-style: none;
}

#recent-playlists-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

#recent-playlists-list li:hover {
    background: #f8f9fa;
}

.playlist-date {
    font-weight: 500;
    color: #2c3e50;
}

.playlist-count {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.playlist-creator {
    color: #7f8c8d;
    font-size: 14px;
}

/* Scrollbar styling */
.news-list::-webkit-scrollbar {
    width: 8px;
}

.news-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.news-list::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.news-list::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Loading state */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
}

/* News content preview */
.news-preview {
    margin: 8px 0;
    color: #555;
    font-size: 13px;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    cursor: pointer;
}

.news-preview:hover {
    color: #333;
}

.btn-view {
    background: #95a5a6;
    color: white;
}

.btn-view:hover {
    background: #7f8c8d;
}

/* Modal styles */
.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);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 50px auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

.modal-title {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 20px;
    line-height: 1.4;
}

.modal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.modal-category {
    background: #2c3e50;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-right: 10px;
}

.modal-time {
    color: #7f8c8d;
}

.modal-tags {
    color: #8e44ad;
}

.modal-body {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Confirmation Modal Styles */
.confirmation-modal-content {
    max-width: 400px;
    width: 90%;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
}

.confirmation-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.confirmation-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.confirmation-message {
    font-size: 15px;
    color: #7f8c8d;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.confirmation-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirmation-actions .btn {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

.confirmation-actions .btn-danger {
    background: #e74c3c;
    color: white;
}

.confirmation-actions .btn-danger:hover {
    background: #c0392b;
}

.confirmation-actions .btn-secondary {
    background: #95a5a6;
    color: white;
}

.confirmation-actions .btn-secondary:hover {
    background: #7f8c8d;
}

/* Auto-save indicator */
.auto-save-indicator {
    display: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-left: 10px;
    font-weight: 500;
    transition: all 0.3s;
}

.auto-save-indicator.saving {
    background: #f39c12;
    color: white;
    animation: pulse 1s infinite;
}

.auto-save-indicator.success {
    background: #27ae60;
    color: white;
}

.auto-save-indicator.error {
    background: #e74c3c;
    color: white;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Video elements */
.btn-video {
    background: #9b59b6;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-video:hover {
    background: #8e44ad;
    color: white;
}

.modal-video {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.modal-video h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 10px;
}

.video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
}

.video-link:hover {
    text-decoration: underline;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    animation: slideInRight 0.3s ease-out;
    transition: all 0.3s ease;
}

.toast.hiding {
    animation: slideOutRight 0.3s ease-out;
    opacity: 0;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.toast-close {
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

.toast.success {
    border-left: 4px solid #27ae60;
}

.toast.success .toast-icon {
    color: #27ae60;
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.error .toast-icon {
    color: #e74c3c;
}

.toast.info {
    border-left: 4px solid #3498db;
}

.toast.info .toast-icon {
    color: #3498db;
}

.toast.warning {
    border-left: 4px solid #f39c12;
}

.toast.warning .toast-icon {
    color: #f39c12;
}

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

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

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .search-controls {
        flex-wrap: wrap;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .button-group {
        justify-content: center;
    }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    header h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .date-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .date-selector label {
        font-size: 14px;
    }
    
    .date-selector input[type="date"] {
        flex: 1;
        max-width: 180px;
    }
    
    .button-group {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
        flex: 1;
        min-width: calc(50% - 5px);
    }
    
    .btn-small {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 36px;
    }
    
    .left-panel, .right-panel {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .panel-header h2 {
        font-size: 16px;
    }
    
    .search-controls {
        gap: 8px;
    }
    
    .search-controls input[type="text"] {
        width: 100%;
        font-size: 16px;
        padding: 10px;
    }
    
    .search-controls select {
        padding: 10px;
        font-size: 14px;
    }
    
    .search-controls .btn {
        min-width: auto;
        flex: 0 0 auto;
    }
    
    .category-filter-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .category-buttons {
        width: 100%;
    }
    
    .category-filter-btn {
        padding: 8px 14px;
        font-size: 14px;
    }
    
    .news-list {
        max-height: 400px;
    }
    
    .news-item {
        padding: 15px 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-content {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .news-title {
        font-size: 15px;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    .news-preview {
        font-size: 14px;
        margin: 10px 0;
    }
    
    .news-meta {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .news-category {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .news-time, .news-tags {
        font-size: 13px;
    }
    
    .news-actions {
        width: 100%;
        gap: 8px;
        justify-content: flex-start;
    }
    
    .news-actions .btn {
        flex: 1;
        min-width: auto;
        padding: 10px 12px;
    }
    
    .news-image {
        width: 100%;
        padding-left: 0;
        padding-top: 10px;
    }
    
    .news-img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
    
    .drag-handle {
        padding: 0 15px;
        font-size: 24px;
    }
    
    .news-order {
        font-size: 18px;
        padding: 0 12px;
    }
    
    .selected-item {
        padding: 15px 12px;
    }
    
    .selected-item .news-actions {
        margin-top: 10px;
    }
    
    .playlist-controls {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .playlist-controls .btn,
    .playlist-controls select {
        width: 100%;
    }
    
    .recent-playlists {
        padding: 15px;
    }
    
    .recent-playlists h3 {
        font-size: 15px;
    }
    
    #recent-playlists-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .modal-body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .confirmation-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .confirmation-icon {
        font-size: 36px;
    }
    
    .confirmation-title {
        font-size: 18px;
    }
    
    .confirmation-message {
        font-size: 14px;
    }
    
    .confirmation-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .confirmation-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    #toast-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
    
    .auto-save-indicator {
        position: absolute;
        top: 60px;
        right: 15px;
        font-size: 11px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    header h1 {
        font-size: 18px;
    }
    
    .btn {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .btn-small {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .news-item {
        padding: 12px 10px;
    }
    
    .news-title {
        font-size: 14px;
    }
    
    .news-preview {
        font-size: 13px;
    }
    
    .news-meta {
        font-size: 11px;
    }
    
    .modal-content {
        padding: 15px;
    }
}