:root {
    --primary: #3b82f6;
    --secondary: #1e293b;
    --bg-color: #ffffff;
    --max-width: 1200px;
    --font-main: 'Pretendard', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: var(--font-main); 
    background: var(--bg-color); 
    color: #1e293b; 
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations */
.content-area { animation: fadeIn 0.8s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Top Bar */
.top-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
    height: 40px;
    display: flex;
    align-items: center;
}
.top-bar-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-auth-links {
    display: flex;
    gap: 1.2rem;
    list-style: none;
}
.top-auth-links a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.top-auth-links a:hover {
    color: var(--primary);
}

/* Header */
header.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
}
.header-inner {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo a { text-decoration: none; color: inherit; display: flex; align-items: center; }

/* Navigation */
.main-nav { display: flex; gap: 2rem; list-style: none; }
.main-nav > li { position: relative; }
.main-nav > li > a { 
    text-decoration: none; 
    color: #111; 
    font-weight: 600; 
    font-size: 1.2rem; 
    padding: 1.5rem 1rem;
    display: block;
    transition: color 0.2s; 
}
.main-nav a:hover, .main-nav a.active { color: var(--primary); }

/* Dropdown */
.dropdown {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 90px;
    transform: translateX(-50%) translateY(10px);
    background: white;
    min-width: 200px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #ddd;
    z-index: 1000;
}
.main-nav > li:hover .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown li a {
    display: block;
    padding: 0.7rem 1.5rem;
    font-size: 1.1rem;
    color: #333;
    border-bottom:#e6e6e6 solid 1px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.dropdown li a:hover { background: #888; color: var(--bg-color); 
    -webkit-transition-duration: 0.5s;
    -moz-transition-duration: 0.5s;
    -ms-transition-duration: 0.5s;
    -o-transition-duration: 0.5s;
    transition-duration: 0.5s;}

/* Mobile Hamburger & Nav */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary);
    padding: 0.5rem;
}
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 2000;
    padding: 2rem;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}
.mobile-nav.active {
    display: block;
    transform: translateX(0);
}
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}
.mobile-nav-overlay.active {
    display: block;
}

