/* 홍보기 - 자동 글쓰기 도구 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

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

:root {
    --bg: #0f172a;
    --bg2: #1e293b;
    --bg3: #334155;
    --text: #e2e8f0;
    --text2: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --green: #22c55e;
    --green-hover: #16a34a;
    --red: #ef4444;
    --red-hover: #dc2626;
    --yellow: #eab308;
    --border: #475569;
    --radius: 12px;
}

[data-theme="light"] {
    --bg: #f1f5f9;
    --bg2: #ffffff;
    --bg3: #e2e8f0;
    --text: #1e293b;
    --text2: #64748b;
    --border: #cbd5e1;
}

[data-theme="light"] .neon-title {
    color: #1e293b !important;
    animation: none !important;
    text-shadow: none !important;
}

[data-theme="light"] .neon-box {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 12px rgba(59,130,246,0.15) !important;
    animation: none !important;
}

[data-theme="light"] .neon-box-label {
    color: #2563eb !important;
    text-shadow: none !important;
}

[data-theme="light"] .neon-input {
    background: #f8fafc !important;
    color: #1e293b !important;
    border-color: #3b82f6 !important;
    animation: none !important;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15) !important;
}

[data-theme="light"] .neon-input::placeholder {
    color: #94a3b8 !important;
}

[data-theme="light"] .counter-box {
    background: linear-gradient(160deg, #e8fdf2, #f0fdf4) !important;
    animation: none !important;
    box-shadow: 0 2px 16px rgba(34,197,94,0.15) !important;
}

[data-theme="light"] .counter-label {
    color: #16a34a !important;
    text-shadow: none !important;
}

[data-theme="light"] .neon-btn {
    animation: none !important;
}

/* 테마 토글 버튼 */
.theme-btn {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, color .2s;
    line-height: 1;
}
.theme-btn:hover { background: var(--border); color: var(--text); }

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* 헤더 */
.header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.header h1 span {
    color: var(--text2);
    font-weight: 400;
    font-size: 14px;
    margin-left: 8px;
}

.header-nav {
    display: flex;
    gap: 12px;
}

.header-nav a {
    color: var(--text2);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all .2s;
}

.header-nav a:hover, .header-nav a.active {
    color: var(--text);
    background: var(--bg3);
}

/* 컨테이너 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== 메인 페이지 (사용자) ===== */
.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* 네온 타이틀 */
@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow:
            0 0 6px #fff,
            0 0 14px #fff,
            0 0 30px #a855f7,
            0 0 60px #a855f7,
            0 0 90px #a855f7,
            0 0 120px #7c3aed;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow:
            0 0 6px #fff,
            0 0 20px #60a5fa,
            0 0 40px #60a5fa,
            0 0 80px #3b82f6,
            0 0 120px #3b82f6;
    }
    50% {
        text-shadow:
            0 0 6px #fff,
            0 0 30px #a78bfa,
            0 0 60px #a78bfa,
            0 0 100px #7c3aed,
            0 0 140px #7c3aed;
    }
}

.neon-title {
    font-size: 42px !important;
    font-weight: 800 !important;
    color: #e0e7ff;
    animation: neonPulse 2.5s ease-in-out infinite;
    letter-spacing: 1px;
    margin-bottom: 14px !important;
}

