/* ==================== 九十年代门户网站风格（Yahoo! / 新浪早期） ==================== /
/ 特征：白色背景、蓝色链接、实线边框、表格布局感、宋体、下划线、简单按钮 */

/* ==================== 全局基础 ==================== */

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

html {
scroll-behavior: smooth;
}

/* ==================== 复古门户主题变量 ==================== */
[data-theme="light"] {
--bg: #ffffff;
--card-bg: #ffffff;
--text: #000000;
--text-secondary: #333333;
--border: #999999;
--link: #0000ee;
--link-visited: #551a8b;

--shadow-outer: none;                /* 门户不用阴影，用边框 */
--shadow-outer-sm: none;
--shadow-hover: none;
--shadow-inner: inset 1px 1px 0 #ccc, inset -1px -1px 0 #eee;
--shadow-inner-sm: inset 1px 1px 0 #ccc, inset -1px -1px 0 #eee;

--input-bg: #ffffff;
--reply-bg: #f5f5f5;

--primary: #0000ee;
--primary-hover: #0000aa;
--primary-light: rgba(0, 0, 238, 0.08);

--font-family: 'Times New Roman', Times, serif;
--font-size: 16px;
}

[data-theme="dark"] {
/* 暗色模式就退化成简单的深色背景，无拟态，保持阅读感 */
--bg: #1a1a1a;
--card-bg: #2a2a2a;
--text: #cccccc;
--text-secondary: #aaaaaa;
--border: #555555;

--shadow-outer: none;
--shadow-outer-sm: none;
--shadow-hover: none;
--shadow-inner: inset 1px 1px 0 #000, inset -1px -1px 0 #333;
--shadow-inner-sm: inset 1px 1px 0 #000, inset -1px -1px 0 #333;

--input-bg: #2a2a2a;
--reply-bg: #2a2a2a;

--primary: #6666ff;
--primary-hover: #8888ff;
--primary-light: rgba(102, 102, 255, 0.1);

--font-family: 'Times New Roman', Times, serif;
--font-size: 16px;
}

/* ==================== 基础样式 ==================== /
body {
font-family: var(--font-family);
background: var(--bg);
color: var(--text);
padding: 20px;
font-size: var(--font-size);
line-height: 1.4;
-webkit-font-smoothing: auto;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFUlEQVQImWNgYGBgYPj//z8DJgYGBgBgNAyJ/N2XqQAAAABJRU5ErkJggg=='); / 细微网格背景 */
background-repeat: repeat;
}

.container {
max-width: 960px;
margin: 0 auto;
border: 1px solid var(--border);
background: var(--card-bg);
padding: 0; /* 让内部卡片紧贴 */
}

/* ==================== 卡片（改为带边框的平板块） ==================== */
.card {
margin-bottom: 0;
border: 1px solid var(--border);
border-top: none;
background: var(--card-bg);
border-radius: 0;
box-shadow: none;
transition: none;
}

.card:first-child {
border-top: 1px solid var(--border);
}

.card:hover {
box-shadow: none;
}

.card-header {
padding: 6px 10px;
background: #e0e0e0;
border-bottom: 1px solid var(--border);
font-weight: bold;
font-size: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
text-transform: uppercase;
letter-spacing: 1px;
}

.card-body {
padding: 10px;
}

/* ==================== 表单元素 ==================== */
input,
textarea {
width: 100%;
padding: 4px 6px;
border: 2px inset #d5d5d5;
border-radius: 0;
font-size: 0.9rem;
font-family: inherit;
background: var(--input-bg);
color: var(--text);
box-shadow: none;
transition: none;
outline: none;
}

input:focus,
textarea:focus {
border: 2px inset #000;
box-shadow: none;
}

/* ==================== 按钮（老式立体按钮） ==================== */
button,
.btn {
background: #e0e0e0;
color: #000;
border: 2px outset #d5d5d5;
padding: 3px 12px;
border-radius: 0;
font-size: 0.85rem;
font-family: inherit;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 4px;
box-shadow: none;
transition: none;
}

button:hover {
background: #d0d0d0;
border: 2px outset #ccc;
transform: none;
}

button:active {
border: 2px inset #999;
background: #ccc;
transform: none;
}

button:disabled {
opacity: 0.7;
border: 2px solid #ddd;
background: #f0f0f0;
cursor: not-allowed;
color: #888;
}

