/* ================================================
   메이플 아이템 시세표 - 새 디자인
   색상: #3C3744 (어두운 회색), #B4C5E4 (파랑), #FBFFF1 (밝은)
   ================================================ */

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #FBFFF1;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================================
   헤더
   ================================================ */

.main-header {
    background: #3C3744;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.header-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 4px;
}

.header-sync-btn {
    padding: 5px 14px;
    background: rgba(180, 197, 228, 0.2);
    border: 1px solid rgba(180, 197, 228, 0.5);
    color: #B4C5E4;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.header-sync-btn:hover {
    background: rgba(180, 197, 228, 0.35);
    color: #fff;
}
.header-char-name {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 600;
}
.header-unsync-btn {
    padding: 5px 14px;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #FF6B6B;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.header-unsync-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    color: #fff;
}

.header-row-bottom {
    padding: 6px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 17px;
    font-weight: 700;
}

.logo img {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    mix-blend-mode: normal; /* 이미지 본연의 색상 유지 */
}

.main-nav {
    display: flex;
    gap: 28px;
    justify-content: center;
}

.main-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    padding-bottom: 6px;
}

.main-nav a:hover,
.main-nav a.active {
    color: white;
}

.main-nav a.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #B4C5E4;
}

/* 네비게이션 드롭다운 */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-trigger::after {
    content: '▼';
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s;
}

@media (hover: hover) {
    .nav-dropdown:hover .dropdown-trigger::after {
        transform: rotate(180deg);
    }
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #3C3744;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1100;
}

.dropdown-content a {
    color: rgba(255,255,255,0.8);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    text-align: center; /* 텍스트 가운데 정렬 추가 */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 12px !important; /* 헤더의 언더라인 방해 방지 */
}

.dropdown-content a::after {
    display: none !important; /* 드롭다운 내부 메뉴는 하단 바 제외 */
}

.dropdown-content a:hover {
    background-color: #4A4453;
    color: white;
}

.nav-dropdown:hover .dropdown-content {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ================================================
   메인 콘텐츠
   ================================================ */

.main-content {
    flex: 1;
    padding: 60px 0 40px;
}

/* 검색 섹션 */
.search-section {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: #2C2C2C;
    margin-bottom: 30px;
}

.search-wrapper {
    max-width: 900px;
    margin: 0 auto 20px;
    display: flex;
    background: #3C3744;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(60, 55, 68, 0.15);
}

.search-input {
    flex: 1;
    padding: 18px 24px;
    border: none;
    background: #3C3744;
    color: white;
    font-size: 16px;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.search-button {
    padding: 18px 40px;
    background: #B4C5E4;
    border: none;
    color: #3C3744;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-button:hover {
    background: #A0B3D8;
}

.color-codes {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.color-code {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    background: #3C3744;
    color: white;
}

.color-code.light {
    background: #B4C5E4;
    color: #3C3744;
}

.color-code.lightest {
    background: white;
    color: #3C3744;
    border: 2px solid #E0E0E0;
}

/* 즐겨찾기 검색 결과 */
#favoriteSearchResults {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

#favoriteSearchResults .search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

#favoriteSearchResults .search-result-item:hover {
    background: #f8f9fa;
}

#favoriteSearchResults .search-result-item:last-child {
    border-bottom: none;
}

#favoriteSearchResults .item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#favoriteSearchResults .item-image {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

#favoriteSearchResults .item-name {
    font-weight: 600;
    color: #2C2C2C;
}

#favoriteSearchResults .item-server {
    font-size: 13px;
    color: #666;
    margin-left: 10px;
}

#favoriteSearchResults .add-favorite-btn {
    padding: 6px 16px;
    background: #B4C5E4;
    border: none;
    border-radius: 20px;
    color: #3C3744;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#favoriteSearchResults .add-favorite-btn:hover {
    background: #A0B3D8;
}

/* 정보 박스 */
.info-box {
    max-width: 1000px;
    margin: 0 auto 60px;
    background: white;
    border: 2px solid #B4C5E4;
    border-radius: 12px;
    padding: 24px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.info-box-icon {
    flex-shrink: 0;
}

.info-box-content {
    flex: 1;
}

.info-box-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2C2C2C;
    margin-bottom: 6px;
}

