/* ============================================
   Guides - Editorial Documentation Style
   Inspired by: Stripe Docs, Linear, Notion
   ============================================ */

:root {
    /* Core Colors */
    --guide-bg-primary: #0f0f0f;
    --guide-bg-secondary: #161616;
    --guide-bg-tertiary: #1c1c1c;
    --guide-bg-elevated: #222222;

    /* Border Colors */
    --guide-border-subtle: #2a2a2a;
    --guide-border-default: #333333;
    --guide-border-strong: #404040;

    /* Text Colors */
    --guide-text-primary: #f5f5f5;
    --guide-text-secondary: #c8c8c8;
    --guide-text-tertiary: #6b6b6b;
    --guide-text-muted: #4a4a4a;

    /* Accent Colors */
    --guide-accent-gold: #d4a853;
    --guide-accent-gold-dim: rgba(212, 168, 83, 0.15);
    --guide-accent-gold-glow: rgba(212, 168, 83, 0.08);
    --guide-accent-blue: #5c9eff;
    --guide-accent-blue-dim: rgba(92, 158, 255, 0.12);

    /* Spacing Scale */
    --guide-space-xs: 4px;
    --guide-space-sm: 8px;
    --guide-space-md: 16px;
    --guide-space-lg: 24px;
    --guide-space-xl: 32px;
    --guide-space-2xl: 48px;
    --guide-space-3xl: 64px;
    --guide-space-4xl: 96px;

    /* Typography Scale */
    --guide-text-xs: 12px;
    --guide-text-sm: 13px;
    --guide-text-base: 15px;
    --guide-text-lg: 17px;
    --guide-text-xl: 20px;
    --guide-text-2xl: 24px;
    --guide-text-3xl: 30px;
    --guide-text-4xl: 36px;

    /* Effects */
    --guide-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --guide-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --guide-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --guide-shadow-glow: 0 0 40px var(--guide-accent-gold-glow);

    /* Transitions */
    --guide-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --guide-transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --guide-transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Page Header
   ============================================ */

.header-container {
    margin-bottom: var(--guide-space-lg);
    padding-bottom: var(--guide-space-lg);
    border-bottom: 1px solid var(--guide-border-subtle);
}

.header-container h1 {
    font-size: var(--guide-text-3xl);
    font-weight: 600;
    color: var(--guide-text-primary);
    letter-spacing: -0.02em;
}

/* ============================================
   Search Bar
   ============================================ */

.guides-search {
    position: relative;
    margin-bottom: var(--guide-space-md);
}

.guides-search-icon {
    position: absolute;
    left: var(--guide-space-md);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--guide-text-tertiary);
    pointer-events: none;
}

.guides-search-input {
    width: 100%;
    padding: var(--guide-space-md) var(--guide-space-md) var(--guide-space-md) 44px;
    background: var(--guide-bg-secondary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 10px;
    color: var(--guide-text-primary);
    font-size: var(--guide-text-base);
    outline: none;
    transition: border-color var(--guide-transition-fast), box-shadow var(--guide-transition-fast);
    box-sizing: border-box;
}

.guides-search-input::placeholder {
    color: var(--guide-text-muted);
}

.guides-search-input:focus {
    border-color: var(--guide-accent-gold);
    box-shadow: 0 0 0 3px var(--guide-accent-gold-glow);
}

/* ============================================
   Category Tabs
   ============================================ */

.guides-category-tabs {
    display: flex;
    gap: var(--guide-space-sm);
    margin-bottom: var(--guide-space-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.guides-category-tabs::-webkit-scrollbar {
    display: none;
}

.guides-tab {
    padding: var(--guide-space-sm) var(--guide-space-md);
    background: var(--guide-bg-secondary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 8px;
    color: var(--guide-text-secondary);
    font-size: var(--guide-text-sm);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--guide-transition-fast);
}

.guides-tab:hover {
    background: var(--guide-bg-tertiary);
    border-color: var(--guide-border-default);
    color: var(--guide-text-primary);
}

.guides-tab.active {
    background: var(--guide-accent-gold-dim);
    border-color: var(--guide-accent-gold);
    color: var(--guide-accent-gold);
    font-weight: 600;
}

.guides-tab.active[data-cat="growth"] {
    color: #5ccc7f;
    border-color: #5ccc7f;
    background: rgba(92, 204, 127, 0.12);
}

.guides-tab.active[data-cat="combat"] {
    color: #e85c5c;
    border-color: #e85c5c;
    background: rgba(232, 92, 92, 0.12);
}

.guides-tab.active[data-cat="system"] {
    color: #5c9eff;
    border-color: #5c9eff;
    background: rgba(92, 158, 255, 0.12);
}

.guides-tab.active[data-cat="notice"] {
    color: #e85cb0;
    border-color: #e85cb0;
    background: rgba(232, 92, 176, 0.12);
}

/* ============================================
   Guide List - Card Grid
   ============================================ */

.guides-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0 32px;
}

.guides-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--guide-space-md);
    margin-top: 0;
}

