/* tomobo - Discord掲示板 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #5865F2;
  --primary-dark: #4752C4;
  --accent: #57F287;
  --danger: #ED4245;
  --warning: #FEE75C;
  --bg: #f6f8fa;
  --card: #ffffff;
  --border: #e1e4e8;
  --text: #24292f;
  --text-muted: #656d76;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.12);
}

body { font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header { background: var(--primary); color: #fff; padding: 0 1rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.site-logo { font-size: 1.5rem; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.site-logo span { color: var(--accent); }
.btn-post-header { background: #fff; color: var(--primary); border: none; padding: 8px 18px; border-radius: 20px; font-weight: 700; font-size: .9rem; cursor: pointer; transition: .2s; }
.btn-post-header:hover { background: var(--accent); color: #000; text-decoration: none; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.container-sm { max-width: 680px; margin: 0 auto; padding: 1rem; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary) 0%, #7289da 100%); color: #fff; padding: 2rem 1rem; text-align: center; }
.hero h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: .5rem; }
.hero p { opacity: .9; margin-bottom: 1.5rem; }
.btn-post-hero { display: inline-block; background: var(--accent); color: #000; padding: 12px 32px; border-radius: 24px; font-weight: 700; font-size: 1rem; box-shadow: 0 4px 12px rgba(0,0,0,.2); transition: .2s; }
.btn-post-hero:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.3); text-decoration: none; }

/* Search */
.search-box { background: var(--card); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.search-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; }
.search-input:focus { outline: none; border-color: var(--primary); }
.btn { display: inline-block; padding: 10px 20px; border-radius: var(--radius); font-size: .9rem; font-weight: 600; cursor: pointer; border: none; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; text-decoration: none; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #d0d7de; text-decoration: none; }
.btn-success { background: #2ea44f; color: #fff; }
.btn-success:hover { background: #238636; text-decoration: none; }
.btn-warning { background: var(--warning); color: #000; }

/* Categories */
.category-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.category-chip { display: inline-block; padding: 6px 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--border); color: var(--text); font-size: .85rem; font-weight: 500; transition: .15s; }
.category-chip:hover, .category-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* Post Cards */
.posts-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 769px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}
.post-card { background: var(--card); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); border: 1px solid var(--border); transition: box-shadow .15s; }
.post-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.post-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.post-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.post-title a { color: inherit; }
.post-title a:hover { color: var(--primary); text-decoration: none; }
.post-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.post-body { color: var(--text-muted); font-size: .9rem; margin-bottom: .5rem; }
.post-tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.tag-chip { display: inline-block; padding: 2px 8px; border-radius: 12px; background: #eef0f3; color: var(--text-muted); font-size: .78rem; }
.tag-chip:hover { background: var(--primary); color: #fff; text-decoration: none; }
.contact-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px; font-size: .78rem; font-weight: 600; }
.copy-badge { cursor: copy; user-select: none; }
.copy-badge:hover { opacity: .75; }
.contact-badge.discord { background: #e8eafb; color: #5865F2; }
.contact-badge.x { background: #e8f5fd; color: #1d9bf0; }
.contact-badge.instagram { background: #fce4ec; color: #c2185b; }
.contact-badge.kakao { background: #fff9c4; color: #795548; }
.cat-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 600; }
.expires-badge { color: var(--text-muted); font-size: .78rem; }

/* Post Detail */
.post-detail { background: var(--card); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 1rem; }
.post-body-full { white-space: pre-wrap; word-break: break-word; margin: 1rem 0; }
.contact-section { background: #f6f8fa; border-radius: var(--radius); padding: 1rem; margin: 1rem 0; border: 1px solid var(--border); }
.contact-section h3 { font-size: .9rem; color: var(--text-muted); margin-bottom: .5rem; }
.contact-item { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; font-size: .95rem; }
.notice-box { background: #fff8dc; border: 1px solid #f0d000; border-radius: var(--radius); padding: .75rem 1rem; font-size: .85rem; color: #7a6000; margin-bottom: 1rem; }

/* Form */
.form-card { background: var(--card); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.form-group { margin-bottom: 1.2rem; }
label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; background: #fff; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(88,101,242,.15); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { color: var(--danger); font-size: .82rem; margin-top: .3rem; }
.required { color: var(--danger); margin-left: 3px; }
.contact-options { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.contact-option { margin-bottom: .8rem; }
.contact-option:last-child { margin-bottom: 0; }
.contact-option label { font-weight: 400; display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.check-agree { display: flex; align-items: center; gap: .5rem; }
.check-agree input { width: 16px; height: 16px; cursor: pointer; }
.tags-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-check { display: inline-flex; align-items: center; gap: .3rem; }
.tag-check input { cursor: pointer; }
.tag-check label { font-weight: 400; font-size: .88rem; cursor: pointer; }

/* Alert */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.alert-danger { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }

/* Pagination */
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination .page-link { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: .88rem; }
.pagination .page-link:hover { background: var(--primary); color: #fff; text-decoration: none; }
.pagination .page-item.active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-item.disabled .page-link { color: var(--text-muted); cursor: not-allowed; }

/* Tags section */
.popular-tags { background: var(--card); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 1.5rem; }
.popular-tags h3 { font-size: .9rem; color: var(--text-muted); margin-bottom: .6rem; }

/* Section title */
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .8rem; color: var(--text); display: flex; align-items: center; gap: .5rem; }

/* Footer */
.site-footer { background: var(--text); color: #abb0b9; padding: 2rem 1rem; margin-top: 3rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.footer-links a { color: #abb0b9; font-size: .88rem; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: .8rem; opacity: .7; }

/* Warnings */
.rules-box { background: #fff0f0; border: 1px solid #ffcccc; border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem; font-size: .88rem; }

/* Admin */
.admin-header { background: #1e1e2e; color: #fff; padding: 0 1rem; }
.admin-header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 52px; }
.admin-logo { font-weight: 700; color: #fff; font-size: 1.1rem; }
.admin-nav { background: #2d2d44; padding: .5rem 1rem; border-bottom: 1px solid #444; }
.admin-nav-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-nav a { color: #ccc; font-size: .88rem; padding: 4px 10px; border-radius: 4px; }
.admin-nav a:hover, .admin-nav a.active { background: var(--primary); color: #fff; text-decoration: none; }
.admin-content { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: #f6f8fa; font-weight: 600; font-size: .82rem; color: var(--text-muted); }
.table tr:hover td { background: #f9fafb; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: .75rem; font-weight: 600; }
.badge-published { background: #d4edda; color: #155724; }
.badge-hidden { background: #fff3cd; color: #856404; }
.badge-expired { background: #e2e3e5; color: #495057; }
.badge-deleted { background: #f8d7da; color: #721c24; }
.badge-open { background: #f8d7da; color: #721c24; }
.badge-handled { background: #d4edda; color: #155724; }
.badge-ignored { background: #e2e3e5; color: #495057; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); border: 1px solid var(--border); text-align: center; }
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-card .stat-label { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; flex-wrap: wrap; gap: .5rem; }
.page-title { font-size: 1.3rem; font-weight: 700; }

/* Inline Ad */
.ad-inline { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:8px; text-align:center; min-height:60px; box-shadow:var(--shadow); }
@media (min-width: 769px) { .ad-inline { display: none; } }

/* PC Bottom Leaderboard Ad (728x90) */
#pc-ad-bottom {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
  background: var(--bg);
}
@media (min-width: 769px) {
  #pc-ad-bottom { display: flex; }
}

/* PC Right Sidebar Ad (160x600) */
#pc-ad-right {
  display: none;
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  z-index: 100;
}
@media (min-width: 1460px) {
  #pc-ad-right { display: block; }
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.3rem; }
  .post-card-header { flex-direction: column; }
  .header-inner { gap: .5rem; }
  .btn-post-header { padding: 6px 12px; font-size: .82rem; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}