/* Sub Layout */
.sub-header {
    padding: var(--sub-padding-y) 0;
    background: var(--sub-bg);
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}
.sub-header h1 {
    font-size: var(--sub-title-size);
    font-weight: var(--sub-title-weight);
    color: var(--sub-title);
    text-align: var(--sub-title-align);
    margin: 0;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-bar {
    background: white;
    border-bottom: 1px solid #ddd;
    height: 55px;
    position: sticky;
    top: 80px;
    z-index: 900;
}
.tab-bar .container { height: 100%; display: flex; align-items: left; padding: 0; }
.tab-item {
    display: flex;
    text-align: left;
    padding: 0.7rem 1.2rem;
    width:250px;
    border-right: 1px solid #ddd;
    cursor: pointer;
    position: relative;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    transition: all 0.2s;
}
.tab-item:hover { color: var(--primary); background: #f8fafc; }
.tab-item.home { width: 60px !important; padding: 0.8rem 1.2rem; justify-content: center; border-left: 1px solid #ddd;}
.tab-item .chevron {margin-left: auto;margin-top:4px;opacity: 0.4; transition: transform 0.2s; }
.tab-item:hover .chevron { transform: rotate(180deg); color: var(--primary); }

.tab-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: white;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
}
.tab-item:hover .tab-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.tab-dropdown a {
    display: block;
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1.1rem;
}
.tab-dropdown a:hover { background: #888; color: var(--bg-color); 
    -webkit-transition-duration: 0.5s;
    -moz-transition-duration: 0.5s;
    -ms-transition-duration: 0.5s;
    -o-transition-duration: 0.5s;
    transition-duration: 0.5s;
}

.layout-wrapper { display: flex; gap: 4rem; padding: 5rem 0; }
.sidebar { width: 260px; flex-shrink: 0; position: sticky; top: 150px; height: fit-content; }
.content-area { flex: 1; min-width: 0; min-height: 500px; }

.sidebar-menu { list-style: none; border-top: 2px solid var(--secondary); background: #fff; border-radius: 4px; }
.sidebar-menu li a { 
    display: block; 
    padding: 1.1rem 1.2rem; 
    border-bottom: 1px solid #f1f5f9; 
    text-decoration: none; 
    color: #64748b; 
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}
.sidebar-menu li a:hover { color: var(--primary); padding-left: 1.5rem; }
.sidebar-menu li a.active { color: var(--primary); background: #f8fafc; font-weight: 700; border-left: 4px solid var(--primary); }

/* Board Styles */
.board-title-center { text-align: center; margin-bottom: 3rem; }
.board-title-center h2 { font-size: 2.4rem; font-weight: 700; letter-spacing: -1px; color: var(--secondary); }
.tit-bar {width:45px;height: 3px;background: #839cff;margin-left:48%;margin-top:8px;}

.board-container { margin-bottom: 5rem; }

.board-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; border-top: 2px solid var(--secondary); }
.board-table th { background: #f8fafc; padding: 1rem; font-weight: 700; font-size: 1rem; color: #475569; border-bottom: 1px solid #e2e8f0; text-align: center; }
.board-table td { padding: 1rem; border-bottom: 1px solid #f1f5f9; font-size: 0.8rem; vertical-align: middle; }
.board-table tr:hover { background: #fcfdfe; }
.board-table a { text-decoration: none; color: #1e293b; font-size:1.2rem !important;transition: color 0.2s; }
.board-table a:hover { color: var(--primary); }
.txt-center { text-align: center; }

.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; }
.badge.notice { background: #fee2e2; color: #ef4444; }

.comment-count { font-size: 0.85rem; color: var(--primary); font-weight: 600; margin-left: 4px; }

.btn-board {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}
.btn-board svg {width:16px;height:16px;}
.btn-write, .btn-submit { background: var(--primary); color: white; }
.btn-write:hover, .btn-submit:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2); }
.btn-board:not(.btn-write):not(.btn-submit) { background: #f1f5f9; color: #475569; }
.btn-board:not(.btn-write):not(.btn-submit):hover { background: #e2e8f0; }

/* Gallery Skin */
.gallery-grid { margin-bottom: 3rem; }
.gallery-item { background: white; border-radius: 12px; overflow: hidden; border: 1px solid #ddd; transition: all 0.3s; }
.gallery-item:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: var(--primary); }
.gallery-item a { text-decoration: none; color: inherit; }
.thumb-box { width: 100%; overflow: hidden; background: #f8fafc; position: relative; }
.thumb-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.gallery-item:hover .thumb-box img { transform: scale(1.05); }
.gallery-item .info { padding: 1rem; }
.gallery-item h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Webzine Skin */
.webzine-list { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 3rem; }
.webzine-item { background: white; border-radius: 16px; overflow: hidden; border: 1px solid #f1f5f9; transition: all 0.3s; }
.webzine-item:hover { transform: translateX(10px); border-color: var(--primary); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.webzine-item a { display: flex; text-decoration: none; color: inherit; }
.webzine-item .thumb-box { width: 300px; flex-shrink: 0; }
.webzine-item .info { padding: 2rem; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.webzine-item h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.8rem; }
.webzine-item .desc { color: #64748b; font-size: 0.95rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 1rem; }
.webzine-item .meta { color: #94a3b8; font-size: 0.85rem; }

/* View Page */
.board-view { max-width: 100%; margin: 0 auto; }
.view-header { margin-bottom: 1.5rem; padding-bottom: 1.2rem;}
.view-header h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: -1px; line-height: 1.3; }
.view-meta { display: flex; justify-content: space-between; align-items: center; margin-top:12px; padding: 0.5rem 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; color: #999; font-size: 0.9rem; }
.view-meta span { display: inline-block; }

.view-body { color: #111; line-height: 1.8; margin-bottom: 4rem; min-height: 300px; }
.view-body p {padding-bottom:12px;}
.view-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.5rem 0; }

.view-body h2 {
    position: relative;
    font-size: 24px !important;
    margin: 20px 0px;
    font-weight: 700;
    letter-spacing: -1px;
    color: #4474cd;
}

.prev-next-nav { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin-bottom: 2rem; }
.nav-item { display: flex; align-items: center; padding: 1.2rem; text-decoration: none; color: #333; transition: all 0.2s; border-bottom: 1px solid #ddd; }
.nav-item:last-child { border-bottom: none; }
.nav-item:hover { background: #f8fafc; color: var(--primary); }
.nav-item .label { font-weight: 700; color: #94a3b8; width: 80px; font-size: 1rem; }

.view-footer { display: flex; justify-content: space-between; gap: 1rem; padding-top: 2rem; border-top: 1px solid #ddd; }

/* Interaction & Components */
.btn-like:hover div { transform: scale(1.1); background: #fff1f2; }
.sns-share button { transition: all 0.2s; }
.sns-share button:hover { transform: translateY(-3px); opacity: 0.9; }

.attachment-list a:hover { text-decoration: underline !important; }

.comment-item { padding-bottom: 1.5rem; border-bottom: 1px solid #f1f5f9; }
.comment-item:last-child { border-bottom: none; }

/* Write Page */
.board-write { max-width: 100%; margin: 0 auto; background: white; padding: 3rem; border-radius: 24px; border: 1px solid #ddd; box-shadow: 0 10px 30px rgba(0,0,0,0.03); }
.form-group { margin-bottom: 2rem; }
.form-label { display: block; font-weight: 700; font-size: 0.95rem; color: #1e293b; margin-bottom: 0.8rem; }
.form-control { width: 100%; padding: 1rem; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 1rem; outline: none; transition: border-color 0.2s; }
.form-control:focus { border-color: var(--primary); }
.write-buttons { display: flex; justify-content: center; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #f1f5f9; }

/* Page Content */
.page-content { font-size: 1.1rem; line-height: 1.8; color: #334155; }
.page-content img { max-width: 100%; height: auto; border-radius: 12px; }
.page-content h2 { font-size: 1.8rem; font-weight: 800; margin: 2rem 0 1rem; color: var(--secondary); }
.page-content p { margin-bottom: 1.5rem; }

/* Footer */
footer { background: #1e293b; color: #f1f5f9; padding: 4rem 0; margin-top: 4rem; }

@media (max-width: 1024px) {
    .header-inner { height: 70px; }
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .layout-wrapper { flex-direction: column; gap: 3rem; padding: 3rem 0; }
    .sidebar { width: 100%; position: static; }
    .top-bar { display: none; }
    .sub-header { padding: 80px 0 40px; }
    .sub-header h1 { font-size: 2.2rem; }
    .tab-bar { top: 70px; }
    .tab-item { padding: 0 1rem; min-width: auto; }
}

/* Write Page Enhancements */
.form-group-options { display: flex; gap: 1.5rem; margin-top: -1rem; margin-bottom: 2rem; padding: 0.5rem 0.2rem; }
.checkbox-inline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; font-weight: 600; color: #475569; cursor: pointer; transition: color 0.2s; }
.checkbox-inline:hover { color: var(--primary); }
.checkbox-inline input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

.write-card { background: #f8fafc; border-radius: 16px; border: 1px solid #e2e8f0; overflow: hidden; margin-bottom: 1.5rem; }
.write-card .card-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid #e2e8f0; background: #fff; display: flex; align-items: center; gap: 0.8rem; }
.write-card .card-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--secondary); display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.write-card .card-body { padding: 1.5rem; background: #fff; }

.form-help { font-size: 0.85rem; color: #94a3b8; margin-top: 0.6rem; }

.media-row { display: block; }
.media-col { flex: 1; min-width: 0; }

.thumbnail-upload { 
    border: 2px dashed #e2e8f0; 
    border-radius: 12px; 
    padding: 2rem; 
    text-align: center; 
    background: #f8fafc;
    transition: all 0.2s;
    position: relative;
    margin-bottom: 12px;
}
.thumbnail-upload:hover { border-color: var(--primary); background: #f0f7ff; }
.upload-placeholder i, .upload-placeholder svg { color: #94a3b8; margin-bottom: 1rem; }
.upload-placeholder p { font-size: 0.9rem; color: #64748b; margin-bottom: 1.2rem; }
.btn-upload { 
    display: inline-block; 
    padding: 0.6rem 1.2rem; 
    background: #64748b; 
    color: white; 
    border-radius: 8px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: background 0.2s;
}
.btn-upload:hover { background: #475569; }
.btn-upload input[type="file"] { display: none; }

.thumb-preview { position: relative; display: inline-block; max-width: 200px; }
.thumb-preview img { width: 100%; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.delete-thumb { 
    position: absolute; 
    top: -10px; 
    right: -10px; 
    background: white; 
    padding: 4px 8px; 
    border-radius: 20px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    color: #ef4444; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    border: 1px solid #fee2e2;
}

.file-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.file-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0.8rem 1rem; 
    background: #f8fafc; 
    border: 1px solid #e2e8f0; 
    border-radius: 8px;
    font-size: 0.9rem;
}

.file-item.existing { border-left: 4px solid var(--primary); }
.file-name { color: #1e293b; font-weight: 500; }
.delete-file { font-size: 0.8rem; color: #ef4444; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 0.4rem; }

.btn-add-file { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 0.6rem 1.2rem; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 0.85rem; 
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.btn-add-file:hover { opacity: 0.9; transform: translateY(-1px); }

.mt-4 { margin-top: 1.5rem !important; }

@media (max-width: 768px) {
    .media-row { flex-direction: column; gap: 1.5rem; }
}
