/* 禅释 · 此刻 - 拾绪模块样式 */

/* ========================================
   深色模式适配
   ======================================== */
[data-theme="dark"] .timeline-item {
    background: var(--zen-white);
    border-left-color: var(--zen-beige);
}

[data-theme="dark"] .timeline-item:hover {
    border-left-color: var(--zen-brown);
}

[data-theme="dark"] .timeline-date {
    color: var(--zen-gray);
}

[data-theme="dark"] .timeline-date-dot {
    background: var(--zen-beige);
}

[data-theme="dark"] .timeline-preview {
    color: var(--zen-dark);
}

[data-theme="dark"] .timeline-quote-tag {
    background: var(--zen-cream);
    color: var(--zen-brown);
}

[data-theme="dark"] .quote-selector {
    background: var(--zen-white);
}

[data-theme="dark"] .quote-label {
    color: var(--zen-dark);
}

[data-theme="dark"] .quote-scroll::-webkit-scrollbar-thumb {
    background: var(--zen-beige);
}

[data-theme="dark"] .quote-card {
    background: var(--zen-cream);
}

[data-theme="dark"] .quote-card.selected {
    background: rgba(139, 115, 85, 0.15);
}

[data-theme="dark"] .quote-text {
    color: var(--zen-dark);
}

[data-theme="dark"] .quote-source {
    color: var(--zen-gray);
}

[data-theme="dark"] .loading-quotes,
[data-theme="dark"] .empty-quotes {
    color: var(--zen-gray);
}

[data-theme="dark"] .editor-content {
    background: var(--zen-white);
}

[data-theme="dark"] #journal-text {
    color: var(--zen-dark);
}

[data-theme="dark"] #journal-text::placeholder {
    color: var(--zen-gray);
}

[data-theme="dark"] .selected-quote {
    background: var(--zen-white);
}

[data-theme="dark"] .selected-quote-content {
    color: var(--zen-brown);
}

[data-theme="dark"] .btn-remove-quote {
    color: var(--zen-gray);
}

[data-theme="dark"] .btn-remove-quote:hover {
    background: var(--zen-cream);
    color: var(--zen-dark);
}

[data-theme="dark"] .detail-date {
    color: var(--zen-gray);
    border-bottom-color: var(--zen-light-gray);
}

[data-theme="dark"] .detail-content {
    background: var(--zen-white);
    color: var(--zen-dark);
}

[data-theme="dark"] .detail-quote {
    background: var(--zen-white);
}

[data-theme="dark"] .detail-quote-text {
    color: var(--zen-brown);
}

[data-theme="dark"] .detail-quote-source {
    color: var(--zen-gray);
}

[data-theme="dark"] .empty-state {
    color: var(--zen-gray);
}

/* ========================================
   拾绪主界面
   ======================================== */

#journal-screen {
    background: var(--zen-cream);
}

.journal-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    padding-top: 52px;
    background: var(--zen-white);
    box-shadow: var(--shadow-sm);
    z-index: 10;
    flex-shrink: 0;
}

.journal-header h2 {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--zen-dark);
}

.btn-add-entry {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--zen-brown);
    color: var(--zen-white);
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.btn-add-entry:hover {
    background: var(--zen-gold);
    transform: scale(1.05);
}

.journal-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ========================================
   时间轴目录 - 支持左滑删除
   ======================================== */

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.timeline-item {
    background: var(--zen-white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    border-left: 3px solid var(--zen-beige);
    z-index: 2;
}

.timeline-item.sliding {
    transition: none;
}

.timeline-item:hover {
    border-left-color: var(--zen-brown);
}

.timeline-item.swiped {
    transform: translateX(-80px);
}

.timeline-delete-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: var(--error);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    z-index: 1;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.timeline-delete-btn:active {
    filter: brightness(0.85);
}

.timeline-date {
    font-size: 13px;
    color: var(--zen-gray);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-date-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--zen-beige);
}

