/* public/style.css — 黑色调高级感日记系统 */

:root {
  --bg-page: #000000;
  --bg-card: #050505;
  --bg-card-hover: #080808;
  --bg-input: #050505;
  --bg-badge: #080808;
  --border-color: #1a1a1a;
  --border-light: #1a1a1a;
  --border-hover: #2a2a2a;
  --accent: #c084fc;
  --accent-hover: #a855f7;
  --text-primary: #e0e0e0;
  --text-secondary: #c0c0c0;
  --text-muted: #555;
  --text-badge: #b0b0b0;
  --danger: #e94560;
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.25s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* 容器 */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 头部 */
.header {
  margin-bottom: 28px;
}

/* 头部 D2 风格 — 居中流光渐变 */
@keyframes hShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes hFadeUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes hDotMove {
  0% { transform: translateX(-50px); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(240px); opacity: 0; }
}

.header-d2 {
  text-align: center;
  margin-bottom: 32px;
  padding: 20px 0 10px;
}
.header-title-d2 {
  font-size: 22px;
  font-weight: 700;
  color: #e0e0e0;
  letter-spacing: 4px;
  animation: hFadeUp 0.6s ease;
}
.header-line-wrap {
  position: relative;
  margin: 12px auto 0;
  max-width: 280px;
  height: 2px;
}
.header-line-shimmer {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #c084fc 50%, transparent 100%);
  background-size: 200% 100%;
  border-radius: 2px;
  animation: hShimmer 2.8s ease-in-out infinite;
}
.header-line-dot {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  background: #c084fc;
  border-radius: 50%;
  margin-top: -3px;
  box-shadow: 0 0 12px #c084fc, 0 0 24px rgba(192,132,252,0.3);
  animation: hDotMove 3s ease-in-out infinite;
}
.header-subtitle-d2 {
  font-size: 10px;
  color: #444;
  margin-top: 10px;
  letter-spacing: 4px;
  animation: hFadeUp 0.8s ease 0.2s both;
}
.header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.header-title svg {
  vertical-align: -3px;
  margin-right: 8px;
}
.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
}

/* 日记列表 */
.post-list {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 16px;
}

.post-stats {
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}

.post-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.post-item + .post-item {
  border-top: 1px solid var(--border-color);
}
.post-item:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.post-icon {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
}

.post-body {
  flex: 1;
  min-width: 0;
}

.post-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.post-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* 置顶 badge */
.pin-badge {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-badge);
  background: var(--bg-badge);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 1px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 按钮 */
.btn {
  padding: 8px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}
.btn:hover { opacity: 0.85; }
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

/* 表单 */
.form-group { margin-bottom: 12px; }
.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color var(--transition);
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.7;
}


/* 管理后台 */
.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.admin-info {
  display: flex;
  gap: 10px;
  align-items: center;
}
.admin-info span {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #050505;
  color: #888;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
}

/* 发布表单 */
.post-form {
  background: #030303;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.post-form-header {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
}
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-label {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 详情页 */
.detail-container {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px;
  border: 1px solid var(--border-light);
}
.back-link {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  cursor: pointer;
}
.back-link:hover { color: #888; }
.detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.detail-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.detail-divider {
  border: none;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}
.detail-content {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
}
.detail-content * { max-width: 100%; }
.detail-image {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 16px;
}

/* 登录页 */
.login-container {
  max-width: 360px;
  margin: 100px auto;
  text-align: center;
}
.login-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* 确认弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-box {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  max-width: 320px;
}
.modal-box p { margin-bottom: 16px; color: #c0c0c0; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* 消息提示 */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #030303;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-primary);
  z-index: 200;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast.error { border-color: var(--danger); color: var(--danger); }

/* 响应式 */
@media (max-width: 600px) {
  .container { padding: 20px 12px; }
  .detail-container { padding: 20px; }
  .detail-title { font-size: 22px; }
}