/* Guide Card */
.guide-card {
    position: relative;
    background: var(--guide-bg-secondary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: row;
    transition:
        background var(--guide-transition-base),
        border-color var(--guide-transition-base),
        box-shadow var(--guide-transition-base);
}

.guide-card:hover {
    background: var(--guide-bg-tertiary);
    border-color: var(--guide-border-default);
    box-shadow: inset 3px 0 0 var(--guide-accent-gold), var(--guide-shadow-md);
}

.guide-card-thumbnail {
    width: 160px;
    min-width: 160px;
    aspect-ratio: 3/2;
    object-fit: cover;
    background: var(--guide-bg-primary);
    border-right: 1px solid var(--guide-border-subtle);
}

.guide-card-content {
    padding: var(--guide-space-md) var(--guide-space-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.guide-card-category {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--guide-accent-gold);
    background: var(--guide-accent-gold-dim);
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: var(--guide-space-sm);
    width: fit-content;
}

/* Category Color Variants */
.guide-card-category.cat-growth,
.guide-category.cat-growth {
    color: #5ccc7f;
    background: rgba(92, 204, 127, 0.12);
}

.guide-card-category.cat-combat,
.guide-category.cat-combat {
    color: #e85c5c;
    background: rgba(232, 92, 92, 0.12);
}

.guide-card-category.cat-system,
.guide-category.cat-system {
    color: #5c9eff;
    background: rgba(92, 158, 255, 0.12);
}

.guide-card-category.cat-notice,
.guide-category.cat-notice {
    color: #e85cb0;
    background: rgba(232, 92, 176, 0.12);
}

.guide-card-title {
    font-size: var(--guide-text-base);
    font-weight: 600;
    color: var(--guide-text-primary);
    margin-top: 0;
    margin-bottom: var(--guide-space-xs);
    line-height: 1.4;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guide-card-excerpt {
    font-size: var(--guide-text-sm);
    color: #777777;
    line-height: 1.6;
    margin: 0 0 var(--guide-space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.guide-card-meta {
    display: flex;
    align-items: center;
    gap: var(--guide-space-sm);
    font-size: var(--guide-text-xs);
    color: var(--guide-text-tertiary);
    margin-top: auto;
}

.guide-card-author {
    display: flex;
    align-items: center;
    gap: var(--guide-space-xs);
}

.guide-card-author::before {
    content: '';
    width: 3px;
    height: 3px;
    background: var(--guide-text-muted);
    border-radius: 50%;
}

/* ============================================
   Guide View - Article Layout
   ============================================ */

.guide-view-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--guide-space-lg) var(--guide-space-xl);
    padding-bottom: var(--guide-space-4xl);
}

/* Back Button */
.guide-back {
    display: inline-flex;
    align-items: center;
    gap: var(--guide-space-sm);
    font-size: var(--guide-text-sm);
    font-weight: 500;
    color: var(--guide-text-secondary);
    text-decoration: none;
    margin-bottom: var(--guide-space-xl);
    padding: var(--guide-space-sm) var(--guide-space-md);
    background: var(--guide-bg-secondary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 8px;
    transition: all var(--guide-transition-fast);
}

.guide-back:hover {
    color: var(--guide-text-primary);
    background: var(--guide-bg-tertiary);
    border-color: var(--guide-border-default);
}

.guide-back svg {
    width: 16px;
    height: 16px;
    transition: transform var(--guide-transition-fast);
}

.guide-back:hover svg {
    transform: translateX(-2px);
}

/* Article Container */
.guide-article {
    background: var(--guide-bg-secondary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 16px;
    overflow: hidden;
}

/* Guide Header */
.guide-header {
    padding: var(--guide-space-2xl) var(--guide-space-2xl) var(--guide-space-xl);
    border-bottom: 1px solid var(--guide-border-subtle);
    background: linear-gradient(180deg,
            var(--guide-bg-tertiary) 0%,
            var(--guide-bg-secondary) 100%);
}

.guide-category {
    display: inline-flex;
    align-items: center;
    font-size: var(--guide-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--guide-accent-gold);
    background: var(--guide-accent-gold-dim);
    padding: var(--guide-space-xs) var(--guide-space-md);
    border-radius: 6px;
    margin-bottom: var(--guide-space-md);
}

.guide-title {
    font-size: var(--guide-text-4xl);
    font-weight: 700;
    color: var(--guide-text-primary);
    line-height: 1.2;
    margin-bottom: var(--guide-space-md);
    letter-spacing: -0.025em;
    margin-top: 0;
}

.guide-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--guide-space-md);
    font-size: var(--guide-text-sm);
    color: var(--guide-text-tertiary);
}

.guide-meta-item {
    display: flex;
    align-items: center;
    gap: var(--guide-space-xs);
}

.guide-meta-item:not(:last-child)::after {
    content: '·';
    margin-left: var(--guide-space-md);
    color: var(--guide-text-muted);
}

.nitro-ad-container--guide-meta {
    margin-top: var(--guide-space-xl);
}

.guide-thumbnail {
    width: 100%;
    margin-top: var(--guide-space-xl);
    border-radius: 12px;
    border: 1px solid var(--guide-border-subtle);
}

/* ============================================
   Table of Contents
   ============================================ */

.guide-toc {
    margin-top: var(--guide-space-xl);
    padding: var(--guide-space-md) var(--guide-space-lg);
    background: var(--guide-bg-primary);
    border: 1px solid var(--guide-border-subtle);
    border-left: 3px solid var(--guide-accent-gold);
    border-radius: 0 8px 8px 0;
}

.guide-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--guide-space-xs);
}

.guide-toc-link {
    display: block;
    font-size: var(--guide-text-sm);
    color: var(--guide-text-secondary);
    text-decoration: none;
    padding: var(--guide-space-xs) 0;
    transition: color var(--guide-transition-fast);
    line-height: 1.5;
}

.guide-toc-link:hover {
    color: var(--guide-accent-gold);
}

/* ============================================
   Guide Content - Typography System
   ============================================ */

.guide-content {
    padding: var(--guide-space-2xl);
    font-size: var(--guide-text-base);
    line-height: 1.75;
    color: var(--guide-text-secondary);
}

.guide-content [id^="guide-article-content-autowrap-"] {
    margin-right: auto !important;
    margin-left: auto !important;
    text-align: center !important;
}

.guide-content [id^="guide-article-content-autowrap-"] > * {
    margin-right: auto !important;
    margin-left: auto !important;
}

/* Headings with anchor-style indicator */
.guide-content h1,
.guide-content h2,
.guide-content h3,
.guide-content h4 {
    position: relative;
    color: var(--guide-text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.guide-content h1 {
    font-size: var(--guide-text-2xl);
    margin: 0 0 var(--guide-space-lg);
    padding-bottom: var(--guide-space-md);
    border-bottom: 2px solid var(--guide-accent-gold);
}

.guide-content h2 {
    font-size: var(--guide-text-xl);
    margin: var(--guide-space-2xl) 0 var(--guide-space-md);
    padding-bottom: var(--guide-space-sm);
    border-bottom: 1px solid var(--guide-border-subtle);
}

.guide-content h3 {
    font-size: var(--guide-text-lg);
    margin: var(--guide-space-xl) 0 var(--guide-space-md);
    color: var(--guide-accent-gold);
}

.guide-content h4 {
    font-size: var(--guide-text-base);
    margin: var(--guide-space-lg) 0 var(--guide-space-sm);
}

.guide-content>h1:first-child,
.guide-content>h2:first-child,
.guide-content>h3:first-child,
.guide-content>h4:first-child {
    margin-top: 0;
}

/* Paragraphs */
.guide-content p {
    margin: 0 0 var(--guide-space-lg);
}

.guide-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.guide-content a {
    color: var(--guide-accent-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--guide-transition-fast);
}

.guide-content a:hover {
    border-bottom-color: var(--guide-accent-blue);
}

/* Text Emphasis */
.guide-content strong,
.guide-content b {
    font-weight: 600;
    color: var(--guide-text-primary);
}

.guide-content h1 b,
.guide-content h1 strong,
.guide-content h2 b,
.guide-content h2 strong,
.guide-content h3 b,
.guide-content h3 strong,
.guide-content h4 b,
.guide-content h4 strong {
    color: inherit;
}

.guide-content em,
.guide-content i {
    font-style: italic;
}

/* Lists */
.guide-content ul,
.guide-content ol {
    margin: 0 0 var(--guide-space-lg);
    padding-left: var(--guide-space-lg);
}

.guide-content li {
    margin: var(--guide-space-sm) 0;
    line-height: 1.7;
    padding-left: var(--guide-space-sm);
}

.guide-content li::marker {
    color: var(--guide-text-muted);
}

.guide-content ul li::marker {
    content: '—  ';
    font-weight: 500;
}

.guide-content ul ul,
.guide-content ol ol,
.guide-content ul ol,
.guide-content ol ul {
    margin: var(--guide-space-sm) 0;
}

/* Blockquotes */
.guide-content blockquote {
    position: relative;
    margin: var(--guide-space-xl) 0;
    padding: var(--guide-space-lg) var(--guide-space-xl);
    background: var(--guide-bg-tertiary);
    border-left: 3px solid var(--guide-accent-gold);
    border-radius: 0 8px 8px 0;
    color: var(--guide-text-secondary);
    font-style: italic;
}

.guide-content blockquote::before {
    content: '"';
    position: absolute;
    top: -8px;
    left: 16px;
    font-size: 48px;
    font-family: Georgia, serif;
    color: var(--guide-accent-gold-dim);
    line-height: 1;
}

.guide-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code */
.guide-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.875em;
    padding: 2px 6px;
    /* Keep inline code visual consistent even when imported HTML has inline background styles */
    background: var(--guide-bg-tertiary) !important;
    border: 1px solid var(--guide-border-subtle) !important;
    border-radius: 4px;
    color: #e8b865 !important;
}

/* CJK fallback for inline/code blocks in guides */
html[lang="ko"] .guide-content code,
html[lang="kr"] .guide-content code,
html[data-lang="kr"] .guide-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'D2Coding', 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', 'SF Mono', Consolas, monospace;
}

html[lang="ja"] .guide-content code,
html[lang="jp"] .guide-content code,
html[data-lang="jp"] .guide-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'BIZ UD Gothic', 'Yu Gothic', Meiryo, 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'SF Mono', Consolas, monospace;
}

