/* ========================================
   管理后台样式
   ======================================== */

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

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

#app {
  width: 100%;
  min-height: 100vh;
}

/* ========================================
   认证页面（登录/注册）
   ======================================== */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
}

.auth-title {
  text-align: center;
  color: #667eea;
  margin-bottom: 30px;
  font-size: 1.8rem;
}

.auth-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 2px solid #eee;
}

.auth-tabs button {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #888;
  transition: all 0.3s;
}

.auth-tabs button.active {
  color: #667eea;
  border-bottom: 3px solid #667eea;
  margin-bottom: -2px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #eee;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  padding: 10px 20px;
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

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

.btn-logout {
  width: 100%;
  padding: 12px;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-logout:hover {
  background: #ff5252;
}

.auth-error {
  color: #ff6b6b;
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
}

/* ========================================
   管理后台布局
   ======================================== */
.admin-container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 250px;
  background: rgba(255, 255, 255, 0.95);
  padding: 30px 20px;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  margin-bottom: 40px;
  text-align: center;
}

.sidebar-header h2 {
  color: #667eea;
  margin-bottom: 10px;
}

.sidebar-header p {
  color: #888;
  font-size: 0.9rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-nav a {
  padding: 12px 15px;
  color: #555;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s;
}

.sidebar-nav a:hover {
  background: #f5f5f5;
}

.sidebar-nav a.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.sidebar-footer {
  position: absolute;
  bottom: 30px;
  left: 20px;
  right: 20px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.view {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.view h1 {
  color: #333;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: white;
}

.stat-icon {
  font-size: 3rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* 表白列表 */
.confession-list {
  margin-top: 30px;
}

.confession-item {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.confession-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.confession-info h3 {
  color: #333;
  margin-bottom: 10px;
}

.confession-info p {
  color: #666;
  margin-bottom: 5px;
}

.confession-meta {
  font-size: 0.85rem;
  color: #888;
}

.status-public {
  color: #4caf50;
  font-weight: bold;
}

.status-private {
  color: #ff9800;
  font-weight: bold;
}

.confession-actions {
  display: flex;
  gap: 10px;
}

.btn-view,
.btn-edit,
.btn-delete {
  padding: 8px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.btn-view {
  background: #667eea;
  color: white;
}

.btn-view:hover {
  background: #5568d3;
}

.btn-edit {
  background: #4caf50;
  color: white;
}

.btn-edit:hover {
  background: #43a047;
}

.btn-delete {
  background: #ff6b6b;
  color: white;
}

.btn-delete:hover {
  background: #ff5252;
}

.empty-message {
  text-align: center;
  color: #888;
  padding: 40px;
}

/* 表白表单 */
.confession-form {
  max-width: 800px;
}

.image-list,
.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 15px;
}

.image-item,
.milestone-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.btn-remove {
  padding: 8px 12px;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-remove:hover {
  background: #ff5252;
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.form-actions .btn-primary {
  width: auto;
  min-width: 150px;
}

.form-actions .btn-secondary {
  min-width: 100px;
}

/* 设置卡片 */
.settings-card {
  background: #f9f9f9;
  padding: 30px;
  border-radius: 10px;
}

.settings-card p {
  margin-bottom: 15px;
  color: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .admin-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: relative;
  }

  .sidebar-footer {
    position: static;
    margin-top: 20px;
  }

  .main-content {
    padding: 20px;
  }

  .view {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .confession-item {
    flex-direction: column;
    gap: 20px;
  }

  .confession-actions {
    width: 100%;
    justify-content: stretch;
  }

  .confession-actions button,
  .confession-actions a {
    flex: 1;
    text-align: center;
  }

  .image-item,
  .milestone-item {
    grid-template-columns: 1fr;
  }
}