.info-box-content p {
    font-size: 14px;
    color: #666;
}

.info-box-search {
    padding: 12px 24px;
    background: white;
    border: 2px solid #3C3744;
    border-radius: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.info-box-search:hover {
    background: #3C3744;
    transform: scale(1.05);
}

/* ================================================
   푸터 카드 섹션
   ================================================ */

.footer-cards {
    background: #3C3744;
    padding: 60px 0;
}

.top-card-section {
    width: 100%;
    margin-bottom: 30px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.card {
    background: rgba(180, 197, 228, 0.1);
    border: 2px solid rgba(180, 197, 228, 0.2);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, border-color 0.2s;
    height: 100%;
}

.main-info-card {
    background: rgba(180, 197, 228, 0.15);
    border-color: rgba(180, 197, 228, 0.3);
}

.card:hover {
    border-color: #B4C5E4;
    transform: translateY(-4px);
}

.card-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(180, 197, 228, 0.3);
}

#infoSection .card-title {
    color: #000;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.card-content {
    color: #000;
    font-size: 14px;
    line-height: 1.8;
}

/* 서버 토글 버튼 */
.server-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.server-btn {
    padding: 8px 16px;
    background: rgba(180, 197, 228, 0.5);
    border: 1px solid rgba(180, 197, 228, 0.6);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.server-btn:hover {
    background: rgba(180, 197, 228, 0.7);
    color: #fff;
}

.server-btn.active {
    background: #B4C5E4;
    color: #000;
    border-color: #B4C5E4;
}

/* 최신 정보 카드 - 테이블 */
.simple-table-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.simple-table-wrapper {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.simple-table-header {
    background: rgba(180, 197, 228, 0.2);
    color: white;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

#simpleItemsTable1,
#simpleItemsTable2 {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#simpleItemsTable1 tr,
#simpleItemsTable2 tr {
    border-bottom: 1px solid rgba(180, 197, 228, 0.1);
    cursor: pointer;
    transition: background 0.2s;
}

#simpleItemsTable1 tr:hover,
#simpleItemsTable2 tr:hover {
    background: rgba(180, 197, 228, 0.15);
}

#simpleItemsTable1 td,
#simpleItemsTable2 td {
    padding: 10px 12px;
    font-size: 13px;
    color: #FBFFF1;
}

#simpleItemsTable1 td:first-child,
#simpleItemsTable2 td:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 60%;
}

#simpleItemsTable1 td:nth-child(2),
#simpleItemsTable2 td:nth-child(2) {
    white-space: nowrap;
}

#simpleItemsTable1 td:nth-child(3),
#simpleItemsTable2 td:nth-child(3) {
    white-space: nowrap;
}

.simple-table-item-image {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

/* 업데이트 내역 */
.update-list {
    list-style: none;
}

.update-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.update-list li:last-child {
    border-bottom: none;
}

.date {
    color: #333;
    font-size: 13px;
}

/* 인기 검색어 */
.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    color: #333;
    font-size: 14px;
}

/* ================================================
   공통 빈 상태 스타일
   ================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    width: 100%;
    text-align: center;
    color: #999;
    padding: 40px 0;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #3C3744;
    font-size: 20px;
}

.empty-state p {
    font-size: 14px;
}

/* 즐겨찾기 & 에테르넬 섹션 (접었다 펼침) */

.maple-window {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.window-title {
    background: #3C3744;
    color: white;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window-content {
    padding: 20px;
}

.filter-btn {
    padding: 8px 20px;
    background: #3C3744;
    border: 1px solid rgba(180, 197, 228, 0.2);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 5px;
}

.filter-btn:hover {
    background: #4A4453;
}

.filter-btn.active {
    background: #B4C5E4;
    border-color: #B4C5E4;
    color: #000;
}

/* 즐겨찾기 테이블 */
#favoriteItemsContainer .favorite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

#favoriteItemsContainer .favorite-item:hover {
    background: #f8f9fa;
}

#favoriteItemsContainer .favorite-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    cursor: pointer;
}

#favoriteItemsContainer .favorite-item-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

