/* 定义CSS变量 */
:root {
    --background-color: #ffffff;
    --surface-color: #ffffff;
    --text-color: #333333;
    --primary-color: #007bff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 使用更简单可靠的响应式设计 */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.big-box {
    width: 100%;
    min-height: 100vh;
}

.status-bar {
    height: 44px;
    background-color: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid var(--text-color);
}

.back-button {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

#topBackground {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--surface-color);
    z-index: 99;
}

.back-button::before {
    content: '';
    display: block;
    width: 0.75rem;
    height: 0.75rem;
    border-top: 0.1875rem solid var(--text-color);
    border-left: 0.1875rem solid var(--text-color);
    transform: rotate(-45deg);
    margin-right: 0.125rem;
}

.back-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.status-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--primary-color);
    transform: translateY(0);
}

/* 文章内容样式 */
.content-box {
    box-sizing: border-box;
    padding: 1.25rem;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-color);
    line-height: 1.75;
    width: 100%;
    word-break: break-all;
    max-width: 1000px;
    margin: 0 auto;
}

.content-box h1,
.content-box h2,
.content-box h3 {
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
    line-height: 1.3;
}

.content-box h1 {
    font-size: 1.75rem;
}

.content-box h2 {
    font-size: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eeeeee;
}

.content-box h3 {
    font-size: 1.25rem;
}

.content-box p {
    margin: 1rem 0;
    text-indent: 2em;
}

.content-box ul,
.content-box ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.content-box li {
    margin: 0.5rem 0;
}

/* 添加链接样式 */
.content-box a {
    color: #007bff;
    text-decoration: none;
}

.content-box a:hover {
    text-decoration: underline;
}

/* 添加图片样式 */
.content-box img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

/* 添加表格样式 */
.content-box table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.content-box th,
.content-box td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #eeeeee;
}

.content-box th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 添加引用样式 */
.content-box blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid var(--primary-color);
    background-color: rgba(0, 0, 0, 0.05);
    font-style: italic;
}

/* RTL布局样式 */
[dir="rtl"] .back-button {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .back-button::before {
    transform: rotate(135deg);
    margin-right: 0;
    margin-left: 0.125rem;
}

/* RTL布局下的列表样式 */
[dir="rtl"] .content-box ul,
[dir="rtl"] .content-box ol {
    padding-left: 0;
    padding-right: 2rem;
}

/* RTL布局下的段落样式 */
[dir="rtl"] .content-box p {
    text-align: right;
}

/* RTL布局下的引用样式 */
[dir="rtl"] .content-box blockquote {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

/* RTL布局下的表格样式 */
[dir="rtl"] .content-box th,
[dir="rtl"] .content-box td {
    text-align: right;
}

/* 自定义弹框样式 - 公共组件 */
.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--surface-color);
    color: var(--text-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    text-align: center;
    min-width: 280px;
    max-width: 80%;
}

.custom-alert-content {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.custom-alert-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.custom-alert-button:hover {
    opacity: 0.9;
}

/* 遮罩层 */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 999;
}
