/* Japan SME Voice 共通スタイル — ライトテーマ */

:root {
  --color-bg: #f5f4f0;
  --color-surface: #ffffff;
  --color-surface-hover: #f0efe9;
  --color-border: #d8d4cc;
  --color-primary: #434b56;
  --color-primary-hover: #353c45;
  --color-text: #2c3038;
  --color-text-muted: #626f82;
  --color-text-light: #c8c2b6;
  --color-success: #3a7d5c;
  --color-warning: #9a7b2f;
  --color-danger: #a04040;
  --radius: 4px;
  --radius-sm: 3px;
  --transition: 0.15s ease;
}

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

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'BIZ UDPGothic', 'Meiryo', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.8;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* ヘッダー */
.site-header {
  text-align: center;
  margin: -2rem -1.5rem 2.5rem;
  padding: 2rem 1.5rem 1.5rem;
  background: #434b56;
  color: #e0e0d8;
}

.site-header img {
  filter: brightness(1.2);
}

.site-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}

.site-header p {
  color: #c8c2b6;
  font-size: 0.82rem;
}

/* ナビゲーション */
nav {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
}

nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition);
}

nav a:hover {
  color: var(--color-text);
}

nav a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* カード */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #434b56;
}

/* フォーム */
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 0.9rem;
  transition: border-color var(--transition);
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: #434b56;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23626f82' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2.2rem;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input[type="file"] {
  padding: 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: #434b56;
  color: #ffffff;
  border-color: #434b56;
}

.btn-primary:hover {
  background: #353c45;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

.btn-secondary:hover {
  background: var(--color-surface-hover);
  border-color: #b8b2a6;
}

/* アラート */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  border: 1px solid;
}

.alert-success {
  background: #f0f7f3;
  border-color: #b8d8c7;
  color: var(--color-success);
}

.alert-error {
  background: #faf0f0;
  border-color: #dbb8b8;
  color: var(--color-danger);
}

.alert-warning {
  background: #faf6ed;
  border-color: #ddd0a8;
  color: var(--color-warning);
}

.alert-info {
  background: #f0f2f5;
  border-color: #c8ccd4;
  color: var(--color-text-muted);
}

/* トークン表示 */
.token-display {
  background: var(--color-bg);
  border: 2px solid #434b56;
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  margin: 1rem 0;
}

.token-display code {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: #434b56;
  margin: 0.5rem 0;
  word-break: break-all;
  font-weight: 700;
  font-family: 'Consolas', 'Courier New', monospace;
}