#favoriteItemsContainer .favorite-item-details {
    flex: 1;
}

#favoriteItemsContainer .favorite-item-name {
    font-weight: 600;
    color: #2C2C2C;
    margin-bottom: 4px;
}

#favoriteItemsContainer .favorite-item-meta {
    font-size: 13px;
    color: #666;
}

#favoriteItemsContainer .favorite-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #3C3744;
    margin: 0 15px;
}

#favoriteItemsContainer .remove-favorite-btn {
    padding: 8px 16px;
    background: #FF6B6B;
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

#favoriteItemsContainer .remove-favorite-btn:hover {
    background: #FF5252;
}

/* 에테르넬 테이블 */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(180, 197, 228, 0.3);
}

.eternal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background-color: #FBFFF1;
}

.eternal-table thead {
    background: #3C3744;
}

.eternal-table th {
    padding: 14px 10px;
    text-align: center;
    border: 1px solid rgba(180, 197, 228, 0.2);
    font-weight: 600;
    color: #FBFFF1; /* 헤더 글자색: 하얀색 계열 */
}

.eternal-table tbody td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid rgba(180, 197, 228, 0.15);
    cursor: pointer;
    transition: all 0.2s;
    background-color: #ffffff;
    color: #3C3744; /* 기본 글자색: 어두운 회색 */
}

/* '부위' 열 특수 스타일 */
.eternal-part-column {
    background-color: #B4C5E4 !important;
    font-weight: 800 !important;
    color: #3C3744 !important;
    min-width: 80px;
}

.eternal-item-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
}

.eternal-item-name {
    display: block;
    line-height: 1.2;
}

.eternal-item-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.eternal-table tbody tr:hover td {
    background-color: rgba(180, 197, 228, 0.2);
}

/* 호버 시 부위 열은 더 진하게 */
.eternal-table tbody tr:hover .eternal-part-column {
    background-color: #A0B3D8 !important;
}

.eternal-price {
    font-weight: 700;
    color: #3C3744;
}

.eternal-change-up {
    color: #FF6B6B; /* 빨간색 - 상승 */
    font-weight: 600;
}

.eternal-change-down {
    color: #1E90FF; /* 파란색 - 하락 */
    font-weight: 600;
}

.eternal-change-neutral {
    color: #999;
}

/* ================================================
   푸터
   ================================================ */

.main-footer {
    background: #2C2C2C;
    padding: 30px 0;
    text-align: center;
}

/* 인기 아이템 탭 스타일 */
.popular-period-selector {
    border-bottom: 1px solid rgba(180, 197, 228, 0.1);
    padding-bottom: 10px;
}

.period-btn {
    padding: 6px 14px;
    border-radius: 15px;
    border: 1px solid rgba(180, 197, 228, 0.2);
    background: transparent;
    color: #B4C5E4;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn:hover {
    background: rgba(180, 197, 228, 0.05);
}

.period-btn.active {
    background: #B4C5E4;
    color: #3C3744;
    border-color: #B4C5E4;
}

.popular-items-list {
    margin-top: 10px;
}

.popular-item-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(180, 197, 228, 0.05);
    cursor: pointer;
    transition: transform 0.2s;
}

.popular-item-row:hover {
    transform: translateX(5px);
}

.popular-item-row:last-child {
    border-bottom: none;
}

.popular-rank {
    font-size: 16px;
    font-weight: 800;
    color: #B4C5E4;
    width: 25px;
    font-style: italic;
}

.popular-info {
    flex: 1;
    margin-left: 10px;
}

.popular-name {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin-bottom: 2px;
}

.popular-meta {
    font-size: 12px;
    color: #999;
}

.popular-price {
    font-size: 14px;
    font-weight: 700;
    color: #FF6B6B;
}

/* 검색창 툴팁 스타일 */
.search-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 20px;
    background: #FF6B6B;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.search-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.search-tooltip::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 25px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #FF6B6B;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-nav a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: white;
}

