:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-sub: #64748b;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  --badge-static-bg: #ecfdf5;
  --badge-static-text: #065f46;
  --badge-shared-bg: #eff6ff;
  --badge-shared-text: #1e40af;
  --badge-managed-bg: #f5f3ff;
  --badge-managed-text: #5b21b6;
  --badge-vps-bg: #fffbeb;
  --badge-vps-text: #92400e;
  --badge-danger-bg: #fef2f2;
  --badge-danger-text: #991b1b;
  --badge-warning-bg: #fefce8;
  --badge-warning-text: #854d0e;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo span {
  font-size: 0.75rem;
  background: #e2e8f0;
  color: #334155;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  list-style: none;
}

/* Hero / Notice Banner */
.dev-banner {
  background: #fffbeb;
  border-bottom: 1px solid #fef3c7;
  color: #92400e;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  text-align: center;
  font-weight: 500;
}

/* 公開版環境（data-env="production"）では開発バナーを完全非表示 */
[data-env="production"] .dev-banner,
.env-production .dev-banner {
  display: none !important;
}

/* 広告ステータス連動PR表記バナー（広告導入時に常時表示） */
.ad-pr-banner {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  text-align: center;
}

.ad-pr-banner[data-has-ads="true"],
[data-ads="true"] .ad-pr-banner {
  display: block !important;
}

/* 問い合わせ先プレースホルダー表示 */
.contact-placeholder {
  color: #b45309;
  font-size: 0.88rem;
  background: #fffbeb;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.hero {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: #0f172a;
}

.hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Card layout */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f1f5f9;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

/* Form Styles */
.form-section {
  margin-bottom: 1.5rem;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

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

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #334155;
}

.form-group .hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  width: 100%;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* Result box */
.result-box {
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.badge-static { background: var(--badge-static-bg); color: var(--badge-static-text); }
.badge-shared { background: var(--badge-shared-bg); color: var(--badge-shared-text); }
.badge-managed { background: var(--badge-managed-bg); color: var(--badge-managed-text); }
.badge-vps { background: var(--badge-vps-bg); color: var(--badge-vps-text); }
.badge-danger { background: var(--badge-danger-bg); color: var(--badge-danger-text); }
.badge-warning { background: var(--badge-warning-bg); color: var(--badge-warning-text); }

.reasons-list, .warnings-list {
  margin-left: 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.92rem;
}

.reasons-list li {
  margin-bottom: 0.35rem;
}

.warnings-box {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
  color: #991b1b;
}

/* TCO Results table */
.tco-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tco-metric {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
}

.tco-metric-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.tco-metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.tco-metric-diff {
  color: #b91c1c;
  font-weight: 700;
}

.tco-notice {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 0.75rem;
}

/* Tables (Responsibility Matrix) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  text-align: left;
}

th {
  background: #f1f5f9;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.role-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  text-align: center;
}

.role-provider { background: #dbeafe; color: #1e40af; }
.role-user { background: #fef3c7; color: #92400e; }
.role-check { background: #f1f5f9; color: #475569; }
.role-none { background: #f3f4f6; color: #9ca3af; }

/* Article Layout */
.article-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 0.5rem;
}

.article-content {
  font-size: 1rem;
  line-height: 1.85;
}

.article-content h2 {
  font-size: 1.35rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e2e8f0;
}

.article-content h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.4rem;
}

.info-box {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  padding: 1rem;
  margin: 1.25rem 0;
  border-radius: 0 6px 6px 0;
}

.alert-box {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
  padding: 1rem;
  margin: 1.25rem 0;
  border-radius: 0 6px 6px 0;
}

/* Footer */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
  list-style: none;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.45rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-links {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
  }
  
  .tco-breakdown {
    grid-template-columns: 1fr;
  }
  
  th, td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}