/* ==================== 固定按钮 ==================== */
.write-btn {
position: fixed;
bottom: 20px;
right: 20px;
background: #f0f0f0;
color: #000;
border: 2px outset #d5d5d5;
padding: 6px 18px;
border-radius: 0;
font-size: 1rem;
font-weight: bold;
cursor: pointer;
box-shadow: none;
z-index: 999;
display: flex;
gap: 6px;
}

.write-btn:hover {
background: #e0e0e0;
}

.back-to-top {
position: fixed;
bottom: 20px;
left: 20px;
background: #f0f0f0;
color: #000;
border: 2px outset #d5d5d5;
padding: 4px 12px;
border-radius: 0;
cursor: pointer;
z-index: 999;
display: none;
box-shadow: none;
}

.back-to-top:hover {
background: #e0e0e0;
}

.theme-toggle {
position: fixed;
top: 10px;
right: 10px;
background: #f0f0f0;
border: 2px outset #d5d5d5;
padding: 3px 10px;
border-radius: 0;
cursor: pointer;
z-index: 999;
font-size: 0.8rem;
box-shadow: none;
}

.theme-toggle:hover {
background: #e0e0e0;
}

/* ==================== 搜索、排序、分页 ==================== */
.search-bar {
display: flex;
gap: 8px;
margin-bottom: 10px;
padding: 8px;
background: #f0f0f0;
border: 1px solid var(--border);
}

.search-bar input {
flex: 1;
border: 2px inset #d5d5d5;
background: #fff;
}

.sort-bar {
display: flex;
justify-content: flex-end;
gap: 0;
margin-bottom: 0;
border-bottom: 1px solid var(--border);
}

.sort-bar a {
text-decoration: none;
padding: 4px 12px;
border-radius: 0;
background: #f0f0f0;
color: var(--text-secondary);
font-size: 0.8rem;
border-right: 1px solid var(--border);
border-bottom: 1px solid var(--border);
display: inline-block;
text-decoration: none;
}

.sort-bar a:hover {
background: #e0e0e0;
text-decoration: underline;
}

.sort-bar a.active {
background: #ccc;
color: #000;
font-weight: bold;
}

.pagination {
display: flex;
justify-content: center;
gap: 4px;
margin-top: 10px;
flex-wrap: wrap;
align-items: center;
padding: 8px;
background: #f0f0f0;
border: 1px solid var(--border);
}

.pagination a,
.pagination span {
padding: 2px 8px;
border-radius: 0;
background: #fff;
text-decoration: none;
color: var(--link);
font-size: 0.8rem;
border: 1px solid var(--border);
}

.pagination a:hover {
background: #e0e0ff;
text-decoration: underline;
}

.pagination .current {
background: #ccc;
color: #000;
font-weight: bold;
border: 1px solid #000;
}

.pagination-jump {
display: inline-flex;
align-items: center;
gap: 6px;
margin-left: 10px;
}

.pagination-jump input {
width: 50px;
padding: 2px;
text-align: center;
border: 2px inset #d5d5d5;
}

/* ==================== 留言条目 ==================== */
.message-item {
border-bottom: 1px solid var(--border);
padding: 10px 0;
margin: 0;
position: relative;
background: #fff;
}

.admin-message {
background: #f0f0f0;
margin: 0 -10px;
padding: 10px;
border-left: 4px solid #999;
}

.message-header {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 5px;
}

.user-info {
display: flex;
align-items: center;
gap: 6px;
flex-wrap: wrap;
}

/* ==================== 徽章、标签（简单色块） ==================== */
.nickname {
font-weight: bold;
color: var(--link);
}

.grade {
background: #e0e0e0;
padding: 0px 6px;
border: 1px solid #999;
font-size: 0.7rem;
color: #000;
}

.admin-title {
background: #c0c0c0;
color: #000;
padding: 0px 6px;
border: 1px solid #000;
font-size: 0.65rem;
}

.location-badge {
background: #f5f5f5;
border: 1px solid #ccc;
color: #555;
padding: 0px 6px;
font-size: 0.7rem;
margin-left: 5px;
display: inline-flex;
align-items: center;
gap: 4px;
}

.pinned-badge {
background: #ffffcc;
border: 1px solid #cc9900;
color: #000;
padding: 0px 6px;
font-size: 0.7rem;
margin-left: 8px;
}