.copyright {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

.copyright p {
    margin: 5px 0;
}

.copyright a {
    color: #B4C5E4;
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}

/* ================================================
   그래프 모달
   ================================================ */

.graph-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.graph-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.graph-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.graph-modal-close:hover {
    color: #333;
}

.chart-item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.chart-item-image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.chart-item-details h3 {
    font-size: 24px;
    color: #2C2C2C;
    margin-bottom: 5px;
}

.chart-item-details p {
    font-size: 14px;
    color: #666;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #3C3744;
}

.chart-container {
    position: relative;
    height: 400px;
}

/* ================================================
   개인정보처리방침 모달
   ================================================ */

#privacyModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    overflow-y: auto;
}

#privacyModal > div {
    max-width: 800px;
    margin: 50px auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    position: relative;
}

#privacyModal h2 {
    color: #3C3744;
    margin-bottom: 30px;
    font-size: 28px;
}

#privacyModal h3 {
    color: #3C3744;
    margin-top: 25px;
    margin-bottom: 15px;
}

#privacyModal p,
#privacyModal li {
    line-height: 1.8;
    color: #333;
    margin-bottom: 15px;
}

#privacyModal ul {
    margin-left: 20px;
}

/* ================================================
   반응형
   ================================================ */

/* ================================================
   반응형 및 모바일 최적화 (Phase 1)
   ================================================ */

/* 모바일 메뉴 토글 버튼 스타일 */
.mobile-toggle {
    display: none; /* PC에서는 숨김 */
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 1100;
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .mobile-toggle { display: flex; }
    .header-row-bottom { height: 0; overflow: visible; padding: 0; }

    /* 메인 네비게이션 모바일 슬라이드 메뉴로 변환 */
    .main-nav {
        display: flex !important; /* 항상 flex 유지하되 위치로 조절 */
        position: fixed;
        top: 0;
        right: -100%; /* 기본적으로 화면 밖 */
        width: 280px;
        height: 100vh;
        background: #3C3744;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0 !important;
        padding: 80px 0 120px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
        transition: right 0.3s ease-in-out;
        z-index: 1050;
        visibility: hidden; /* 화면 밖일 때 숨김 */
        overflow-y: auto;
    }

    .main-nav.active {
        right: 0;
        visibility: visible;
    }

    .main-nav a {
        width: 100%;
        padding: 15px 30px !important;
        font-size: 16px !important;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        color: white !important;
    }

    .main-nav a.active::before {
        display: none; /* 하단 바 제거 */
    }

    .main-nav a.active {
        background: rgba(180, 197, 228, 0.1);
        color: #B4C5E4 !important;
    }

    /* 드롭다운 메뉴 모바일 대응 (아코디언 방식) */
    .nav-dropdown { width: 100%; }
    .dropdown-trigger { display: flex !important; justify-content: space-between; align-items: center; }
    .dropdown-trigger::after {
        content: '▼';
        font-size: 10px;
        transition: transform 0.3s ease;
    }
    .nav-dropdown.open .dropdown-trigger::after {
        transform: rotate(180deg); /* 화살표 회전 */
    }
    
    .dropdown-content {
        position: static;
        transform: none;
        width: 100%;
        background: rgba(0,0,0,0.3);
        box-shadow: none;
        display: none !important; /* 기본적으로 강제 숨김 */
        padding: 5px 0;
        animation: none !important; /* PC용 애니메이션 제거 */
    }

    /* 마우스 호버 시에는 보이지 않도록 처리 (모바일 전용) */
    .nav-dropdown:hover .dropdown-content {
        display: none !important;
    }

    /* 오직 클릭하여 .open 클래스가 붙었을 때만 표시 */
    .nav-dropdown.open .dropdown-content {
        display: block !important;
    }
    .dropdown-content a {
        padding-left: 50px !important;
        text-align: left !important;
        font-size: 14px !important;
    }

    /* 로고 크기 축소 */
    .logo { font-size: 16px; }
    .logo img { height: 28px; }

    /* 메뉴 활성화 시 햄버거 버튼 애니메이션 (X자) */
    .mobile-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (max-width: 768px) {
    /* 1단계 & 2단계: 6.1인치 스마트폰 최적화 재설계 */
    .container { padding: 0 15px !important; } /* 여백 효율화 */
    .page-title { font-size: 22px !important; }

    /* 헤더 및 로고 */
    .logo { font-size: 15px !important; }
    .logo img { height: 26px !important; }

    /* 검색창: 6.1인치에서 가독성 확보 */
    .search-input { font-size: 14px !important; padding: 12px 15px !important; }
    .search-button { padding: 12px !important; font-size: 14px !important; }

    /* 카드 레이아웃: 여백 타이트하게 */
    .cards-grid { gap: 15px !important; }
    .card { padding: 15px !important; }
    .card-title { font-size: 16px !important; margin-bottom: 15px !important; }

    /* ★ 에테르넬 테이블: 6.1인치 가로 폭 맞춤 핵심 설정 */
    .eternal-table { font-size: 11px !important; letter-spacing: -0.5px; }
    .eternal-table th, .eternal-table td { padding: 6px 2px !important; }
    .eternal-item-icon { width: 18px !important; height: 18px !important; }
    .eternal-part-column { min-width: 50px !important; font-size: 10px !important; }
    .eternal-item-name { transform: scale(0.95); display: inline-block; }

    .window-content { padding: 10px !important; }
    .table-responsive { 
        margin: 0 -10px; 
        border: none;
    }

    /* 푸터 링크 간격 확대 (터치 정확도) */
    .footer-nav { gap: 15px 10px !important; }
    .footer-nav a { font-size: 13px !important; }
    /* 모바일 헤더/푸터 호버 효과 전체 제거 */
    .main-header a:hover, 
    .main-footer a:hover,
    .footer-nav a:hover,
    .dropdown-trigger:hover,
    .logo:hover,
    #adminLoginBtn:hover { 
        background: none !important; 
        color: inherit !important; 
        opacity: 1 !important;
        text-decoration: none !important;
        transform: none !important;
    }
    
    /* 메뉴 내부 글자색 유지 */
    .main-nav a:hover { color: white !important; }
    .dropdown-content a:hover { color: white !important; background: rgba(255,255,255,0.1) !important; }

    .search-button:hover, .dropdown-item-btn:hover { transform: none !important; }
    
    /* 터치 시 피드백만 살짝 (선택 사항) */
    .search-button:active, .dropdown-item-btn:active { opacity: 0.8; }
}

