:root {
    --primary-color: #D72638;
    --primary-foreground: #ffffff;
    --background: #ffffff;
    --foreground: #000000;
    --default-50: #fafafa;
    --default-100: #f4f4f5;
    --default-200: #e4e4e7;
    --default-500: #71717a;
    --default-800: #27272a;
    --border: #e4e4e7;
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
}

.dark {
    --background: #000000;
    --foreground: #fafafa;
    --default-50: #18181b;
    --default-100: #27272a;
    --default-200: #3f3f46;
    --default-500: #71717a;
    --default-800: #fafafa;
    --border: #27272a;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.header-spacer {
    height: 64px;
}

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.dark .main-nav {
    background: rgba(0, 0, 0, 0.7);
}

.nav-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    border-radius: 50%;
    object-fit: cover;
}

.logo-text {
    font-weight: 500;
    font-size: 18px;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: block;
    }
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--foreground);
    font-weight: 500;
    padding: 8px 16px;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px 16px;
    font-weight: 500;
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--default-100);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 130px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 50;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-list {
    list-style: none;
}

.dropdown-link {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--default-800);
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-link:hover {
    background: var(--primary-color);
    color: var(--primary-foreground);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bookmark-link {
    text-decoration: none;
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
}

.search-toggle {
    position: relative;
}

.search-checkbox {
    display: none;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
}

.search-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.search-form {
    position: absolute;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 64px;
    background: rgba(244, 244, 245, 0.95);
    backdrop-filter: blur(32px);
    display: none;
    z-index: 30;
}

.dark .search-form {
    background: rgba(39, 39, 42, 0.95);
}

.search-checkbox:checked ~ .search-form {
    display: flex;
}

.search-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-wrapper {
    max-width: 1024px;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.search-input {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--foreground);
}

.search-input::placeholder {
    color: var(--muted-foreground);
}

.search-submit {
    background: none;
    border: none;
    cursor: pointer;
}

.search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
}

.close-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.theme-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sun-icon, .moon-icon {
    width: 20px;
    height: 20px;
    transition: all 0.3s;
}

.sun-icon {
    transform: rotate(0deg);
}

.dark .sun-icon {
    transform: rotate(-90deg);
    opacity: 0;
}

.moon-icon {
    transform: rotate(90deg);
    opacity: 0;
    position: absolute;
}

.dark .moon-icon {
    transform: rotate(0deg);
    opacity: 1;
}

.mobile-menu {
    display: block;
}

@media (min-width: 768px) {
    .mobile-menu {
        display: none;
    }
}

.mobile-checkbox {
    display: none;
}

.mobile-close {
    display: none;
    cursor: pointer;
}

.mobile-checkbox:checked ~ .mobile-close {
    display: flex;
}

.mobile-open {
    display: flex;
    cursor: pointer;
}

.mobile-checkbox:checked ~ .mobile-open {
    display: none;
}

.mobile-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon, .close-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.mobile-menu-overlay {
    position: absolute;
    top: 64px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 64px);
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(64px);
    display: none;
    z-index: 50;
}

.dark .mobile-menu-overlay {
    background: rgba(24, 24, 27, 0.95);
}

.mobile-checkbox:checked ~ .mobile-menu-overlay {
    display: block;
}

.mobile-nav {
    padding: 16px;
}

.mobile-nav-list {
    list-style: none;
}

.mobile-nav-item {
    padding: 12px 8px;
}

.mobile-nav-link {
    text-decoration: none;
    color: var(--default-800);
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 0.05em;
}

.floating-buttons {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
}

.float-btn {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: var(--primary-foreground);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(215, 38, 56, 0.3);
}

.ad-text {
    font-size: 10px;
    text-decoration: line-through;
}

.refresh-icon, .top-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.notice-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    margin: 8px 16px;
    border-radius: 8px;
}

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