/* 네온 박스 */
@keyframes borderGlow {
    0%, 100% { box-shadow: 0 0 8px #60a5fa, 0 0 20px #60a5fa, 0 0 40px #3b82f6, inset 0 0 10px rgba(96,165,250,0.05); border-color: #60a5fa; }
    50%       { box-shadow: 0 0 12px #a78bfa, 0 0 30px #a78bfa, 0 0 60px #7c3aed, inset 0 0 14px rgba(167,139,250,0.08); border-color: #a78bfa; }
}

.neon-box {
    display: inline-block;
    background: rgba(15,23,42,0.85);
    border: 1.5px solid #60a5fa;
    border-radius: 16px;
    padding: 22px 32px;
    margin-bottom: 10px;
    animation: borderGlow 2.5s ease-in-out infinite;
}

.neon-box-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 12px;
    text-shadow: 0 0 8px #60a5fa;
}

/* 네온 인풋 */
@keyframes inputGlow {
    0%, 100% { box-shadow: 0 0 6px rgba(96,165,250,0.5), 0 0 14px rgba(96,165,250,0.2); border-color: rgba(96,165,250,0.6); }
    50%       { box-shadow: 0 0 10px rgba(167,139,250,0.6), 0 0 20px rgba(167,139,250,0.25); border-color: rgba(167,139,250,0.7); }
}

.neon-input {
    width: 100% !important;
    max-width: 280px !important;
    padding: 12px 18px !important;
    background: rgba(15,23,42,0.9) !important;
    border: 1.5px solid rgba(96,165,250,0.6) !important;
    border-radius: 10px !important;
    color: #e0e7ff !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-align: center !important;
    font-family: inherit !important;
    outline: none !important;
    animation: inputGlow 2.5s ease-in-out infinite;
    transition: box-shadow .2s;
    display: block;
    margin: 0 auto;
}

.neon-input::placeholder {
    color: #64748b !important;
}

.neon-input:focus {
    box-shadow: 0 0 0 2px rgba(96,165,250,0.3), 0 0 20px rgba(96,165,250,0.5), 0 0 40px rgba(96,165,250,0.25) !important;
    border-color: #60a5fa !important;
    animation: none;
}

/* 네온 버튼 */
@keyframes btnGlow {
    0%, 100% { box-shadow: 0 0 8px #3b82f6, 0 0 20px rgba(59,130,246,0.4); }
    50%       { box-shadow: 0 0 12px #6366f1, 0 0 30px rgba(99,102,241,0.5); }
}

.neon-btn {
    animation: btnGlow 2.5s ease-in-out infinite !important;
}

.hero p {
    color: var(--text2);
    font-size: 16px;
    margin-bottom: 40px;
}

/* 카운터 */
@keyframes counterGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(34,197,94,0.15), 0 0 60px rgba(34,197,94,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
        border-color: rgba(34,197,94,0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(34,197,94,0.25), 0 0 80px rgba(34,197,94,0.12), inset 0 1px 0 rgba(255,255,255,0.05);
        border-color: rgba(34,197,94,0.5);
    }
}

@keyframes numberPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.counter-box {
    background: linear-gradient(160deg, rgba(30,41,59,0.95), rgba(15,23,42,0.95));
    border-radius: 24px;
    padding: 40px 40px 32px;
    margin-bottom: 40px;
    border: 1.5px solid rgba(34,197,94,0.3);
    position: relative;
    overflow: hidden;
    animation: counterGlow 3s ease-in-out infinite;
}

.counter-box::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(34,197,94,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.counter-number {
    font-size: 80px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #4ade80, #22c55e, #86efac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(34,197,94,0.5));
    display: inline-block;
}

.counter-number.pop {
    animation: numberPop 0.3s ease-out;
}

.counter-label {
    color: #86efac;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
    text-shadow: 0 0 10px rgba(34,197,94,0.4);
}

/* Start/Stop 버튼 */
.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 60px;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all .3s;
    color: #fff;
    background: linear-gradient(135deg, var(--green), #059669);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4);
}

.btn-start.running {
    background: linear-gradient(135deg, var(--red), #b91c1c);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.btn-start.running:hover {
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.btn-start:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-start .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
}

/* 상태 표시 */
.status-bar {
    margin-top: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
}

.status-bar.active {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--green);
}

.status-bar.paused {
    display: block;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: var(--yellow);
}

/* 최근 작성 로그 */
.log-box {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 30px;
    border: 1px solid var(--border);
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

.log-box h3 {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 12px;
}

.log-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--bg3);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

.log-item:last-child { border-bottom: none; }
.log-item .title { color: var(--text); }
.log-item .time { color: var(--text2); font-size: 12px; }

/* ===== 관리자 페이지 ===== */
.admin-section {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.admin-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 랭킹 */
.ranking-box {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}

.ranking-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--yellow);
    text-align: center;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--bg);
    font-size: 14px;
}

.ranking-item.top1 { background: rgba(234, 179, 8, 0.12); border: 1px solid rgba(234, 179, 8, 0.3); }
.ranking-item.top2 { background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.2); }
.ranking-item.top3 { background: rgba(180, 83, 9, 0.1); border: 1px solid rgba(180, 83, 9, 0.2); }

.ranking-rank {
    width: 30px;
    font-weight: 700;
    flex-shrink: 0;
}

.ranking-item.top1 .ranking-rank { color: #eab308; }
.ranking-item.top2 .ranking-rank { color: #94a3b8; }
.ranking-item.top3 .ranking-rank { color: #b45309; }

.ranking-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.ranking-count {
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
}

.ranking-count span {
    font-size: 11px;
    font-weight: 400;
    color: var(--text2);
    margin-left: 2px;
}

/* 배너 */
.banner-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 30px;
}

.banner-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg2);
}

.banner-item a {
    position: absolute;
    inset: 0;
    display: block;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

@media (max-width: 480px) {
    .banner-area { gap: 10px; }
}

/* 폼 */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* 버튼 */
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}

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

.btn-success {
    background: var(--green);
    color: #fff;
}
.btn-success:hover { background: var(--green-hover); }

.btn-danger {
    background: var(--red);
    color: #fff;
}
.btn-danger:hover { background: var(--red-hover); }

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* 통계 카드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    font-size: 13px;
    color: var(--text2);
    margin-top: 4px;
}

