/* history.css - 清爽杂志风 */

:root {
  --bg-color: #fcfcfc;
  --card-bg: #ffffff;
  --primary: #2d3436;   /* 深灰主色，更有质感 */
  --accent: #6c5ce7;    /* 稍微活泼的紫色作为点缀 */
  --text-main: #2d3436;
  --text-sub: #636e72;
  --border: #dfe6e9;
  --line: #e0e0e0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans SC", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  /* 高级点阵背景 */
  background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
  background-size: 20px 20px;
  line-height: 1.6;
}

/* === 顶部导航 === */
.glass-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

/* === 搜索框 === */
.search-box {
  position: relative;
}
.search-input {
  background: #f1f2f6;
  border: none;
  padding: 8px 15px 8px 35px;
  border-radius: 8px;
  font-size: 14px;
  width: 200px;
  transition: all 0.2s;
  color: var(--text-main);
}
.search-input:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--accent);
  outline: none;
  width: 240px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #b2bec3;
  font-size: 12px;
}

/* === 主内容区 === */
main {
  max-width: 800px;
  margin: 100px auto 100px; /* 上下留白 */
  padding: 0 20px;
}

/* === 时间轴布局 === */
.timeline-container {
  position: relative;
  padding-left: 30px;
}

/* 贯穿线 */
.timeline-line {
  position: absolute;
  left: 7px; /* 调整线的位置 */
  top: 10px;
  bottom: 0;
  width: 2px;
  background: var(--line);
  z-index: 0;
}

.log-item {
  position: relative;
  margin-bottom: 40px;
  animation: slideUp 0.5s ease forwards;
  opacity: 0;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 时间点 */
.log-dot {
  position: absolute;
  left: -30px;
  top: 0;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 4px solid var(--accent);
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 0 0 4px #fcfcfc; /*以此模拟间距*/
}

/* 卡片本体 */
.log-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.log-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  border-color: #b2bec3;
}

/* 内容排版 */
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.log-date {
  font-size: 12px;
  color: #a4b0be;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  display: block;
}

.log-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.log-author {
  display: flex;
  align-items: center;
  gap: 6px;
}
.log-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.log-author span {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
}

.log-details {
  font-size: 15px;
  color: var(--text-sub);
  white-space: pre-wrap;
  margin-bottom: 15px;
}

/* 标签 */
.log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.log-tag {
  background: #f1f2f6;
  color: var(--text-sub);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* 底部操作栏 */
.action-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid #f1f2f6;
  padding-top: 15px;
}

.btn-action {
  background: none;
  border: none;
  color: #b2bec3;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}
.btn-action:hover { color: var(--primary); }
.btn-action.liked { color: #ff6b6b; }
.btn-action.delete { color: #d63031; margin-left: auto; }

/* 评论区 */
.comments-section {
  margin-top: 15px;
  background: #fafafa;
  border-radius: 8px;
  padding: 15px;
  display: none;
}
.comments-section:not(.hidden) { display: block; }

.comment-item {
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}
.c-user { font-weight: 700; color: var(--primary); }
.c-text { color: var(--text-sub); }
.c-time { color: #dfe6e9; font-size: 12px; float: right; }

.comment-input-box {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.c-input {
  flex: 1;
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
}
.c-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 15px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* 悬浮按钮 */
.fab-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: white;
  border-radius: 16px; /* 方圆形更现代 */
  border: none;
  box-shadow: 0 10px 25px rgba(45, 52, 54, 0.3);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  z-index: 100;
}
.fab-btn:hover { transform: translateY(-3px); }

/* 弹窗 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay:not(.hidden) { display: flex; }

.modal-content {
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
  padding: 30px;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--primary);
}

.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: #b2bec3; margin-bottom: 5px; text-transform: uppercase; }
.form-input {
  width: 100%;
  padding: 12px;
  background: #f1f2f6;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
.form-input:focus { outline: none; background: white; box-shadow: 0 0 0 2px var(--border); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn-cancel { background: none; border: none; color: #636e72; padding: 10px 20px; cursor: pointer; }
.btn-submit { background: var(--primary); color: white; border: none; padding: 10px 25px; border-radius: 8px; font-weight: 600; cursor: pointer; }