/* ==================== 元信息 ==================== */
.meta {
color: var(--text-secondary);
font-size: 0.7rem;
display: flex;
gap: 8px;
flex-wrap: wrap;
}

/* ==================== 内容折叠 ==================== */
.content-wrapper {
position: relative;
}

.content-short {
max-height: 100px;
overflow: hidden;
position: relative;
}

.content-short::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 24px;
background: linear-gradient(transparent, #ffffff);
pointer-events: none;
}

.content-full {
max-height: none !important;
}

.read-more-btn {
background: none;
border: none;
color: var(--link);
cursor: pointer;
font-size: 0.8rem;
padding: 2px 0;
margin-top: 2px;
display: inline-block;
text-decoration: underline;
}

.read-more-btn:hover {
text-decoration: none;
}

/* ==================== 操作按钮（门户风格链接按钮） ==================== */
.actions {
display: flex;
gap: 12px;
margin-top: 8px;
flex-wrap: wrap;
align-items: center;
}

.like-btn,
.reply-link,
.edit-btn,
.delete-btn,
.report-btn,
.share-btn {
background: none;
border: none;
padding: 0;
font-size: 0.8rem;
cursor: pointer;
color: var(--link);
text-decoration: underline;
box-shadow: none;
}

.like-btn:hover,
.reply-link:hover,
.edit-btn:hover,
.delete-btn:hover,
.report-btn:hover,
.share-btn:hover {
color: var(--primary-hover);
background: none;
box-shadow: none;
transform: none;
}

/* ==================== 回复区域 ==================== */
.replies {
margin-top: 10px;
background: #f5f5f5;
border: 1px solid var(--border);
padding: 8px;
}

.replies-scroll {
max-height: 200px;
overflow-y: auto;
padding-right: 4px;
scroll-behavior: smooth;
}

.replies-scroll::-webkit-scrollbar {
width: 12px;
}
.replies-scroll::-webkit-scrollbar-track {
background: #e0e0e0;
}
.replies-scroll::-webkit-scrollbar-thumb {
background: #999;
border-radius: 0;
}

.reply-item {
padding: 6px 0;
border-bottom: 1px dotted #999;
}

.reply-item:hover {
background: #e8e8e8;
}

.reply-meta {
color: var(--text-secondary);
font-size: 0.65rem;
margin-left: 6px;
}

.reply-content {
font-size: 0.85rem;
margin-top: 2px;
padding-left: 6px;
}

.admin-badge {
background: #c0c0c0;
color: #000;
padding: 0px 4px;
border: 1px solid #666;
font-size: 0.6rem;
margin-left: 4px;
}

.reply-to-link {
color: var(--link);
font-size: 0.65rem;
cursor: pointer;
margin-left: 6px;
text-decoration: underline;
}

.reply-to-link:hover {
text-decoration: none;
}

/* ==================== 回复表单 ==================== */
.reply-info {
background: #f5f5f5;
border: 1px solid var(--border);
padding: 4px 10px;
margin-bottom: 8px;
color: var(--text-secondary);
}

.reply-form {
margin-top: 10px;
display: none;
}

/* ==================== 图片区域 ==================== */
.message-image {
margin-top: 8px;
}

.message-image img {
max-width: 80%;
max-height: 150px;
border: 1px solid var(--border);
cursor: pointer;
box-shadow: none;
}

.message-image img:hover {
border-color: #000;
transform: none;
}

/* ==================== 图片模态框 ==================== */
.image-modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.8);
z-index: 10000;
cursor: pointer;
justify-content: center;
align-items: center;
}

.image-modal.show {
display: flex;
}

.image-modal img {
max-width: 90%;
max-height: 90%;
border: 2px solid #fff;
object-fit: contain;
}

/* ==================== 底部 ==================== */
footer {
text-align: center;
font-size: 0.7rem;
color: #666;
margin-top: 20px;
border-top: 1px solid var(--border);
padding: 10px;
background: #f0f0f0;
}

/* ==================== 表单定位 ==================== */
#messageForm {
scroll-margin-top: 60px;
}

/* ==================== 等待提示 ==================== */
.wait-tip {
background: #ffffcc;
border: 1px solid #cc9900;
padding: 8px 12px;
margin-bottom: 10px;
font-size: 0.85rem;
color: #000;
}

