/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background 0.3s, color 0.3s;
}

:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a202c;
  --gray: #718096;
  --border: #e2e8f0;
  --primary: #4263eb;
}

.dark {
  --bg: #121212;
  --card: #1e1e1e;
  --text: #e0e0e0;
  --gray: #9aa0b6;
  --border: #333;
  --primary: #5a79f7;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 720px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

h1 {
  font-size: 24px;
  font-weight: 500;
}

#themeToggle {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

/* 添加框 */
.add-box {
  background: var(--card);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-box textarea,
.add-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.add-box textarea {
  min-height: 80px;
  resize: vertical;
}

#addBtn {
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}

/* 语录展示 */
.quote-box {
  background: var(--card);
  padding: 40px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  margin-bottom: 24px;
  text-align: center;
}

.content {
  font-size: 22px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.author {
  font-size: 16px;
  color: var(--gray);
}

/* 按钮 */
.btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btns button {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

#randomBtn {
  background: var(--primary);
  color: #fff;
  border: none;
}

/* 全部列表 */
.all-quotes {
  margin-top: 30px;
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
}

.all-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

#closeAllBtn {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.all-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.quote-item {
  padding: 14px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.quote-text {
  margin-bottom: 6px;
  font-size: 15px;
}

.quote-author {
  font-size: 13px;
  color: var(--gray);
  text-align: right;
}

.del-btn {
  margin-top: 8px;
  padding: 6px 10px;
  background: #e53e3e;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
}

/* 手机适配 */
@media (max-width: 640px) {
  .content { font-size: 18px; }
  .quote-box { padding: 24px; }
}