:root {
  --primary: #8b5a2b; /* 沉穩木褐色 */
  --primary-hover: #a0522d;
  --bg-color: #fdf8f5; /* 極淺白木色背景 */
  --surface: #ffffff; /* 卡片白色 */
  --surface-hover: #fcf3e8; /* 懸停淺木色 */
  --text-main: #3e2723; /* 深咖啡文字 */
  --text-muted: #8d6e63; /* 次要文字 */
  --border: #e6d5c3; /* 木質邊框 */
  --success: #2e7d32;
  --danger: #d32f2f;
  
  --sidebar-left-width: 10%;
  --sidebar-right-width: 15%;
  --main-width: 75%;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 { color: var(--text-main); margin-bottom: 1rem; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* Layout - 3 Columns */
.app-layout {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Left Sidebar */
.sidebar-left {
  width: var(--sidebar-left-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-top {
  height: 10%;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nav-brand { 
  font-size: 1.1rem; 
  font-weight: bold; 
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.sidebar-nav {
  height: 60%;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
}

.nav-item {
  display: block;
  padding: 0.5rem 0.5rem;
  color: var(--text-main);
  font-weight: 500;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.nav-item:hover, .nav-item.active {
  background-color: var(--surface-hover);
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

.sidebar-history {
  height: 30%;
  overflow-y: auto;
  padding: 1rem;
  background-color: var(--bg-color);
}

.history-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.history-item {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-left-width);
  width: var(--main-width);
  padding: 2rem;
  min-height: 100vh;
}

/* Right Sidebar */
.sidebar-right {
  position: fixed;
  right: 0;
  top: 0;
  width: var(--sidebar-right-width);
  height: 100vh;
  background-color: var(--surface);
  border-left: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}

.version-info {
  font-size: 0.85rem;
}

.version-item {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}
.version-item:last-child { border-bottom: none; }
.version-date { color: var(--text-muted); font-size: 0.75rem; }

/* Forms & Buttons */
.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-small { padding: 0.25rem 0.75rem; font-size: 0.875rem; }

input, textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  margin-bottom: 1rem;
  font-family: inherit;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(139, 90, 43, 0.2);
}

.form-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  margin: 2rem auto;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}

/* Lists & Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 90, 43, 0.1);
}

.meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.tag {
  background: var(--surface-hover);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.flex { display: flex; gap: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Voting System */
.vote-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
}

.vote-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
}

.vote-btn:hover { color: var(--primary); }
.vote-count { font-size: 1.25rem; font-weight: bold; color: var(--text-main); }

.question-layout { display: flex; align-items: flex-start; }
.content-section { flex: 1; }

.accepted-badge {
  color: var(--success);
  border: 1px solid var(--success);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 1rem;
  background-color: rgba(46, 125, 50, 0.1);
}