/* ==================== 动画（几乎不用） ==================== */
@keyframes highlightPulse {
0% { border-color: transparent; }
50% { border-color: var(--link); }
100% { border-color: transparent; }
}

.highlight-flash {
animation: highlightPulse 1s ease 3;
border: 2px solid transparent;
}

/* ==================== 响应式（基本保留） ==================== */
@media (max-width: 640px) {
body {
padding: 5px;
}
.write-btn {
bottom: 10px;
right: 10px;
padding: 4px 12px;
}
.back-to-top {
bottom: 10px;
left: 10px;
}
}

/* ==================== 编辑/举报表单 ==================== */
.edit-form,
.report-form {
display: none;
margin-top: 8px;
}

.input-wrapper {
position: relative;
display: inline-block;
width: 100%;
}

.input-wrapper input {
width: 100%;
padding-right: 60px;
}

.fill-btn {
position: absolute;
right: 4px;
top: 50%;
transform: translateY(-50%);
padding: 2px 8px;
background: #e0e0e0;
border: 2px outset #d5d5d5;
cursor: pointer;
font-size: 12px;
border-radius: 0;
}

.fill-btn:hover {
background: #ccc;
}

/* ==================== 文本框背景装饰（简单下划线图案） ==================== */
textarea[name="content"] {
background-image: repeating-linear-gradient(transparent, transparent 23px, #ddd 24px);
background-attachment: local;
height: 180px;
line-height: 24px;
padding: 8px;
}

/* ==================== 链接 ==================== */
a {
color: var(--link);
text-decoration: underline;
}

a:hover {
color: var(--primary-hover);
text-decoration: none;
}

/* ==================== IP信息卡片 ==================== */
.user-ip-info {
background: #f5f5f5;
border: 1px solid var(--border);
font-size: 0.8rem;
color: #555;
margin-bottom: 10px;
padding: 4px 10px;
}

/* ==================== 楼层水印 ==================== */
.floor-watermark {
position: absolute;
top: 6px;
right: 8px;
font-size: 0.6rem;
font-weight: bold;
color: rgba(0,0,0,0.15);
pointer-events: none;
user-select: none;
z-index: 1;
}

[data-theme="dark"] .floor-watermark {
color: rgba(255,255,255,0.2);
}

/* ==================== 设备信息 ==================== */
.device-info {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 0.7rem;
color: #666;
}

/* ==================== 公祭日灰色（保留） ==================== */
html.gray-mode {
filter: grayscale(100%);
}

/* ==================== 管理员 Markdown 内容 ==================== */
.admin-markdown-content {
font-size: 0.95rem;
line-height: 1.5;
}

.admin-markdown-content h1,
.admin-markdown-content h2,
.admin-markdown-content h3 {
font-weight: bold;
color: #000;
}
.admin-markdown-content h1 { font-size: 1.5rem; border-bottom: 2px solid #999; }
.admin-markdown-content h2 { font-size: 1.3rem; }
.admin-markdown-content h3 { font-size: 1.1rem; }

.admin-markdown-content pre,
.admin-markdown-content code {
background: #f0f0f0;
border: 1px solid #ccc;
padding: 2px 6px;
font-family: 'Courier New', monospace;
border-radius: 0;
}
.admin-markdown-content pre {
padding: 8px;
overflow-x: auto;
}

.admin-markdown-content blockquote {
border-left: 3px solid #999;
padding-left: 10px;
color: #333;
background: #f9f9f9;
}

.admin-markdown-content table {
border: 1px solid #999;
border-collapse: collapse;
}
.admin-markdown-content th,
.admin-markdown-content td {
border: 1px solid #999;
padding: 4px 8px;
}

/* 管理员回复特殊样式 */
.reply-item-admin {
background: #f0f0f0 !important;
border-left: 4px solid #666 !important;
padding: 6px 10px;
margin-bottom: 8px;
}

.admin-reply-badge {
background: #c0c0c0;
color: #000;
font-size: 11px;
padding: 1px 8px;
border: 1px solid #666;
margin-left: 6px;
display: inline-block;
vertical-align: middle;
}

/* 全局滚动条老式风格 */
::-webkit-scrollbar {
width: 14px;
}
::-webkit-scrollbar-track {
background: #e0e0e0;
}
::-webkit-scrollbar-thumb {
background: #999;
border: 1px solid #666;
border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
background: #777;
}