/* 테이블 */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--bg3);
}

th {
    color: var(--text2);
    font-weight: 500;
    white-space: nowrap;
}

td { color: var(--text); }

tr:hover td { background: rgba(255,255,255,0.02); }

/* 템플릿 목록 */
.template-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-item .info {
    flex: 1;
    min-width: 0;
}

.template-item .info .t-title {
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-item .info .t-content {
    font-size: 12px;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-item .actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
    flex-shrink: 0;
}

.template-item .t-image {
    margin-top: 6px;
}

.template-item .t-image img {
    max-width: 80px;
    max-height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

/* 배너 카드 */
.banner-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.banner-card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 10px;
}

.banner-card-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
}

.banner-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-empty {
    color: var(--text2);
    font-size: 13px;
}

.banner-card-url {
    font-size: 11px;
    color: var(--primary);
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 16px;
}

.banner-card-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}

/* 이미지 프리뷰 */
.img-preview {
    margin-top: 8px;
}

.img-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

/* 게시글 이미지 */
.post-image {
    margin: 16px 0;
}

.post-image img {
    max-width: 100%;
    border-radius: 8px;
}

/* 자동 링크 */
.content a, .auto-link {
    color: #3b82f6 !important;
    text-decoration: underline;
    cursor: pointer;
}

.content a:hover, .auto-link:hover {
    color: #60a5fa !important;
}

/* 파일 입력 스타일 */
input[type="file"] {
    padding: 8px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text2);
    width: 100%;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--bg3);
    color: var(--text);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
}

/* ===== 게시판 ===== */
.board-list {
    background: var(--bg2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.board-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--bg3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
    color: inherit;
}

.board-item:hover { background: rgba(255,255,255,0.02); }
.board-item:last-child { border-bottom: none; }

.board-item .b-num {
    color: var(--text2);
    font-size: 13px;
    width: 50px;
    flex-shrink: 0;
}

.board-item .b-title {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-item .b-date {
    color: var(--text2);
    font-size: 12px;
    margin-left: 16px;
    flex-shrink: 0;
}

/* 글 상세 */
.post-detail {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border);
}

.post-detail h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.post-detail .meta {
    color: var(--text2);
    font-size: 13px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bg3);
}

.post-detail .content {
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text2);
    cursor: pointer;
    font-size: 13px;
}

.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination button:hover:not(.active) {
    border-color: var(--text2);
}

/* 알림 토스트 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 9999;
    animation: slideIn .3s ease;
    max-width: 360px;
}

.toast.success {
    background: var(--green);
    color: #fff;
}

.toast.error {
    background: var(--red);
    color: #fff;
}

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 로딩 스피너 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 빈 상태 */
.empty {
    text-align: center;
    padding: 40px;
    color: var(--text2);
    font-size: 14px;
}

/* 모달 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg2);
    border-radius: 16px;
    padding: 28px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--border);
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

/* 펄스 애니메이션 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== 태그 (post.html, tag.html) ===== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 20px;
    color: var(--primary);
    font-size: 13px;
    text-decoration: none;
    transition: background .2s;
}
.tag-badge:hover { background: rgba(59,130,246,0.22); }

/* 태그 클라우드 */
.tag-cloud-box {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.tag-cloud-box h3 { font-size: 15px; margin-bottom: 14px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
    padding: 5px 14px;
    background: var(--bg3);
    border-radius: 20px;
    color: var(--text2);
    text-decoration: none;
    transition: all .2s;
    border: 1px solid transparent;
}
.tag-item:hover, .tag-item.active {
    background: rgba(59,130,246,0.15);
    border-color: var(--primary);
    color: var(--primary);
}
.tag-item span { font-size: 11px; opacity: 0.7; margin-left: 3px; }

/* ===== 댓글 (post.html) ===== */
.comment-section {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 20px;
    border: 1px solid var(--border);
}
.comment-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}
.comment-item {
    padding: 14px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}
.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}
.comment-writer { font-weight: 600; color: var(--primary); }
.comment-date { color: var(--text2); }
.comment-content { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.comment-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--bg3);
}