.token-display small {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

/* ステータスバッジ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid;
}

.status-received {
  background: #f0f2f5;
  border-color: #c8ccd4;
  color: var(--color-text-muted);
}

.status-investigating {
  background: #faf6ed;
  border-color: #ddd0a8;
  color: var(--color-warning);
}

.status-resolved {
  background: #f0f7f3;
  border-color: #b8d8c7;
  color: var(--color-success);
}

.status-dismissed {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text-light);
}

/* メッセージスレッド */
.message {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}

.message-reporter {
  background: #f0f2f5;
  border-left: 3px solid #626f82;
}

.message-admin {
  background: #f0f7f3;
  border-left: 3px solid var(--color-success);
}

.message .meta {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

/* レポート一覧（管理者用） */
.report-list-item {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--transition);
}

.report-list-item:first-child {
  border-top: 1px solid var(--color-border);
}

.report-list-item:hover {
  background: var(--color-surface-hover);
}

.report-list-item .report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.report-list-item .report-subject {
  font-weight: 500;
  font-size: 0.9rem;
}

.report-list-item .report-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* セキュリティ注意事項 */
.security-notice {
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.security-notice ul {
  list-style: none;
  padding: 0;
}

.security-notice li {
  padding: 0.15rem 0;
  padding-left: 1rem;
  position: relative;
}

.security-notice li::before {
  content: '\2014';
  position: absolute;
  left: 0;
  color: var(--color-text-light);
}

/* フッター */
.site-footer {
  text-align: center;
  margin: 2rem -1.5rem -3rem;
  padding: 1.5rem 1.5rem 1.2rem;
  font-size: 0.78rem;
  background: #434b56;
  color: #c8c2b6;
}

.footer-notices {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: #a0a0a0;
}

.footer-links {
  margin-bottom: 1rem;
}

.footer-links a {
  color: #e0e0d8;
  text-decoration: none;
  font-size: 0.8rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links span {
  margin: 0 0.5rem;
  color: #626f82;
}

.footer-security-link {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.78rem;
}

.footer-security-link a {
  color: #e0e0d8;
  text-decoration: none;
  border-bottom: 1px solid #626f82;
  padding-bottom: 1px;
}

.footer-security-link a:hover {
  border-bottom-color: #e0e0d8;
}

/* ユーティリティ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.form-group {
  margin-bottom: 0.9rem;
}

input[type="checkbox"] {
  accent-color: #434b56;
  margin-right: 0.4rem;
  vertical-align: middle;
}

label:has(input[type="checkbox"]) {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c8c2b6;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a296;
}

/* アコーディオン */
details summary::-webkit-details-marker { display: none; }
details summary::marker { display: none; content: ''; }
details summary::after {
  content: '\25B6';
  font-size: 0.6rem;
  color: var(--color-text-light);
  margin-left: 0.5rem;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
details[open] summary::after {
  transform: rotate(90deg);
}

/* レスポンシブ */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  .site-header {
    margin: -1rem -1rem 2rem;
    padding: 1.5rem 1rem 1.2rem;
  }

  .site-footer {
    margin: 2rem -1rem -3rem;
    padding: 1.2rem 1rem 1rem;
  }

  nav {
    flex-wrap: wrap;
  }

  nav a {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }

  .card {
    padding: 1.2rem;
  }

  .site-header h1 {
    font-size: 1.2rem;
  }
}

/* ============================================================
   Markdown レンダリングスタイル
   ============================================================ */

.markdown-body h1 {
  font-size: 1.3rem;
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  color: #434b56;
}

.markdown-body h2 {
  font-size: 1.15rem;
  margin: 1.2rem 0 0.5rem;
  font-weight: 700;
  color: #434b56;
}

.markdown-body h3 {
  font-size: 1rem;
  margin: 1rem 0 0.4rem;
  font-weight: 600;
}

.markdown-body p {
  margin: 0.5rem 0;
  line-height: 1.9;
}

.markdown-body strong {
  font-weight: 700;
}

.markdown-body em {
  font-style: italic;
}

.markdown-body del {
  text-decoration: line-through;
  opacity: 0.6;
}

.markdown-body code {
  background: #edecea;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  font-size: 0.85em;
  font-family: 'Consolas', 'Courier New', monospace;
}

.markdown-body pre {
  background: #edecea;
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0.8rem 0;
  border: 1px solid var(--color-border);
}

.markdown-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.markdown-body blockquote {
  border-left: 3px solid #c8c2b6;
  padding-left: 1rem;
  margin: 0.6rem 0;
  color: var(--color-text-muted);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.markdown-body li {
  margin: 0.15rem 0;
  line-height: 1.8;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.2rem 0;
}

.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.8rem 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.7rem;
  text-align: left;
  font-size: 0.88rem;
}

.markdown-body th {
  background: var(--color-bg);
  font-weight: 600;
}

.markdown-body a {
  color: #434b56;
  text-decoration: underline;
}

.markdown-body a:hover {
  color: #2c3038;
}

.markdown-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
  border: 1px solid var(--color-border);
}

/* ============================================================
   Markdownエディタ（管理画面用）
   ============================================================ */

.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

.md-toolbar button {
  padding: 0.25rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: background var(--transition);
}

.md-toolbar button:hover {
  background: var(--color-surface-hover);
}

.md-editor-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.md-editor-pane {
  width: 100%;
}

.md-preview-pane {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-y: auto;
  max-height: 500px;
}

.md-preview-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin: 0.6rem 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
