﻿/* styles.css */
:root {
  --primary-blue: #007bff;
  --primary-blue-hover: #0056b3;
  --success-green: #28a745;
  --warning-red: #dc3545;
  --light-gray: #f5f5f5;
  --medium-gray: #e0e0e0;
  --dark-gray: #666;
  --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  --border-radius: 8px;
  --mobile-padding: 15px;
}

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--light-gray);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* 主布局 */
.main-container {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.sidebar {
  width: 280px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  height: calc(100vh - 180px);
  overflow-y: auto;
}

.content-area {
  flex: 1;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  min-height: calc(100vh - 180px);
}

.topic-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--border-radius);
}

/* 认证框 */
.auth-box {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 20px;
  text-align: center;
}

/* 表单样式 */
.log-form {
  background: white;
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 20px;
}

.log-form input,
.log-form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.3s ease;
  font-size: 16px;
}

.log-form textarea {
  resize: vertical;
  min-height: 150px;
}

.submit-btn {
  width: 100%;
  padding: 14px; /* 原12px → 增大2px保持比例 */
  background: var(--primary-blue);
  color: white;
  transition: background 0.3s ease;
  font-size: 18px; /* 新增字体大小 */
  font-weight: 500; /* 增加字重提升可读性 */
  line-height: 1.2; /* 优化文字垂直居中 */
}

/* 主题列表 */
.topic-item {
  padding: 15px 20px;
  border-bottom: 10px solid #eee;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topic-time {
  font-size: 14px;
  color: #999;
  margin-left: 15px;
  white-space: nowrap;
}

/* 日志条目 */

.topic-tag {
    background: #e0f0ff;
    padding: 4px 12px;
    border-radius: 15px;
    cursor: pointer;
    text-align: center;
}

.log-item {
  background: white;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.log-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.log-actions a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--medium-gray);
  color: #333 !important;
  text-decoration: none;
  border-radius: 4px;
  margin-right: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  border: 1px solid rgba(0,0,0,0.1);
}

/* 移动端优化 */
@media (max-width: 768px) {
  body {
    padding: 10px;
    font-size: 16px;
  }

  .container {
    padding: 0;
  }

  .main-container {
    flex-direction: column;
    gap: 15px;
  }

  .sidebar {
    width: 100%;
    height: auto;
    max-height: 40vh;
  }

  .content-area {
    min-height: 70vh;
    height: auto;
  }

  .topic-iframe {
    min-height: 500px;
  }

  .topic-item {
    padding: 12px 15px;
    flex-wrap: wrap;
  }

  .topic-time {
    width: 100%;
    margin: 5px 0 0 0;
    text-align: left;
    font-size: 12px;
  }

  .log-form input,
  .log-form textarea {
    padding: 12px;
    font-size: 16px;
  }

  .log-actions {
    display: block; /* 恢复为块级排列 */
    margin-top: 10px;
  }

  .log-actions a {
    display: inline-block;
    margin: 0 6px 6px 0; /* 恢复旧版间距 */
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
  :root {
    --mobile-padding: 10px;
  }

  body {
    padding: 5px;
  }

  .topic-item {
    padding: 10px;
  }

  .topic-time {
    font-size: 12px;
  }

  .log-actions a {
    padding: 5px 10px;
    font-size: 12px;
    margin-right: 4px;
  }

  .topic-iframe {
    min-height: 400px;
  }
}

/* 交互增强 */
.log-actions a {
  background: var(--medium-gray);
  color: #333;
}

.log-actions a[href*="edit"] {
 background: var(--medium-gray);
  color: #333 !important;
}

.log-actions a[href*="delete"] {
  background: var(--medium-gray);
  color: #333 !important;
}

.log-actions a:active {
  transform: translateY(0);
  opacity: 0.8;
}

/* 触摸优化 */
@media (hover: none) {
  .topic-item {
    cursor: default;
  }
  
  .topic-link {
    -webkit-tap-highlight-color: transparent;
  }
}