
:root {
  --primary-color: #2c3e50;
  --secondary-color: #ecf0f1;
  --accent-color: #3498db;
  --text-color: #333;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --border-radius: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --font-size-base: 16px;
}

[data-theme="dark"] {
  --primary-color: #a0aec0;
  --secondary-color: #2d3748;
  --accent-color: #63b3ed;
  --text-color: #e2e8f0;
  --bg-color: #1a202c;
  --card-bg: #2d3748;
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, Avenir Next, Hiragino Sans, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: var(--font-size-base);
  transition: background-color 0.3s, color 0.3s;
}

.app-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  min-height: 100vh;
}

/* ナビゲーション */
.navbar {
  display: flex;
  justify-content: space-around;
  background: var(--card-bg);
  padding: 15px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.nav-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  color: var(--text-color);
  outline: none;
}

.nav-btn:focus {
  box-shadow: 0 0 0 2px var(--accent-color);
}

/* スクリーン */
.screen {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

.screen.active {
  display: block;
}

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

/* ホーム画面 */
.app-title {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
}

.quote-card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: background-color 0.3s;
}

.quote-text {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 15px;
  line-height: 1.7;
}

.quote-source {
  color: #a0aec0;
  text-align: right;
  font-style: italic;
}

.quote-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.tag {
  background: #e0e7ff;
  color: #4f46e5;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-primary, .btn-secondary {
  padding: 14px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s, background-color 0.3s;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--text-color);
}

.btn-primary:hover, .btn-secondary:hover {
  transform: translateY(-2px);
}

/* 一覧画面 */
.search-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

#list-search, #tag-filter {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: var(--card-bg);
  color: var(--text-color);
}

.quote-list {
  list-style: none;
}

.quote-item {
  background: var(--card-bg);
  padding: 16px;
  border-radius: var(--border-radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.3s;
  outline: none;
}

.quote-item:focus {
  box-shadow: 0 0 0 2px var(--accent-color);
}

.quote-item:hover {
  transform: translateY(-2px);
}

.quote-item-text {
  font-weight: 500;
  margin-bottom: 8px;
}

.quote-item-source {
  color: #a0aec0;
  font-size: 0.9rem;
}

.quote-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* 詳細画面 */
.quote-detail-card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: background-color 0.3s;
}

.detail-quote {
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.8;
  margin-bottom: 20px;
  text-align: center;
}

.detail-source {
  color: #a0aec0;
  text-align: right;
  font-style: italic;
  margin-bottom: 20px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
  justify-content: center;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 設定画面 */
.setting-item {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 0.3s;
}

.setting-item label {
  font-weight: 500;
}

#font-size {
  width: 100%;
}

#font-size-value {
  text-align: center;
  font-weight: 500;
}

/* レスポンシブ */
@media (max-width: 500px) {
  .app-container {
    padding: 15px;
  }
  
  .quote-text {
    font-size: 1.1rem;
  }
  
  .detail-quote {
    font-size: 1.2rem;
  }
}

/* ダークモード用のタグスタイル */
[data-theme="dark"] .tag {
  background: #4a5568;
  color: #e2e8f0;
}