.guide-content pre {
    margin: var(--guide-space-xl) 0;
    padding: var(--guide-space-lg);
    background: var(--guide-bg-primary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 10px;
    overflow-x: auto;
}

.guide-content pre code {
    padding: 0;
    background: none !important;
    border: none !important;
    font-size: var(--guide-text-sm);
    line-height: 1.7;
    color: var(--guide-text-secondary) !important;
}

/* Horizontal Rule */
.guide-content hr {
    margin: var(--guide-space-2xl) 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            var(--guide-border-default) 20%,
            var(--guide-border-default) 80%,
            transparent);
}

/* Images */
.guide-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: var(--guide-space-lg) 0;
}

.guide-content p>img:only-child {
    display: block;
    margin: var(--guide-space-xl) auto;
}

/* ============================================
   Tables - Clean Data Display
   ============================================ */

.guide-content table {
    width: 100%;
    margin: var(--guide-space-xl) 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--guide-text-sm);
    background: var(--guide-bg-tertiary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 10px;
    overflow: hidden;
}

.guide-content thead {
    background: var(--guide-bg-elevated);
}

.guide-content th {
    padding: var(--guide-space-md) var(--guide-space-lg);
    text-align: left;
    font-weight: 600;
    font-size: var(--guide-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--guide-text-secondary);
    border-bottom: 1px solid var(--guide-border-default);
}

