/* app/static/css/blog/blog-components.css */
/* === Reference Panel === */
/* 参考面板样式已移至 blog-detail.css */

@media (max-width: 1024px) {
    .reference-panel.active {
        position: fixed;
        right: 0;
        top: 64px;
        bottom: 0;
        width: 100%;
        max-width: 400px;
        z-index: 40;
        box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    }
}

.ref-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ref-mode-tabs {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.ref-mode-tab {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.ref-mode-tab.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.ref-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#paste-trap {
    padding: 1rem;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    font-size: 0.875rem;
    color: #94a3b8;
}

#paste-trap:empty::before {
    content: 'Click here and paste (Ctrl+V)...';
    color: #cbd5e1;
}

.ref-textarea {
    flex: 1;
    width: 100%;
    padding: 1rem;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    background: #f8fafc;
    color: #475569;
}

/* === Settings Drawer === */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(2px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.settings-drawer {
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    width: 320px;
    background: white;
    border-left: 1px solid #e2e8f0;
    box-shadow: -4px 0 12px rgba(0,0,0,0.1);
    z-index: 50;
    overflow-y: auto;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-drawer.active {
    transform: translateX(0);
}

/* === Tag Input === */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    transition: all 0.2s;
}

.tag-input-container:focus-within {
    border-color: #ff7e5f;
    box-shadow: 0 0 0 3px rgba(255, 126, 95, 0.15);
}

.tag-item {
    background: #fff7ed;
    color: #c2410c;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #ffedd5;
}

.tag-item .remove {
    cursor: pointer;
    opacity: 0.6;
}

.tag-item .remove:hover {
    opacity: 1;
}

.tag-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 60px;
    font-size: 0.875rem;
}

.suggestions-box {
    position: absolute;
    z-index: 150;
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
}

.suggestion-item:hover {
    background-color: #f8fafc;
    color: #ff7e5f;
}

/* === Toggle Switch === */
.toggle-checkbox:checked {
    right: 0;
    border-color: #ff7e5f;
}

.toggle-checkbox:checked+.toggle-label {
    background-color: #ff7e5f;
}

/* === Collapsible Component === */
.collapsible {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 1em 0;
    overflow: hidden;
    background: white;
    transition: all 0.2s ease;
}

.collapsible:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.collapsible summary {
    padding: 0.75em 1em;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    background: #f8fafc;
    transition: background 0.2s ease;
}

/* 移除默认的三角形图标 */
.collapsible summary::-webkit-details-marker {
    display: none;
}

.collapsible summary:hover {
    background-color: #f1f5f9;
}

/* 折叠内容区域 */
.collapsible-content {
    padding: 1em;
    border-top: 1px solid #f0f0f0;
    background: white;
}

/* 标题文本样式 */
.collapsible-title-text {
    flex: 1;
    color: #1e293b;
}

/* "点击展开"文本样式 */
.collapsible-toggle-text {
    color: #64748b;
    font-size: 0.875em;
    font-weight: 400;
    margin-left: 0.5em;
    white-space: nowrap;
}

/* 关键样式：未展开状态显示"点击展开" */
.collapsible:not([open]) .collapsible-toggle-text {
    display: inline;
}

/* 关键样式：展开状态隐藏"点击展开" */
.collapsible[open] .collapsible-toggle-text {
    display: none;
}

/* 添加展开/折叠图标 */
.collapsible summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.75em;
    transition: transform 0.2s ease;
    font-size: 0.75em;
    color: #94a3b8;
    flex-shrink: 0;
}

.collapsible[open] summary::before {
    transform: rotate(90deg);
}

/* 展开状态下的 summary 样式 */
.collapsible[open] summary {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .collapsible summary {
        padding: 0.625em 0.875em;
        font-size: 0.9375em;
    }

    .collapsible-content {
        padding: 0.875em;
    }

    .collapsible-toggle-text {
        font-size: 0.8125em;
    }
}

/* === Table Component === */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 1.5em 0;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* 表头样式 */
.table-wrapper th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    color: #1e293b;
    font-weight: 600;
    text-align: left;
    padding: 0.875rem 1rem;
    border-bottom: 2px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
}

.table-wrapper th:last-child {
    border-right: none;
}

/* 行表头（第一列）特殊样式 */
.table-wrapper tr > th:first-child {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    font-weight: 600;
    color: #475569;
}

/* 普通单元格样式 */
.table-wrapper td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    color: #334155;
}

.table-wrapper td:last-child {
    border-right: none;
}

/* 去除表格内段落的额外边距 */
.table-wrapper th p,
.table-wrapper td p {
    margin: 0;
    padding: 0;
}

/* 行悬停效果 */
.table-wrapper tbody tr:hover {
    background-color: #f8fafc;
}

/* 最后一行不显示底部边框 */
.table-wrapper tbody tr:last-child td {
    border-bottom: none;
}

/* 斑马纹效果（可选） */
.table-wrapper tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.table-wrapper tbody tr:nth-child(even):hover {
    background-color: #f1f5f9;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .table-wrapper {
        font-size: 0.875rem;
        margin: 1em 0;
    }

    .table-wrapper th,
    .table-wrapper td {
        padding: 0.625rem 0.75rem;
    }
}

/* 超窄屏幕 - 水平滚动提示 */
@media (max-width: 640px) {
    .table-wrapper {
        position: relative;
    }

    .table-wrapper::after {
        content: '→';
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        font-size: 1.5rem;
        pointer-events: none;
        opacity: 0.5;
        animation: slideHint 1.5s ease-in-out infinite;
    }

    @keyframes slideHint {
        0%, 100% {
            transform: translateY(-50%) translateX(0);
            opacity: 0.5;
        }
        50% {
            transform: translateY(-50%) translateX(5px);
            opacity: 0.8;
        }
    }
}