@media (max-width: 968px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .simple-table-container {
        grid-template-columns: 1fr;
    }
    
    .chart-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .main-nav {
        gap: 20px;
    }
    
    .page-title {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    .search-wrapper {
        flex-direction: column;
    }
    
    .search-button {
        width: 100%;
    }
    
    .info-box {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav {
        display: none;
    }
    
    .color-codes {
        flex-wrap: wrap;
    }
    
    .footer-nav {
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* ================================================
   유틸리티 클래스
   ================================================ */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ================================================
   마도서/미트라 툴팁 스타일
   ================================================ */
.spellbook-tooltip-container {
    position: absolute;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #3C3744;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    pointer-events: none;
    min-width: 280px;
}

.spellbook-tooltip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.spellbook-tooltip-item:last-child {
    border-bottom: none;
}

.spellbook-tooltip-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.spellbook-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.spellbook-price {
    font-size: 13px;
    font-weight: 700;
    color: #3C3744;
    width: 70px;
    text-align: right;
}

.spellbook-change {
    font-size: 11px;
    font-weight: 600;
    width: 80px;
    text-align: right;
}

/* ================================================
   검색 드롭다운 스타일
   ================================================ */

.search-dropdown-item {
    display: flex !important;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    color: #333;
    text-align: left;
}

.search-dropdown-item:hover {
    background: #f8f9fa;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item-image {
    width: 32px;
    height: 32px;
    margin-right: 15px;
    border-radius: 4px;
}

.dropdown-item-info {
    flex: 1;
}

.dropdown-item-name {
    font-weight: 600;
    font-size: 14px;
    color: #2C2C2C;
}

.dropdown-item-price {
    font-size: 12px;
    color: #666;
}

.dropdown-item-server {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0f0f0;
    margin-left: 8px;
    color: #999;
}

.dropdown-item-btn {
    padding: 6px 15px;
    border-radius: 20px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #B4C5E4;
    color: #3C3744;
}

.dropdown-item-btn.remove {
    background: #FF6B6B;
    color: white;
}