.guide-content td {
    padding: var(--guide-space-md) var(--guide-space-lg);
    border-bottom: 1px solid var(--guide-border-subtle);
    color: var(--guide-text-secondary);
    vertical-align: middle;
}

.guide-content tbody tr:last-child td {
    border-bottom: none;
}

.guide-content tbody tr {
    transition: background var(--guide-transition-fast);
}

.guide-content tbody tr:hover {
    background: var(--guide-bg-elevated);
}

/* Table images */
.guide-content td img {
    max-height: 72px;
    width: auto;
    margin: 0;
    vertical-align: middle;
    border-radius: 4px;
}

/* Sea fishing: keep the six king-fish routes readable before the full tables. */
.guide-content .sea-fishing-king-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--guide-space-md);
    margin: var(--guide-space-xl) 0;
}

.guide-content .sea-fishing-king-card {
    display: flex;
    align-items: center;
    gap: var(--guide-space-md);
    min-width: 0;
    padding: var(--guide-space-md);
    background: linear-gradient(135deg, rgba(232, 184, 101, 0.14), var(--guide-bg-tertiary));
    border: 1px solid rgba(232, 184, 101, 0.35);
    border-radius: 10px;
}

.guide-content .sea-fishing-king-fish-visual,
.guide-content .sea-fishing-fish-card-visual {
    flex: 0 0 82px;
    width: 82px;
    margin: 0;
}

