/* ============================================================
   ポータル（公開ページ）スタイル
   ※ :root の変数は管理画面の「設定 → デザイン」から上書きされます
   ============================================================ */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --grad-1: #4f46e5;
  --grad-2: #6d28d9;
  --grad-3: #0891b2;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(17, 24, 39, .06), 0 8px 24px rgba(17, 24, 39, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans",
               "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---- ヘッダー ---- */
.site-header {
  background: linear-gradient(135deg, var(--grad-1) 0%, var(--grad-2) 55%, var(--grad-3) 100%);
  color: #fff;
  padding: 38px 0 32px;
}
.site-title { margin: 0; font-size: 28px; letter-spacing: .02em; }
.site-sub { margin: 6px 0 0; opacity: .85; font-size: 13px; }

/* ---- お知らせ ---- */
.notice {
  margin-top: 20px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  font-size: 14px;
  align-items: flex-start;
}
.notice-label {
  flex: none;
  font-weight: 700;
  font-size: 12px;
  background: #fb923c;
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  margin-top: 2px;
}
.notice-body { margin: 0; }

/* ---- セクション ---- */
.section { margin-top: 40px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 20px;
  padding-left: 12px;
  border-left: 5px solid var(--primary);
  line-height: 1.3;
}
#search {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  width: 240px;
  max-width: 50vw;
  background: var(--card);
  outline: none;
}
#search:focus { border-color: var(--primary); }

/* ---- カード ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.cards-links { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  color: var(--text);
}
.app-card { display: flex; flex-direction: column; }
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(17,24,39,.08), 0 12px 32px rgba(17,24,39,.10); }

.card-top { display: flex; gap: 8px; align-items: center; min-height: 22px; }
.chip {
  display: inline-block;
  font-size: 11px;
  color: var(--primary-dark);
  background: #eef2ff;
  border-radius: 999px;
  padding: 1px 10px;
  font-weight: 600;
}
.badge-new {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
  padding: 1px 9px;
}

.app-name { margin: 10px 0 4px; font-size: 17px; word-break: break-word; }
.ver { font-size: 12px; color: var(--muted); font-weight: 400; }
.desc { margin: 4px 0 10px; font-size: 13px; color: var(--muted); white-space: pre-line; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--muted);
  margin: auto 0 14px;
  padding-top: 8px;
}

/* ---- ボタン ---- */
.btn {
  display: inline-block;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--grad-2));
  color: #fff;
  text-align: center;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .15s ease;
}
.btn-primary:hover { opacity: .88; }

/* ---- ショートカットカード ---- */
.link-card { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.favicon { flex: none; border-radius: 4px; }
.favicon-emoji { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: #fde3d1; font-size: 14px; }
.link-body { display: flex; flex-direction: column; min-width: 0; }
.link-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-note { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-arrow { margin-left: auto; color: #c7cbd4; font-size: 22px; line-height: 1; }

/* ---- 空状態 ---- */
.empty { color: var(--muted); font-size: 14px; background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }

/* ---- フッター ---- */
.site-footer { margin: 56px 0 0; padding: 20px 0 28px; color: var(--muted); font-size: 12px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 16px; }
.admin-link { color: #b6bcc7; text-decoration: none; }
.admin-link:hover { color: var(--muted); text-decoration: underline; }

/* ---- ログインユーザー帯 ---- */
.user-box {
  margin-top: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 18px; display: flex; align-items: center; gap: 14px; font-size: 13px;
  box-shadow: var(--shadow); flex-wrap: wrap;
}
.user-name { font-weight: 700; }
.user-links { margin-left: auto; display: flex; gap: 12px; }
.user-links a { color: var(--primary-dark); text-decoration: none; }
.user-links a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .site-header { padding: 28px 0 24px; }
  .site-title { font-size: 22px; }
  .section-head { flex-direction: column; align-items: stretch; }
  #search { width: 100%; max-width: none; }
}