.timeline-preview {
    font-size: 15px;
    color: var(--zen-dark);
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.timeline-quote-tag {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: var(--zen-cream);
    border-radius: var(--radius-xl);
    font-size: 12px;
    color: var(--zen-brown);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   拾绪编辑器
   ======================================== */

#journal-editor-screen {
    background: var(--zen-cream);
}

.journal-editor-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-save {
    padding: 8px 16px;
    background: var(--zen-brown);
    color: var(--zen-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-save:hover {
    background: var(--zen-gold);
}

/* ========================================
   语录选择器 - 左右滑动
   ======================================== */

.quote-selector {
    background: var(--zen-white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.quote-selector-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.quote-icon {
    font-size: 18px;
}

.quote-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--zen-dark);
}

.quote-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.quote-scroll::-webkit-scrollbar {
    height: 4px;
}

.quote-scroll::-webkit-scrollbar-thumb {
    background: var(--zen-beige);
    border-radius: 2px;
}

.quote-card {
    flex-shrink: 0;
    width: 200px;
    padding: 12px 16px;
    background: var(--zen-cream);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
}

.quote-card:hover {
    border-color: var(--zen-beige);
    transform: translateY(-2px);
}

.quote-card.selected {
    border-color: var(--zen-brown);
    background: rgba(139, 115, 85, 0.05);
}

.quote-text {
    font-size: 13px;
    color: var(--zen-dark);
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 6px;
}

.quote-source {
    font-size: 11px;
    color: var(--zen-gray);
    text-align: right;
}

.quote-date {
    font-size: 10px;
    color: var(--zen-gray);
    opacity: 0.7;
    text-align: right;
    display: block;
    margin-top: 2px;
}

.loading-quotes {
    padding: 20px;
    text-align: center;
    color: var(--zen-gray);
    font-size: 14px;
}

.empty-quotes {
    padding: 20px;
    text-align: center;
    color: var(--zen-gray);
    font-size: 14px;
}

/* 废弃滚筒样式 */
.quote-picker-container,
.quote-picker-highlight,
.quote-picker-scroll,
.quote-picker-item,
.quote-picker-empty,
.quote-picker-loading {
    display: none;
}

/* 编辑器 */
.editor-content {
    flex: 1;
    background: var(--zen-white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

#journal-text {
    width: 100%;
    height: 100%;
    min-height: 200px;
    border: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.8;
    color: var(--zen-dark);
    resize: none;
    outline: none;
    font-family: var(--font-sans);
}

#journal-text::placeholder {
    color: var(--zen-gray);
    opacity: 0.6;
}

/* 选中的语录 */
.selected-quote {
    background: var(--zen-white);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid var(--zen-brown);
}

.selected-quote-content {
    flex: 1;
    font-size: 13px;
    color: var(--zen-brown);
    font-style: italic;
    line-height: 1.6;
}

.btn-remove-quote {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--zen-gray);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-remove-quote:hover {
    background: var(--zen-cream);
    color: var(--zen-dark);
}

/* ========================================
   拾绪详情
   ======================================== */

#journal-detail-screen {
    background: var(--zen-cream);
}

.journal-detail-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-delete {
    padding: 8px;
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-delete:hover {
    transform: scale(1.1);
}

.detail-date {
    font-size: 14px;
    color: var(--zen-gray);
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--zen-light-gray);
}

.detail-content {
    background: var(--zen-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--zen-dark);
    box-shadow: var(--shadow-sm);
    white-space: pre-wrap;
}

.detail-quote {
    background: var(--zen-white);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    border-left: 3px solid var(--zen-brown);
    box-shadow: var(--shadow-sm);
}

.detail-quote-text {
    font-size: 14px;
    color: var(--zen-brown);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 6px;
}

.detail-quote-source {
    font-size: 12px;
    color: var(--zen-gray);
    text-align: right;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--zen-gray);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 13px;
    opacity: 0.7;
}

/* 响应式 */
@media (max-width: 380px) {
    .quote-card {
        width: 180px;
        padding: 10px 14px;
    }
    
    .timeline-item {
        padding: 12px 16px;
    }
}