.guide-content .sea-fishing-king-card div {
    min-width: 0;
}

.guide-content .sea-fishing-king-card span,
.guide-content .sea-fishing-king-card strong,
.guide-content .sea-fishing-king-card p {
    display: block;
}

.guide-content .sea-fishing-king-card span {
    margin-bottom: 2px;
    color: var(--guide-accent-gold);
    font-size: var(--guide-text-xs);
}

.guide-content .sea-fishing-king-card strong {
    color: var(--guide-text-primary);
    font-size: var(--guide-text-base);
}

.guide-content .sea-fishing-king-card p {
    margin: var(--guide-space-xs) 0 0;
    font-size: var(--guide-text-xs);
    line-height: 1.55;
}

.guide-content .sea-fishing-fish-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--guide-space-md);
    margin: var(--guide-space-xl) 0 var(--guide-space-2xl);
}

.guide-content .sea-fishing-fish-card {
    display: flex;
    align-items: flex-start;
    gap: var(--guide-space-lg);
    min-width: 0;
    padding: var(--guide-space-sm);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 10px;
    background: var(--guide-bg-tertiary);
}

.guide-content .sea-fishing-fish-card-visual {
    position: relative;
    aspect-ratio: 316 / 196;
}

.guide-content .sea-fishing-fish-card-inner,
.guide-content .sea-fishing-fish-card-icon,
.guide-content .sea-fishing-fish-card-grade-tag {
    position: relative;
    margin: 0;
    object-fit: contain;
}

.guide-content .sea-fishing-fish-card-inner {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.guide-content .sea-fishing-fish-card-icon {
    position: absolute;
    top: 17%;
    left: 13%;
    z-index: 1;
    width: 75%;
    height: 64%;
}

.guide-content .sea-fishing-fish-card-grade-tag {
    position: absolute;
    right: 4%;
    bottom: 15%;
    z-index: 2;
    width: 29%;
    height: 38%;
}

.guide-content .sea-fishing-fish-card-body {
    min-width: 0;
    flex: 1;
}

.guide-content .sea-fishing-fish-card-body > span,
.guide-content .sea-fishing-fish-card-body > strong {
    display: block;
}

.guide-content .sea-fishing-fish-card-body > span {
    margin-bottom: 2px;
    font-size: var(--guide-text-xs);
    color: var(--guide-text-secondary);
}

.guide-content .sea-fishing-fish-card-body > strong {
    margin-bottom: var(--guide-space-sm);
    color: var(--guide-text-primary);
    font-size: var(--guide-text-base);
}

.guide-content .sea-fishing-fish-card dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--guide-space-xs);
    margin: 0;
    font-size: var(--guide-text-sm);
    line-height: 1.55;
}

