/**
 * 双排今日更新组件 - 独立样式
 * 支持深色模式，使用 CSS 变量实现主题色
 */
.double-today-update {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    padding: 24px;
    background: var(--bg-card, #ffffff);
    border-radius: 16px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-primary, #e5e7eb);
    transition: all 0.3s;
}

.double-today-update:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* 进度条 */
.dtu-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--dtu-primary, #2563eb), #4080ff);
    border-radius: 0 2px 2px 0;
    width: 0%;
    transition: width 0.15s ease;
    z-index: 10;
}

/* 头部区域 */
.dtu-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #e5e7eb;
}

.dtu-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--dtu-primary, #2563eb);
    border-radius: 8px;
    color: #fff;
}

.dtu-title-icon svg {
    width: 20px;
    height: 20px;
}

/* 搜索框 */
.dtu-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 2px solid var(--dtu-primary, #2563eb);
    border-radius: 12px;
    padding: 8px 16px;
    transition: all 0.3s;
    min-width: 240px;
}

.dtu-search-box:focus-within {
    border-color: var(--dtu-primary, #2563eb);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--dtu-primary, #2563eb) 20%, transparent);
}

.dtu-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #111827;
    width: 100%;
    font-weight: 500;
}

.dtu-search-input::placeholder {
    color: #9ca3af;
}

.dtu-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.dtu-search-clear:hover {
    background: #d1d5db;
    color: #374151;
    transform: scale(1.05);
}

/* 深色模式适配 */
body.dark-mode .dtu-search-clear,
body.dark .dtu-search-clear,
[data-theme="dark"] .dtu-search-clear {
    background: #4b5563;
    color: #9ca3af;
}

body.dark-mode .dtu-search-clear:hover,
body.dark .dtu-search-clear:hover,
[data-theme="dark"] .dtu-search-clear:hover {
    background: #6b7280;
    color: #f3f4f6;
}

/* 页码信息 */
.dtu-page-info {
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
}

.dtu-info-label {
    color: #9ca3af;
}

.dtu-info-num {
    color: var(--dtu-primary, #2563eb);
    font-weight: 700;
    font-size: 14px;
    background: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1.2;
    border: 2px solid var(--dtu-primary, #2563eb);
}

/* 双列网格 */
.update-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.update-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* 特色条目（带图片） */
.featured-item {
    position: relative;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    min-height: 120px;
    margin-bottom: 12px;
    background: #fff;
    cursor: pointer;
}

.featured-item .dtu-img-wrap {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 12px;
    overflow: hidden;
}

.featured-item .dtu-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-item:hover .dtu-img-wrap img {
    transform: scale(1.05);
}

.dtu-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    border-radius: 0 0 12px 12px;
}

.dtu-title-overlay .dtu-title-link {
    font-size: 16px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.dtu-title-overlay span {
    font-size: 12px;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.8);
    display: inline-block;
    margin-top: 4px;
}

/* 普通条目 */
.update-item:not(.featured-item) {
    position: relative;
    padding: 12px 14px;
    margin: 2px 0;
    border-radius: 10px;
    transition: all 0.25s ease;
    cursor: pointer;
    min-height: 48px;
}

.update-item:not(.featured-item):hover {
    background: #f3f4f6;
}

/* 序号圆形边框样式（强制宽高一致） */
.update-item:not(.featured-item) .dtu-number {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid currentColor;
    opacity: 0.7;
    flex-shrink: 0;
    box-sizing: content-box;
}

/* 标题两行省略通用样式 */
.dtu-title-link {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: normal !important;
    line-height: 1.5;
    text-decoration: none;
}

/* 普通条目中的标题链接 */
.update-item:not(.featured-item) .dtu-title-link {
    font-size: 15px;
    color: var(--text-primary, #111827);
    flex: 1;
    min-width: 0;
}

/* 标记 */
.dtu-new-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 5;
    white-space: nowrap;
}

/* 加载遮罩 */
.dtu-loading-mask {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    z-index: 50;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.dtu-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--dtu-primary, #2563eb);
    border-radius: 50%;
    animation: dtu-spin 0.8s linear infinite;
}

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

/* 分页器 */
.dtu-pager-wrap {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.dtu-pager {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f9fafb;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.dtu-page-prev, .dtu-page-next {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.dtu-page-prev:hover:not(.dtu-disabled),
.dtu-page-next:hover:not(.dtu-disabled) {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    color: var(--dtu-primary, #2563eb);
}

.dtu-page-prev.dtu-disabled,
.dtu-page-next.dtu-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dtu-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #6b7280;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.dtu-page-num:hover:not(.dtu-active) {
    background: #fff;
    color: var(--dtu-primary, #2563eb);
}

.dtu-page-num.dtu-active {
    color: #fff;
    background: var(--dtu-primary, #2563eb);
    font-weight: 600;
}

.dtu-page-dots {
    color: #9ca3af;
    font-size: 12px;
    padding: 0 4px;
}

.dtu-page-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}

.dtu-jump-input {
    width: 44px;
    height: 32px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    outline: none;
}

.dtu-jump-input:focus {
    border-color: var(--dtu-primary, #2563eb);
}

.dtu-jump-btn {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: var(--dtu-primary, #2563eb);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* 深色模式 */
body.dark-mode .double-today-update,
body.dark .double-today-update,
[data-theme="dark"] .double-today-update {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .dtu-header-row,
body.dark .dtu-header-row,
[data-theme="dark"] .dtu-header-row {
    border-color: #374151;
}

body.dark-mode .dtu-search-box,
body.dark .dtu-search-box,
[data-theme="dark"] .dtu-search-box {
    background: #374151;
}

body.dark-mode .update-item:not(.featured-item):hover,
body.dark .update-item:not(.featured-item):hover,
[data-theme="dark"] .update-item:not(.featured-item):hover {
    background: #374151;
}

body.dark-mode .dtu-pager,
body.dark .dtu-pager,
[data-theme="dark"] .dtu-pager {
    background: #374151;
    border-color: #4b5563;
}

/* 响应式 */
@media (max-width: 768px) {
    .double-today-update .update-grid {
        grid-template-columns: 1fr;
    }
    .dtu-header-row {
        flex-wrap: wrap;
        gap: 12px;
    }
    .dtu-search-box {
        order: 3;
        width: 100%;
        min-width: auto;
    }
    .dtu-page-info {
        order: 2;
    }
}