/* 基于fragments.css的统一样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #ffffff;
    color: #2c3e50;
    line-height: 1.6;
}

.fragments-container {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.fragments-header {
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

.back-link {
    margin-bottom: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: #2c3e50;
    border-color: #2c3e50;
    transform: translateX(-3px);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 20px;
}

.header-left h1 {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.subtitle {
    font-size: 14px;
    color: #666;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.btn {
    padding: 10px 20px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #2c3e50;
}

.btn:hover {
    border-color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.1);
}

.btn-primary {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.btn-primary:hover {
    background: #1a252f;
    border-color: #1a252f;
}

.fragments-content {
    flex: 1;
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* 文章列表 */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-card {
    padding: 24px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }
.article-card:nth-child(7) { animation-delay: 0.35s; }
.article-card:nth-child(8) { animation-delay: 0.4s; }
.article-card:nth-child(n+9) { animation-delay: 0.4s; }

.article-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #dc3545;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.article-card:hover {
    border-color: #dc3545;
    box-shadow: 0 2px 12px rgba(220, 53, 69, 0.08);
}

.article-card:hover::before {
    transform: scaleY(1);
}

.article-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #1a1a1a;
    line-height: 1.4;
}

.article-excerpt {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 16px;
    padding-left: 16px;
    border-left: 3px solid #f0f0f0;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
    flex-wrap: wrap;
    gap: 12px;
}

.article-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deleted-time {
    color: #dc3545;
    font-size: 12px;
}

.article-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.article-tag {
    background: #f8f9fa;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
    border: 1px solid #e9ecef;
}

/* 加载和空状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
    animation: fadeIn 0.6s ease;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 400;
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    color: #999;
}

/* 弹窗样式 */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.modal.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0s linear;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    font-size: 26px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.modal-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-tag {
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 13px;
    color: #666;
}

.modal-close {
    position: absolute;
    top: 28px;
    right: 32px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 32px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.modal-body h1,
.modal-body h2,
.modal-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 500;
}

.modal-body h1 { font-size: 1.8em; }
.modal-body h2 { font-size: 1.5em; }
.modal-body h3 { font-size: 1.3em; }

.modal-body p {
    margin-bottom: 1em;
}

.modal-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.modal-body pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