.guide-content .sea-fishing-fish-card dl div {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--guide-space-xs);
}

.guide-content .sea-fishing-fish-card dt {
    color: var(--guide-text-muted);
}

.guide-content .sea-fishing-fish-card dd {
    min-width: 0;
    margin: 0;
    color: var(--guide-text-primary);
}

/* Table alignment */
.guide-content th[align="center"],
.guide-content td[align="center"] {
    text-align: center;
}

.guide-content th[align="right"],
.guide-content td[align="right"] {
    text-align: right;
}

/* ============================================
   Callout Boxes
   ============================================ */

.guide-content .note,
.guide-content .tip,
.guide-content .info-box {
    position: relative;
    margin: var(--guide-space-xl) 0;
    padding: var(--guide-space-lg) var(--guide-space-xl);
    background: var(--guide-accent-blue-dim);
    border: 1px solid rgba(92, 158, 255, 0.2);
    border-radius: 10px;
    color: var(--guide-text-secondary);
}

.guide-content .note::before,
.guide-content .tip::before {
    content: 'Note';
    display: block;
    font-size: var(--guide-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--guide-accent-blue);
    margin-bottom: var(--guide-space-sm);
}

.guide-content .tip::before {
    content: 'Tip';
}

.guide-content .warning {
    background: rgba(255, 180, 92, 0.1);
    border-color: rgba(255, 180, 92, 0.2);
}

.guide-content .warning::before {
    content: 'Warning';
    color: #ffb45c;
}

/* ============================================
   Empty & Loading States
   ============================================ */

.guides-empty,
.guides-loading {
    text-align: center;
    padding: var(--guide-space-4xl) var(--guide-space-xl);
    background: var(--guide-bg-secondary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 16px;
}

.guides-empty-icon {
    font-size: 56px;
    margin-bottom: var(--guide-space-lg);
    opacity: 0.3;
}

.guides-empty-text {
    font-size: var(--guide-text-base);
    color: var(--guide-text-tertiary);
}

.guides-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--guide-space-md);
    color: var(--guide-text-tertiary);
}

.guides-loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 2px solid var(--guide-border-subtle);
    border-top-color: var(--guide-accent-gold);
    border-radius: 50%;
    animation: guidesSpin 0.8s linear infinite;
}

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

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .guide-view-container {
        max-width: 100%;
        padding: var(--guide-space-md);
    }

    .guide-header {
        padding: var(--guide-space-xl);
    }

    .guide-content {
        padding: var(--guide-space-xl);
    }
}

