/* Article Page - Apple Design */
#article-page {
    flex-direction: row;
    overflow: hidden;
}

/* ===== List View: Sidebar + Main ===== */
.article-list-view {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}

.article-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 28px 20px;
    overflow-y: auto;
}

.article-search {
    margin-bottom: 28px;
    flex-shrink: 0;
}

.article-search input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.03);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.article-search input:focus {
    border-color: rgba(0, 0, 0, 0.25);
    background-color: #fff;
}

.article-search input::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

.article-groups-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.article-group-item {
    padding: 8px 12px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.article-group-item:hover {
    color: #000;
    background-color: rgba(0, 0, 0, 0.03);
}

.article-group-item.active {
    color: #000;
    background-color: rgba(0, 0, 0, 0.06);
    font-weight: 500;
}

.article-sidebar-divider {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.06);
    margin: 24px 8px;
}

.article-times-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.article-time-item {
    padding: 8px 12px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.article-time-item:hover {
    color: #000;
    background-color: rgba(0, 0, 0, 0.03);
}

.article-time-item.active {
    color: #000;
    background-color: rgba(0, 0, 0, 0.06);
    font-weight: 500;
}

.article-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.article-list {
    flex: 1;
    overflow-y: auto;
    padding: 28px 40px;
}

.article-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.article-card:first-child {
    padding-top: 0;
}

.article-card:last-child {
    border-bottom: none;
}

.article-card:hover {
    padding-left: 8px;
}

.article-card-info {
    flex: 1;
    min-width: 0;
}

.article-card-title {
    font-size: 16px;
    font-weight: 500;
    color: #000;
    margin-bottom: 5px;
    line-height: 1.4;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.4);
}

.article-card-meta .author {
    color: rgba(0, 0, 0, 0.55);
}

.article-card-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.article-card-tags span {
    font-size: 11px;
    padding: 2px 8px;
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    color: rgba(0, 0, 0, 0.5);
}

.article-card-date {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    margin-left: 20px;
}

.article-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: rgba(0, 0, 0, 0.3);
    font-size: 14px;
}

/* ===== Detail View: TOC Sidebar + Content ===== */
.article-detail-view {
    display: none;
    flex-direction: row;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.article-detail-view.active {
    display: flex;
}

.article-detail-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 28px 16px;
    overflow-y: auto;
}

.article-detail-sidebar::-webkit-scrollbar {
    width: 2px;
}

.article-detail-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.article-detail-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 1px;
}

.article-detail-sidebar .toc-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    margin-top: 20px;
}

.article-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: color 0.2s ease;
    background: none;
    border: none;
    font-family: inherit;
    padding: 4px 0;
}

.article-back-btn:hover {
    color: #000;
}

.article-back-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.toc-item {
    display: block;
    padding: 5px 12px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.5);
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-item:hover {
    color: #000;
    background-color: rgba(0, 0, 0, 0.03);
}

.toc-item.level-2 {
    padding-left: 24px;
}

.toc-item.level-3 {
    padding-left: 36px;
    font-size: 12px;
}

.article-detail-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.article-detail-body iframe {
    flex: 1;
    width: 100%;
    border: none;
}

@media (max-width: 768px) {
    .article-sidebar {
        display: none;
    }

    .article-list {
        padding: 20px;
    }

    .article-detail-sidebar {
        display: none;
    }
}
