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

:root {
  --primary: #ff8c00;
  --primary-light: #fff4e6;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-sub: #666;
  --border: #e5e5e7;
  --highlight: #fef08a;
  --success: #34c759;
  --danger: #d93025;
}

html, body {
  font-family: -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;
}

.app-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.app-header h1 {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
}

.icon-btn, .back-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:active, .back-btn:active {
  background: rgba(255,255,255,0.35);
}

.search-bar {
  background: var(--surface);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 9;
}

#search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg);
}

#search-input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

#sort-select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 14px;
}

.status {
  padding: 16px;
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
}

.status.error {
  color: var(--danger);
  background: #fce8e6;
}

.result-count {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-sub);
}

.list {
  padding: 8px 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.post-card .post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.post-card .date {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

.post-card .time {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.post-card .char-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-sub);
}

.post-card .summary {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
}

.post-card .actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:active {
  background: #e67a00;
}

.btn-outline {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:active {
  background: var(--primary-light);
}

.btn.copied {
  background: var(--success) !important;
}

.highlight {
  background: var(--highlight);
  padding: 0 2px;
  border-radius: 2px;
}

.app-footer {
  padding: 16px;
  text-align: center;
  color: var(--text-sub);
}

.app-footer small {
  font-size: 11px;
}

/* 詳細画面 */
.detail {
  padding: 16px;
}

.detail .post-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.detail .post-section h2 {
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail .post-section h3 {
  font-size: 12px;
  color: var(--text-sub);
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail .post-section pre {
  font-family: -apple-system, "Hiragino Sans", sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.7;
  background: var(--bg);
  padding: 12px 14px;
  border-radius: 8px;
  margin: 6px 0;
}

.detail .copy-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

#post-title {
  font-size: 15px;
}
