:root {
    --bg-color: #000;
    --text-color: #fff;
    --input-bg: rgba(23, 23, 23, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.3);
    --btn-bg: rgba(64, 64, 64, 0.8);
    --btn-hover: rgba(96, 96, 96, 0.8);
    --link-bg: rgba(255, 255, 255, 0.1);
    --link-hover: rgba(255, 255, 255, 0.2);
    --placeholder-color: rgba(255, 255, 255, 0.5);
    --scrollbar-bg: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb: rgba(255, 255, 255, 0.3);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.4);
    --card-bg: rgba(30, 30, 30, 0.8);
    --time-color: rgba(255, 255, 255, 0.6);
    --private-color: #f44336;
    --public-color: #4CAF50;
    --switch-bg: rgba(255, 255, 255, 0.2);
    --switch-active: #4CAF50;
    --toast-bg: rgba(0, 0, 0, 0.8);
    --toast-text: #fff;
}

:root[data-theme='light'] {
    --bg-color: #fff;
    --text-color: #333;
    --input-bg: rgba(245, 245, 245, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.3);
    --btn-bg: rgba(200, 200, 200, 0.8);
    --btn-hover: rgba(180, 180, 180, 0.8);
    --link-bg: rgba(0, 0, 0, 0.1);
    --link-hover: rgba(0, 0, 0, 0.2);
    --placeholder-color: rgba(0, 0, 0, 0.5);
    --scrollbar-bg: rgba(0, 0, 0, 0.1);
    --scrollbar-thumb: rgba(0, 0, 0, 0.3);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.4);
    --card-bg: rgba(245, 245, 245, 0.8);
    --time-color: rgba(0, 0, 0, 0.6);
    --private-color: #f44336;
    --public-color: #4CAF50;
    --switch-bg: rgba(0, 0, 0, 0.2);
    --switch-active: #4CAF50;
    --toast-bg: rgba(255, 255, 255, 0.9);
    --toast-text: #333;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: clamp(10px, 3vw, 20px);
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: min(800px, calc(100vw - 30px));
    padding: clamp(10px, 3vw, 15px);
    box-sizing: border-box;
    position: relative;
    margin-top: 60px;
}

.header-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.theme-toggle {
    position: static;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    padding: 6px;
}

.login-status {
    position: static;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: help;
    transition: background-color 0.3s;
    padding: 6px;
}

.login-status::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--private-color); /* 默认未登录状态为红色 */
    transition: background-color 0.3s;
}

/* 登录状态下的样式 */
.login-status[title="已登录"]::before {
    background-color: var(--public-color);
}

.login-status:hover {
    background-color: var(--link-bg);
}

.theme-toggle:hover {
    background-color: var(--link-bg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.search-container {
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    padding-right: 50px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.6;
    outline: none;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
    font-family: inherit;
    box-sizing: border-box;
}

/* 文本区域特有样式 */
textarea.search-input {
    min-height: 120px;
    max-height: none;
    padding: 15px;
    padding-right: 60px;
    resize: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
}

.search-input::-webkit-resizer {
    border-width: 8px;
    border-style: solid;
    border-color: transparent var(--border-color) var(--border-color) transparent;
    background: transparent;
    border-radius: 0 0 2px 0;
}

.search-input:hover::-webkit-resizer {
    border-color: transparent var(--border-hover) var(--border-hover) transparent;
}

.search-input::-webkit-scrollbar {
    width: 8px;
}

.search-input::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
    border-radius: 4px;
}

.search-input::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
    transition: background 0.3s;
}

.search-input::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.search-input::-webkit-scrollbar-corner {
    background: var(--input-bg);
}

.search-input:focus {
    border-color: var(--border-hover);
}

.search-input::placeholder {
    color: var(--placeholder-color);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--placeholder-color);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.submit-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: none;
    border: none;
    color: var(--placeholder-color);
    cursor: pointer;
    padding: clamp(8px, 1.5vw, 12px);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.submit-btn:hover {
    color: var(--text-color);
}

.submit-btn svg {
    width: 20px;
    height: 20px;
}

.search-btn:hover {
    color: var(--text-color);
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.article-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    position: relative;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.article-content {
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--time-color);
}

.article-time {
    text-align: right;
}

.article-privacy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.article-privacy-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
    background-color: var(--link-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 14px;
}

.page-link:hover, .page-link.active {
    background-color: var(--link-hover);
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.no-results {
    text-align: center;
    padding: 40px 0;
    font-size: 18px;
    color: var(--placeholder-color);
}

.back-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--link-bg);
    border-radius: 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 16px;
    margin-bottom: 20px;
}

.back-link:hover {
    background-color: var(--link-hover);
}

.back-link svg {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

/* 设置文本动画效果 */
.breathing-text {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    text-align: center;
    animation: breathing 20s ease-in-out infinite;
    z-index: 200;
    font-size: 18px;
    padding: 10px;
}

/* 定义从黑色到白色再到黑色的渐变动画 */
@keyframes breathing {
    0% {
        color: black;
    }
    50% {
        color: white;
    }
    100% {
        color: black;
    }
}

/* 隐私开关样式 */
.privacy-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
    gap: 8px;
    font-size: 14px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--switch-bg);
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-color);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--switch-active);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* 面包屑导航样式 */
.breadcrumbs {
    margin: 15px 0;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
}

.breadcrumbs a {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.breadcrumbs a:hover {
    text-decoration: underline;
    opacity: 1;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: var(--text-muted);
    opacity: 0.5;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .search-container {
        margin-bottom: 1rem;
    }

    .search-input {
        font-size: 14px;
        padding: 10px;
        padding-right: 40px;
    }

    .search-btn {
        padding: 6px;
    }

    .search-btn svg {
        width: 16px;
        height: 16px;
    }

    .article-card {
        padding: 15px;
    }

    .article-content {
        font-size: 14px;
    }

    .article-footer {
        font-size: 12px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .submit-btn {
        right: 8px;
        bottom: 8px;
        min-width: 36px;
        min-height: 36px;
    }

    .breadcrumbs {
        font-size: 12px;
    }
    
    .breadcrumb-separator {
        margin: 0 4px;
    }
}

/* 提示消息样式 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--toast-bg);
    color: var(--toast-text);
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}