/* =============================================================================
   玩家攻略系统 - 共享样式
   主题: 深色 #0B0E14 + 金色 #D4AF37
   ============================================================================= */

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

:root {
    --bg: #0B0E14;
    --bg-soft: #131722;
    --bg-card: #1E293B;
    --gold: #D4AF37;
    --gold-bright: #F4D03F;
    --text: #F1F5F9;
    --text-dim: #94A3B8;
    --text-faint: #64748B;
    --border: rgba(212, 175, 55, 0.2);
    --border-strong: rgba(212, 175, 55, 0.5);
    --accent: #3B82F6;
    --success: #10B981;
    --warn: #F59E0B;
    --danger: #EF4444;
}

html, body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ===== Header ===== */
.pg-header {
    background: linear-gradient(135deg, rgba(11, 14, 20, 0.95), rgba(19, 23, 34, 0.95));
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.pg-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.pg-logo {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--gold-bright), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.pg-nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}
.pg-nav a {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dim);
    transition: all 0.2s;
    border: 1px solid transparent;
}
.pg-nav a:hover {
    color: var(--text);
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--border);
}
.pg-nav a.active {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--border-strong);
}
.pg-back-home {
    color: var(--text-dim);
    font-size: 13px;
    padding: 6px 10px;
}

/* 语言切换器 (放 nav 末尾) */
.pg-lang-switch {
    display: flex;
    gap: 0;
    margin-left: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.pg-lang-item {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-dim);
    background: transparent;
    border-right: 1px solid var(--border);
    transition: all 0.2s;
}
.pg-lang-item:last-child { border-right: none; }
.pg-lang-item:hover {
    color: var(--text);
    background: rgba(212, 175, 55, 0.08);
}
.pg-lang-item.active {
    background: var(--gold);
    color: #1a1a1a;
    font-weight: 600;
}

/* ===== Container ===== */
.pg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== Hero (主页头部大横幅) ===== */
.pg-hero {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(59, 130, 246, 0.05));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.pg-hero::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15), transparent 70%);
    pointer-events: none;
}
.pg-hero h1 {
    font-size: 28px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.pg-hero p {
    color: var(--text-dim);
    font-size: 15px;
    max-width: 680px;
}
.pg-hero-cta {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    background: var(--bg-card);
    color: var(--text);
    text-decoration: none;
    font-family: inherit;
    user-select: none;
}
.pg-btn:hover { transform: translateY(-1px); }
.pg-btn:active { transform: translateY(0); }
.pg-btn.primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: #1a1a1a;
    font-weight: 600;
}
.pg-btn.primary:hover { box-shadow: 0 6px 16px rgba(212, 175, 55, 0.35); }
.pg-btn.outline {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--gold);
}
.pg-btn.outline:hover { background: rgba(212, 175, 55, 0.1); }
.pg-btn.ghost {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border);
}
.pg-btn.ghost:hover { color: var(--text); border-color: var(--border-strong); }
.pg-btn.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.35);
}
.pg-btn.danger:hover { background: rgba(239, 68, 68, 0.25); }
.pg-btn.small { padding: 6px 12px; font-size: 13px; }
.pg-btn.large { padding: 14px 28px; font-size: 16px; }
.pg-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== Filter bar ===== */
.pg-filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.pg-filter-label {
    color: var(--text-faint);
    font-size: 13px;
    margin-right: 4px;
}
.pg-chip {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.pg-chip:hover { color: var(--text); border-color: var(--border-strong); }
.pg-chip.active {
    background: var(--gold);
    color: #1a1a1a;
    border-color: var(--gold);
    font-weight: 600;
}

/* ===== Card grid (列表) ===== */
.pg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.pg-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.pg-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}
.pg-card-cover {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(59, 130, 246, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 48px;
    overflow: hidden;
}
.pg-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pg-card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.pg-card-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.pg-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
}
.pg-tag.pin { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; }
.pg-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pg-card-summary {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    flex: 1;
}
.pg-card-meta {
    display: flex;
    gap: 12px;
    color: var(--text-faint);
    font-size: 12px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.pg-card-meta span { display: inline-flex; gap: 3px; align-items: center; }

/* ===== Empty / Loading ===== */
.pg-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-faint);
    background: var(--bg-soft);
    border: 1px dashed var(--border);
    border-radius: 12px;
}
.pg-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.pg-empty-text { font-size: 14px; }
.pg-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    font-size: 14px;
}

/* ===== Pagination ===== */
.pg-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pg-pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}
.pg-pagination button:hover:not(:disabled) {
    color: var(--gold);
    border-color: var(--border-strong);
}
.pg-pagination button.active {
    background: var(--gold);
    color: #1a1a1a;
    border-color: var(--gold);
    font-weight: 600;
}
.pg-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Form ===== */
.pg-input, .pg-textarea, .pg-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}
.pg-input:focus, .pg-textarea:focus, .pg-select:focus {
    outline: none;
    border-color: var(--gold);
}
.pg-textarea { resize: vertical; min-height: 80px; }
.pg-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-dim);
    font-size: 13px;
}
.pg-form-row { margin-bottom: 16px; }
.pg-hint {
    color: var(--text-faint);
    font-size: 12px;
    margin-top: 4px;
}