.notice-text {
    font-size: 12px;
    font-weight: 500;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notice-btn {
    text-decoration: none;
}

.notice-btn-text {
    font-size: 12px;
    font-weight: 500;
    color: #fef2f2;
    background: #991b1b;
    padding: 4px 16px;
    border-radius: 12px;
}

.main-content {
    padding-top: 8px;
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 16px;
}

.search-section {
    display: flex;
    justify-content: center;
    margin: 8px 0 24px;
}

@media (min-width: 768px) {
    .search-section {
        margin: 24px 0;
    }
}

.home-search-form {
    width: 100%;
    background: var(--default-100);
    border-radius: 24px;
    padding: 8px;
}

.home-search-wrapper {
    display: flex;
    align-items: center;
}

.home-search-input {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    border-radius: 24px;
}

.home-search-input::placeholder {
    color: var(--muted-foreground);
    font-size: 12px;
}

.home-search-btn {
    background: var(--primary-color);
    color: var(--primary-foreground);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.home-search-btn:hover {
    transform: scale(1.05);
}

.category-nav {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: var(--default-100);
    color: var(--foreground);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-btn:hover {
    background: var(--primary-color);
    color: var(--primary-foreground);
}

.history-section {
    margin: 24px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.clear-history {
    background: none;
    border: none;
    color: var(--muted-foreground);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.history-list {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.history-list::-webkit-scrollbar {
    display: none;
}

.empty-history {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--default-50);
    padding: 20px;
    border-radius: 8px;
    color: var(--muted-foreground);
    font-size: 14px;
}

.empty-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.recent-updates {
    margin: 24px 0;
}

.manga-slider {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 16px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.manga-slider::-webkit-scrollbar {
    display: none;
}

.manga-card {
    display: flex;
    flex-direction: column;
    width: 112px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .manga-card {
        width: 144px;
    }
}

.manga-link {
    text-decoration: none;
    color: inherit;
}

.manga-cover {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.manga-img-wrapper {
    width: 100%;
    padding-bottom: 133.33%;
    position: relative;
}

.manga-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.manga-tag {
    position: absolute;
    top: 0;
    left: 0;
}

.tag-text {
    background: var(--primary-color);
    color: var(--primary-foreground);
    padding: 4px;
    font-size: 12px;
    font-weight: 500;
    border-top-left-radius: 8px;
    border-bottom-right-radius: 8px;
    width: 64px;
    text-align: center;
}

.manga-chapter {
    position: absolute;
    bottom: 0;
    right: 0;
}

.chapter-text {
    background: rgba(63, 63, 70, 0.9);
    color: #fafafa;
    padding: 4px;
    font-size: 12px;
    border-top-left-radius: 8px;
    border-bottom-right-radius: 8px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .chapter-text {
        max-width: 130px;
    }
}

.manga-title {
    margin: 4px 0;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 112px;
}

@media (min-width: 768px) {
    .manga-title {
        width: 144px;
    }
}

.content-section {
    margin: 32px 0;
}

.section-header-link {
    margin-bottom: 16px;
}

.section-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
}

@media (min-width: 768px) {
    .section-link {
        justify-content: flex-start;
        gap: 8px;
    }
}

.arrow-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.manga-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (min-width: 768px) {
    .manga-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.grid-item {
    padding-bottom: 8px;
}

.grid-link {
    text-decoration: none;
    color: inherit;
}

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

.grid-img-wrapper {
    width: 100%;
    padding-bottom: 133.33%;
    position: relative;
    background: var(--default-100);
    border-radius: 8px;
    overflow: hidden;
}

.grid-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.grid-title {
    margin: 8px 4px;
    padding: 8px 4px;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-btn-wrapper {
    margin: 16px 8px 8px;
}

.more-btn {
    display: block;
    width: 100%;
    background: var(--default-100);
    color: var(--foreground);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.more-btn:hover {
    background: var(--primary-color);
    color: var(--primary-foreground);
}

.footer {
    background: #000000;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.footer-container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 16px;
}

.footer-promo {
    margin: 8px 0;
}

.promo-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@media (min-width: 768px) {
    .promo-content {
        flex-direction: row;
        padding: 20px 0 40px;
    }
}

.promo-text {
    font-size: 14px;
    font-weight: 500;
    color: #fafafa;
    text-align: center;
}

@media (min-width: 768px) {
    .promo-text {
        flex: 1;
        text-align: left;
    }
}

.promo-btn-wrapper {
    width: 100%;
}

@media (min-width: 768px) {
    .promo-btn-wrapper {
        width: 50%;
    }
}

.promo-btn {
    display: block;
    width: 100%;
    background: var(--primary-color);
    color: var(--primary-foreground);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.promo-btn:hover {
    background: #b91c2c;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 24px;
    margin: 20px 0;
}

@media (min-width: 640px) {
    .footer-links {
        grid-template-columns: repeat(4, 1fr);
        margin: 0;
    }
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-title {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.footer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.footer-item {
    padding: 8px 0;
}

.footer-link {
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    padding: 12px 0;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #ffffff;
}

.footer-copyright {
    text-align: center;
    margin: 40px 20px 4px;
}

@media (min-width: 768px) {
    .footer-copyright {
        margin: 40px 0 4px;
    }
}

.copyright-text {
    font-size: 12px;
    color: #d1d5db;
}

@media (max-width: 767px) {
    .nav-center {
        display: none;
    }
    
    .nav-actions {
        gap: 8px;
    }
    
    .bookmark-link {
        font-size: 12px;
    }
}