@media (max-width: 768px) {
    .guide-card-thumbnail {
        width: 100px;
        min-width: 100px;
    }

    .guide-card-content {
        padding: var(--guide-space-sm) var(--guide-space-md);
    }

    .guide-card-category {
        font-size: 10px;
        padding: 2px 6px;
    }

    .guide-card-title {
        font-size: var(--guide-text-sm);
        line-height: 1.3;
    }

    .guide-card-excerpt {
        display: none;
    }

    .guide-card-meta {
        font-size: 10px;
    }

    .guide-card-author::before {
        width: 2px;
        height: 2px;
    }

    .guide-article {
        border-radius: 12px;
    }

    .guide-header {
        padding: var(--guide-space-md);
    }

    .guide-title {
        font-size: var(--guide-text-2xl);
    }

    .guide-content {
        padding: var(--guide-space-md);
        font-size: var(--guide-text-sm);
    }

    .guide-content h1 {
        font-size: var(--guide-text-xl);
        margin: 0 0 var(--guide-space-md);
    }

    .guide-content h2 {
        font-size: var(--guide-text-lg);
        margin: var(--guide-space-xl) 0 var(--guide-space-md);
    }

    .guide-content h3 {
        font-size: var(--guide-text-base);
        margin: var(--guide-space-lg) 0 var(--guide-space-sm);
    }

    .guide-content table {
        font-size: var(--guide-text-xs);
    }

    .guide-content th,
    .guide-content td {
        padding: var(--guide-space-sm) var(--guide-space-md);
    }

    .guide-content td img {
        max-height: 48px;
    }

    .guide-content .sea-fishing-king-grid {
        grid-template-columns: 1fr;
        gap: var(--guide-space-sm);
    }

    .guide-content .sea-fishing-king-card {
        padding: var(--guide-space-sm);
    }

    .guide-content .sea-fishing-fish-card {
        padding: 20px;
    }

    .guide-content .sea-fishing-fish-grid {
        grid-template-columns: 1fr;
    }

    .guide-content .sea-fishing-fish-card-visual {
        flex-basis: 84px;
        width: 84px;
    }
}

@media (max-width: 600px) {
    .guide-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .guide-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--guide-space-sm);
    }

    .guide-meta-item:not(:last-child)::after {
        display: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .guide-back {
        display: none;
    }

    .guide-article {
        background: white;
        border: none;
        box-shadow: none;
    }

    .guide-content {
        color: #333;
    }
}

.guide-content .warning {
    background: rgba(255, 180, 92, 0.1);
    border-color: rgba(255, 180, 92, 0.2);
}

.guide-content .warning::before {
    content: 'Warning';
    color: #ffb45c;
}

/* ============================================
   Empty & Loading States
   ============================================ */

.guides-empty,
.guides-loading {
    text-align: center;
    padding: var(--guide-space-4xl) var(--guide-space-xl);
    background: var(--guide-bg-secondary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 16px;
}

.guides-empty-icon {
    font-size: 56px;
    margin-bottom: var(--guide-space-lg);
    opacity: 0.3;
}

.guides-empty-text {
    font-size: var(--guide-text-base);
    color: var(--guide-text-tertiary);
}

.guides-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--guide-space-md);
    color: var(--guide-text-tertiary);
}

.guides-loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 2px solid var(--guide-border-subtle);
    border-top-color: var(--guide-accent-gold);
    border-radius: 50%;
    animation: guidesSpin 0.8s linear infinite;
}

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

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .guide-view-container {
        max-width: 100%;
        padding: var(--guide-space-md);
    }

    .guide-header {
        padding: var(--guide-space-xl);
    }

    .guide-content {
        padding: var(--guide-space-xl);
    }
}

@media (max-width: 768px) {
    .guide-card-thumbnail {
        width: 100px;
        min-width: 100px;
    }

    .guide-card-content {
        padding: var(--guide-space-sm) var(--guide-space-md);
    }

    .guide-card-category {
        font-size: 10px;
        padding: 2px 6px;
    }

    .guide-card-title {
        font-size: var(--guide-text-sm);
        line-height: 1.3;
    }

    .guide-card-excerpt {
        display: none;
    }

    .guide-card-meta {
        font-size: 10px;
    }

    .guide-card-author::before {
        width: 2px;
        height: 2px;
    }

    .guide-article {
        border-radius: 12px;
    }

    .guide-header {
        padding: var(--guide-space-md);
    }

    .guide-title {
        font-size: var(--guide-text-2xl);
    }

    .guide-content {
        padding: var(--guide-space-md);
        font-size: var(--guide-text-sm);
    }

    .guide-content h1 {
        font-size: var(--guide-text-xl);
        margin: 0 0 var(--guide-space-md);
    }

    .guide-content h2 {
        font-size: var(--guide-text-lg);
        margin: var(--guide-space-xl) 0 var(--guide-space-md);
    }

    .guide-content h3 {
        font-size: var(--guide-text-base);
        margin: var(--guide-space-lg) 0 var(--guide-space-sm);
    }

    .guide-content table {
        font-size: var(--guide-text-xs);
    }

    .guide-content th,
    .guide-content td {
        padding: var(--guide-space-sm) var(--guide-space-md);
    }

    .guide-content td img {
        max-height: 48px;
    }
}

