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

html {
  font-size: 18px;
}

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  color: #333;
  background: #f8f9fa;
}

/* ===== ヘッダー ===== */
header {
  background: #1a3a5c;
  color: white;
  padding: 0 40px;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

header h1 a {
  color: white;
  text-decoration: none;
}

.page-subtitle {
  font-size: 0.65rem;
  font-weight: normal;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.02em;
}

/* ===== ボタン共通 ===== */
.btn-primary {
  background: #1a3a5c;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
}
.btn-primary:hover { background: #2a5a8c; }

.btn-secondary {
  background: #f0f2f5;
  color: #444;
  border: 1px solid #ccc;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
}
.btn-secondary:hover { background: #e4e7eb; }

.btn-danger {
  background: #c0392b;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
}
.btn-danger:hover { background: #a93226; }

/* ===== ログインボタン ===== */
.btn-login {
  background: #f0a500;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-login:hover { background: #d4920a; }

/* ===== カード全般 ===== */
.card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ===== フォーム要素 ===== */
input[type="file"],
input[type="number"],
input[type="text"],
select {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="file"]:focus,
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 3px rgba(26,58,92,0.12);
}

/* ===== テーブル全般 ===== */
table th {
  background: #1a3a5c;
  color: white;
}
table tbody tr:hover td {
  background: #f0f5ff;
}

/* ===== サマリーカード数値 ===== */
.card-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: #1a3a5c;
}

/* ===== gain / loss 色 ===== */
.gain { color: #1a6e2e; }
.loss { color: #c0392b; }

/* ===== ローディング ===== */
.loading-text::after {
  content: '';
  display: inline-block;
  animation: loading-dots 1.2s steps(4, end) infinite;
}
@keyframes loading-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ===== ヒーローセクション ===== */
.hero {
  background: linear-gradient(135deg, #1a3a5c 0%, #2e6da4 100%);
  color: white;
  text-align: center;
  padding: 80px 40px;
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 40px;
  opacity: 0.9;
}

.btn-start {
  background: #f0a500;
  color: white;
  padding: 16px 48px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
}

.btn-start:hover {
  background: #d4920a;
}

/* ===== 特徴セクション ===== */
.features {
  max-width: 1000px;
  margin: 60px auto;
  padding: 0 40px;
}

.features h3 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 40px;
  color: #1a3a5c;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: white;
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}

.feature-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.feature-card .icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.feature-card h4 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: #1a3a5c;
}

.feature-card p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

/* ===== ガイドセクション ===== */
.guide-section {
  background: white;
  padding: 60px 40px;
}

.guide-section h3 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 40px;
  color: #1a3a5c;
}

.guide-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.guide-card {
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 24px;
  text-decoration: none;
  color: #333;
  display: block;
  transition: box-shadow 0.2s;
}

.guide-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.guide-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: #1a3a5c;
}

.guide-card p {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
}

/* ===== CTA ===== */
.cta {
  text-align: center;
  padding: 60px 40px;
  background: #f0f4f8;
}

.cta h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: #1a3a5c;
}

.cta p {
  color: #666;
  margin-bottom: 32px;
}

/* ===== フッター ===== */
footer {
  background: #1a3a5c;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
}

footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  margin: 0 12px;
}

footer a:hover {
  color: white;
}

/* ===== アプリ共通（ログイン後ページ共有） ===== */

/* ナビゲーション */
.app-nav { display: flex; gap: 4px; }
.app-nav-link {
  padding: 6px 18px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: bold;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
}
.app-nav-link:hover {
  color: #f0a500;
  background: transparent;
}
.app-nav-link.active {
  color: white;
  background: transparent;
  border-bottom-color: #f0a500;
}

/* ハンバーガーボタン（デスクトップは非表示） */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
}

/* ヘッダー右側（ユーザー名＋ログアウト） */
.header-user { display: flex; align-items: center; gap: 12px; min-width: 220px; justify-content: flex-end; }
.header-user span { color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.btn-logout {
  padding: 6px 16px;
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ===== ドロップゾーン ===== */
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: #1a3a5c;
  background: #f0f5ff;
}
.drop-zone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.drop-zone-text {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

/* ===== ステータスバッジ ===== */
.status-badge-success {
  display: inline-block;
  background: #e8f5e9;
  color: #1a6e2e;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
}

/* ===== テーブル偶数行 ===== */
.stripe-even tbody tr:nth-child(even) td {
  background: #fafbfd;
}

/* ===== レスポンシブ ===== */

/* --- 900px以下：ハンバーガーメニュー --- */
@media (max-width: 900px) {
  header { padding: 0 16px; }

  /* ハンバーガーメニュー */
  .hamburger-btn { display: block; }
  .app-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: #1a3a5c;
    padding: 6px 0;
    z-index: 200;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  }
  .app-nav.open { display: flex; }
  .app-nav-link {
    padding: 14px 24px;
    border-radius: 0;
    border-bottom: none;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .app-nav-link.active {
    background: rgba(255,255,255,0.1);
    border-bottom: none;
  }

  /* ヘッダー右側：ユーザー名は非表示 */
  .header-user { min-width: auto; }
  .header-user span { display: none; }
}

/* --- 768px以下：フォント・レイアウト --- */
@media (max-width: 768px) {
  html { font-size: 16px; }
  .hero h2 { font-size: 1.6rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 20px; }

  /* ボタンのタップターゲット確保 */
  .btn-logout {
    min-height: 44px;
    padding: 10px 16px;
  }
  .btn-login {
    min-height: 44px;
  }
}