/* ===== Modal ===== */
.pg-modal-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
}
.pg-modal-mask.open { display: flex; }
.pg-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}
.pg-modal h3 {
    margin-bottom: 16px;
    color: var(--gold);
    font-size: 18px;
}
.pg-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
}
.pg-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ===== Toast ===== */
.pg-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: pgToastIn 0.25s ease;
}
.pg-toast.success { background: var(--success); }
.pg-toast.error { background: var(--danger); }
.pg-toast.info { background: var(--accent); }
@keyframes pgToastIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Detail page ===== */
.pg-detail-head {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
}
.pg-detail-head h1 {
    font-size: 26px;
    margin: 10px 0 12px;
    color: var(--text);
}
.pg-detail-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    color: var(--text-dim);
    font-size: 13px;
}
.pg-detail-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.pg-detail-summary {
    margin-top: 16px;
    padding: 14px 18px;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
}
.pg-item-meta-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
}
.pg-item-meta-block h3 {
    color: var(--gold);
    margin-bottom: 12px;
    font-size: 16px;
}
.pg-item-meta-grid {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px 16px;
    font-size: 14px;
}
.pg-item-meta-grid .k { color: var(--text-faint); }
.pg-item-meta-grid .v { color: var(--text); }

.pg-steps-toc {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.pg-steps-toc h3 {
    color: var(--gold);
    font-size: 15px;
    margin-bottom: 10px;
}
.pg-steps-toc ol {
    margin-left: 18px;
    color: var(--text-dim);
}
.pg-steps-toc li {
    padding: 4px 0;
    font-size: 14px;
}
.pg-steps-toc a:hover { color: var(--gold); }

.pg-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 16px;
    scroll-margin-top: 80px;
}
.pg-step-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.pg-step-num {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: #1a1a1a;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pg-step-title { font-size: 18px; font-weight: 600; }
.pg-step-content { color: var(--text); font-size: 14px; line-height: 1.7; }
.pg-step-content p { margin-bottom: 12px; }
.pg-step-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    border: 1px solid var(--border);
    display: block;
}
.pg-step-content h3, .pg-step-content h4 {
    margin: 16px 0 8px;
    color: var(--gold);
}
.pg-step-content blockquote {
    border-left: 3px solid var(--gold);
    padding-left: 12px;
    color: var(--text-dim);
    margin: 12px 0;
}
.pg-step-content ul, .pg-step-content ol {
    margin: 8px 0 8px 22px;
}

/* ===== Tip wall ===== */
.pg-tip-wall {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.pg-tip-wall h3 {
    color: var(--gold);
    font-size: 16px;
    margin-bottom: 12px;
}
.pg-tip-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.pg-tip-item:last-child { border-bottom: none; }
.pg-tip-item .amount {
    color: var(--gold);
    font-weight: 600;
}

/* ===== Comments ===== */
.pg-comments {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.pg-comments h3 {
    color: var(--gold);
    margin-bottom: 14px;
}
.pg-comment-form {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.pg-comment-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.pg-comment-item:last-child { border-bottom: none; }
.pg-comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
}
.pg-comment-author {
    color: var(--gold);
    font-weight: 500;
}
.pg-comment-time {
    color: var(--text-faint);
    font-size: 12px;
}
.pg-comment-pinned {
    color: var(--warn);
    font-size: 12px;
}
.pg-comment-body {
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.pg-comment-ops {
    margin-top: 6px;
    display: flex;
    gap: 8px;
}
.pg-comment-ops button {
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    padding: 2px 4px;
}
.pg-comment-ops button:hover { color: var(--gold); }

/* ===== Editor 专用 ===== */
.pg-editor-step {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.pg-editor-step-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.pg-editor-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gold);
    color: #1a1a1a;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.pg-editor-image-toolbar {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}
.pg-uploaded-img-preview {
    display: inline-block;
    width: 80px;
    height: 80px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin: 4px;
    position: relative;
}
.pg-uploaded-img-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Status badge (my.php) ===== */
.pg-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

/* ===== GM 打赏徽章 (浮在卡片封面右下角) ===== */
.pg-gm-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #D4AF37, #F4D03F);
    color: #1a1a1a;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    z-index: 2;
}
.pg-gm-banner {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(244, 208, 63, 0.08));
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--gold);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pg-gm-banner .icon { font-size: 28px; }
.pg-gm-banner .text { flex: 1; }
.pg-gm-banner .text .title { color: var(--gold); font-weight: 700; font-size: 16px; }
.pg-gm-banner .text .sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }

@media (max-width: 768px) {
    .pg-hero { padding: 24px 20px; }
    .pg-hero h1 { font-size: 22px; }
    .pg-container { padding: 16px; }
    .pg-detail-head { padding: 20px; }
    .pg-step { padding: 16px; }
    .pg-grid { grid-template-columns: 1fr; }
    .pg-nav { width: 100%; }
}