@media (max-width: 600px) {
    .guide-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .guide-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--guide-space-sm);
    }

    .guide-meta-item:not(:last-child)::after {
        display: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .guide-back {
        display: none;
    }

    .guide-article {
        background: white;
        border: none;
        box-shadow: none;
    }

    .guide-content {
        color: #333;
    }

    .guide-content a {
        color: #333;
        text-decoration: underline;
    }
}

/* Books Guide Styles */
.shop-title {
    font-size: 1.5rem;
    color: var(--text-highlight);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shop-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.5rem;
    background: var(--guide-accent-gold);
    border-radius: 2px;
}

.books-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.book-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--guide-accent-gold);
    background: rgba(40, 40, 40, 0.8);
}

.book-row-1 {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.book-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--guide-border-subtle);
}

.book-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 56px;
}

.book-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-highlight);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.book-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.book-price::before {
    content: '¥';
    font-weight: normal;
    opacity: 0.8;
}

.book-row-2 {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-normal);
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.book-effect {
    color: var(--guide-text-secondary);
}

.book-value {
    font-weight: 700;
    color: var(--guide-accent-blue);
    font-size: 1.1em;
    align-self: flex-end;
}

/* Hide value if empty */
.book-value:empty {
    display: none;
}

.shop-divider {
    display: none;
    /* Grid layout doesn't need dividers as much, spacing handles it */
}

.custom-text-blue {
    color: #4facfe;
    /* Bright Blue for location unlock */
}

.custom-text-green {
    color: #43e97b;
    /* Bright Green for cash boost */
}

/* Book Guide Intro Styles */
.book-guide-intro {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.intro-section {
    gap: 1.5rem;
    align-items: center;
}

.intro-section img {
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border: 1px solid var(--guide-border-subtle);
    flex-shrink: 0;
}

.intro-section p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-normal);
    font-size: 0.95rem;
}

.intro-footer {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--guide-border-subtle);
    color: var(--text-highlight);
    font-weight: 500;
    text-align: center;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .intro-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .intro-section img {
        margin: 0 auto;
    }
}

/* ============================================
   Pagination
   ============================================ */

.guides-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--guide-space-sm);
    margin-top: var(--guide-space-2xl);
    padding-top: var(--guide-space-xl);
    border-top: 1px solid var(--guide-border-subtle);
}

.guides-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--guide-bg-secondary);
    border: 1px solid var(--guide-border-subtle);
    border-radius: 8px;
    color: var(--guide-text-secondary);
    font-size: var(--guide-text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--guide-transition-fast);
}

.guides-page-btn:hover:not(:disabled) {
    background: var(--guide-bg-tertiary);
    border-color: var(--guide-border-default);
    color: var(--guide-text-primary);
}

.guides-page-btn.active {
    background: var(--guide-accent-gold-dim);
    border-color: var(--guide-accent-gold);
    color: var(--guide-accent-gold);
    font-weight: 600;
    cursor: default;
}

.guides-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--guide-bg-primary);
}

.guides-page-nav svg {
    width: 16px;
    height: 16px;
}

.guides-page-dots {
    color: var(--guide-text-muted);
    font-weight: 600;
    padding: 0 var(--guide-space-xs);
    user-select: none;
}

/* Mobile horizontal padding compaction for guide pages */
@media (max-width: 768px) {
    .main-wrapper {
        width: calc(100% - 16px);
        padding-left: var(--guide-space-sm);
        padding-right: var(--guide-space-sm);
    }

    .guide-view-container {
        padding-left: var(--guide-space-sm);
        padding-right: var(--guide-space-sm);
    }

    .guide-header {
        padding-left: var(--guide-space-sm);
        padding-right: var(--guide-space-sm);
    }

    .guide-content {
        padding-left: var(--guide-space-sm);
        padding-right: var(--guide-space-sm);
    }

    .guide-content [id^="guide-article-content-autowrap-"] {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}