.modal-body pre code {
    background: none;
    padding: 0;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #2c3e50;
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

/* 动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .fragments-container {
        padding: 20px 15px;
    }
    
    .header-left h1 {
        font-size: 32px;
    }
    
    .modal-content {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

.btn:hover {
    border-color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.1);
}

.btn-primary {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.btn-primary:hover {
    background: #1a252f;
    border-color: #1a252f;
}

/* 内容区域 */
.trash-content {
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #999;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.6s ease;
}

.empty-state p:first-child {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state p:last-child {
    font-size: 18px;
    color: #999;
}

.empty-hint {
    margin-top: 12px;
    font-size: 14px !important;
    color: #bbb !important;
}

/* 文章列表 */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-card {
    padding: 24px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(n+6) { animation-delay: 0.25s; }

.article-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #dc3545;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.article-card:hover {
    border-color: #dc3545;
    box-shadow: 0 2px 12px rgba(220, 53, 69, 0.12);
}

.article-card:hover::before {
    transform: scaleY(1);
}

.article-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #1a1a1a;
    line-height: 1.4;
}

.article-excerpt {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 16px;
    padding-left: 16px;
    border-left: 3px solid #f0f0f0;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
    flex-wrap: wrap;
    gap: 12px;
}

.article-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deleted-time {
    color: #dc3545;
    font-size: 12px;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.article-tag {
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

/* 弹窗 */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.modal.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0s linear;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    font-size: 26px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.4;
}

.modal-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-tag {
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 13px;
    color: #666;
}

.modal-close {
    position: absolute;
    top: 28px;
    right: 32px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 32px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.modal-body h1,
.modal-body h2,
.modal-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 500;
}

.modal-body h1 { font-size: 1.8em; }
.modal-body h2 { font-size: 1.5em; }
.modal-body h3 { font-size: 1.3em; }

.modal-body p {
    margin-bottom: 1em;
}

.modal-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.modal-body pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

.modal-body pre code {
    background: none;
    padding: 0;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #2c3e50;
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

/* 动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 36px;
    }
    
    .modal-content {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .back-btn {
        color: #999;
        border-color: #3c3c3c;
    }

    .back-btn:hover {
        color: #e0e0e0;
        border-color: #e0e0e0;
    }

    .header-left h1 {
        color: #ffffff;
    }

    .subtitle {
        color: #999;
    }

    .btn {
        background: #2c2c2c;
        color: #e0e0e0;
        border-color: #3c3c3c;
    }

    .btn:hover {
        background: #333333;
        border-color: #e0e0e0;
        box-shadow: 0 2px 12px rgba(224, 224, 224, 0.08);
    }

    .btn-danger {
        background: #dc3545;
        border-color: #dc3545;
    }

    .btn-danger:hover {
        background: #bb2d3b;
        border-color: #bb2d3b;
    }

    .stats-item {
        color: #999;
    }

    .stats-item strong {
        color: #e0e0e0;
    }

    /* 文章卡片和标签 */
    .article-card {
        background: #2c2c2c;
        border-color: #3c3c3c;
    }

    .article-card:hover {
        border-color: #e0e0e0;
        box-shadow: 0 2px 12px rgba(224, 224, 224, 0.08);
    }

    .article-card::before {
        background: #e0e0e0;
    }

    .article-title {
        color: #ffffff;
    }

    .article-excerpt {
        color: #b0b0b0;
        border-left-color: #3c3c3c;
    }

    .article-meta {
        color: #666;
    }

    .article-tag {
        background: #3c3c3c;
        border-color: #4c4c4c;
        color: #999;
    }

    .empty-state h3 {
        color: #ffffff;
    }

    .empty-state p {
        color: #666;
    }

    .fragment-card {
        background: #2c2c2c;
        border-color: #3c3c3c;
    }

    .fragment-card:hover {
        border-color: #e0e0e0;
        box-shadow: 0 4px 16px rgba(224, 224, 224, 0.1);
    }

    .fragment-content {
        color: #b0b0b0;
    }

    .fragment-content h1,
    .fragment-content h2,
    .fragment-content h3 {
        color: #ffffff;
    }

    .fragment-content code {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .fragment-content pre {
        background: #1a1a1a;
        border-color: #3c3c3c;
    }

    .fragment-content blockquote {
        border-left-color: #3c3c3c;
        color: #999;
    }

    .fragment-content a {
        color: #58a6ff;
    }

    .fragment-content a:hover {
        color: #79b8ff;
    }

    .fragment-meta {
        color: #666;
        border-top-color: #3c3c3c;
    }

    .deleted-date {
        color: #dc3545;
    }

    .fragment-actions button {
        color: #999;
    }

    .fragment-actions button:hover {
        color: #e0e0e0;
    }

    .empty-state {
        color: #666;
    }

    .modal-overlay {
        background: rgba(0, 0, 0, 0.7);
    }

    .modal-content {
        background: #2c2c2c;
        border-color: #3c3c3c;
    }

    .modal-close {
        color: #999;
    }

    .modal-close:hover {
        color: #e0e0e0;
    }

    .modal-header {
        border-bottom-color: #3c3c3c;
    }

    .modal-header h2 {
        color: #ffffff;
    }

    .fragment-preview {
        background: #1a1a1a;
        border-color: #3c3c3c;
    }

    .fragment-preview h1,
    .fragment-preview h2,
    .fragment-preview h3 {
        color: #ffffff;
    }

    .fragment-preview p,
    .fragment-preview li {
        color: #b0b0b0;
    }

    .fragment-preview code {
        background: #2c2c2c;
        color: #e0e0e0;
    }

    .fragment-preview pre {
        background: #2c2c2c;
        border-color: #444;
    }

    .fragment-preview blockquote {
        border-left-color: #3c3c3c;
        color: #999;
    }

    .modal-meta {
        background: #1a1a1a;
        border-top-color: #3c3c3c;
        color: #666;
    }

    .meta-tag {
        background: #2c2c2c;
        border-color: #3c3c3c;
        color: #999;
    }

    /* Modal Body 内容 */
    .modal-body {
        color: #b0b0b0;
    }

    .modal-body h1,
    .modal-body h2,
    .modal-body h3,
    .modal-body h4,
    .modal-body h5,
    .modal-body h6 {
        color: #ffffff;
    }

    .modal-body code {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .modal-body pre {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .modal-body pre code {
        background: none;
        color: inherit;
    }

    .modal-body blockquote {
        border-left-color: #3c3c3c;
        color: #999;
    }

    .modal-body a {
        color: #58a6ff;
    }

    .modal-body a:hover {
        color: #79b8ff;
    }

    .modal-body strong {
        color: #ffffff;
    }

    .modal-footer {
        background: #1a1a1a;
        border-top-color: #3c3c3c;
    }

    .toast {
        background: #2c2c2c;
        color: #e0e0e0;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }
}