/* ===== 관련글 (post.html) ===== */
.related-posts {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border);
}
.related-posts h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.related-list { display: flex; flex-direction: column; gap: 6px; }
.related-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: border-color .2s;
}
.related-item:hover { border-color: var(--primary); }
.related-title { font-size: 13px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-meta  { font-size: 12px; color: var(--text2); margin-left: 12px; flex-shrink: 0; }

/* ===== 좋아요 + 공유 버튼 ===== */
.post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.like-btn:hover { border-color: #f472b6; color: #f472b6; }
.like-btn.liked { background: rgba(244,114,182,0.1); border-color: #f472b6; color: #f472b6; }
.like-btn .heart { font-size: 16px; }
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text2);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    text-decoration: none;
}
.share-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 인기글 (index.html) ===== */
.hot-posts-box {
    background: var(--bg2);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}
.hot-posts-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: #f97316; }
.hot-list { display: flex; flex-direction: column; gap: 4px; }
.hot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--bg);
    border-radius: 8px;
    text-decoration: none;
    transition: background .2s;
    border: 1px solid transparent;
}
.hot-item:hover { border-color: #f97316; }
.hot-rank {
    font-size: 12px;
    font-weight: 700;
    width: 20px;
    flex-shrink: 0;
    color: var(--text2);
    text-align: center;
}
.hot-rank.r1 { color: #eab308; }
.hot-rank.r2 { color: #94a3b8; }
.hot-rank.r3 { color: #b45309; }
.hot-title { flex: 1; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-hits  { font-size: 11px; color: var(--text2); flex-shrink: 0; }

/* ===== 방문자 차트 (admin) ===== */
.visit-chart-wrap {
    overflow-x: auto;
    padding-bottom: 4px;
}
.visit-chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 140px;
    min-width: max-content;
}
.chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30px;
    gap: 2px;
}
.chart-uv-num {
    font-size: 9px;
    color: var(--text2);
    height: 14px;
    display: flex;
    align-items: flex-end;
}
.chart-bar {
    width: 100%;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    cursor: default;
    transition: background .15s;
}
.chart-bar:hover { background: #60a5fa; }
.chart-date {
    font-size: 9px;
    color: var(--text2);
    margin-top: 4px;
    white-space: nowrap;
}
.visit-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.visit-summary span {
    font-size: 13px;
    color: var(--text2);
}
.visit-summary strong { color: var(--primary); margin-left: 4px; }

/* 반응형 그리드 헬퍼 */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.grid-3col-form {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

/* 반응형 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
    }

    .hero h2 { font-size: 24px; }
    .neon-title { font-size: 26px !important; letter-spacing: 0.5px; }
    .neon-box { padding: 18px 20px; }
    .neon-input { max-width: 220px !important; }
    .counter-number { font-size: 48px; }
    .btn-start { padding: 14px 40px; font-size: 16px; }
    .container { padding: 16px; }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .template-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .template-item .actions {
        margin-left: 0;
        margin-top: 10px;
    }

    .board-item .b-num { display: none; }

    /* admin 그리드 */
    .grid-2col {
        grid-template-columns: 1fr;
    }
    .grid-3col-form {
        grid-template-columns: 1fr;
    }
    .grid-3col-form .btn {
        width: 100%;
    }

    /* 파츠 탭 버튼 */
    .parts-tab-wrap {
        flex-wrap: wrap;
    }

    /* 댓글 폼 */
    .comment-form-top {
        flex-direction: column;
    }
    .comment-form-top input {
        width: 100%;
    }
    .comment-form-bottom {
        flex-direction: column;
    }
    .comment-form-bottom button {
        width: 100%;
    }

    /* 게시판 검색 영역 */
    .gnb-head {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .board-search {
        width: 100%;
        display: flex;
        gap: 6px;
    }
    .board-search input {
        flex: 1;
        width: auto !important;
    }

    /* 포스트 액션 버튼 */
    .post-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .container { padding: 12px; }
    .neon-title { font-size: 22px !important; }
    .counter-box { padding: 28px 20px 22px; }
    .counter-number { font-size: 56px; }
    .hero { padding: 36px 14px; }
    .btn-start { padding: 13px 32px; font-size: 15px; }

    /* 관리자 섹션 패딩 */
    .admin-section { padding: 14px !important; }

    /* stats 1열 */
    .stats-grid { grid-template-columns: 1fr 1fr; }

    /* 테이블 래퍼 */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* 파츠 탭 */
    .parts-tab-wrap { gap: 4px; }
    .parts-tab-wrap .btn { font-size: 12px; padding: 5px 8px; }
}
