/* ========================================
   梦未一言 - 子页面样式（浅色主题）
   ======================================== */

.page-content {
    padding: 32px 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* --- 玻璃卡片容器 --- */
.glass-box {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition), box-shadow var(--transition);
}

.glass-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 105, 180, 0.1);
}

/* --- 标题 --- */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '#';
    color: var(--pink);
    font-weight: 700;
}

/* --- 正文 --- */
.page-text {
    font-family: var(--font-dk);
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.page-text a {
    color: var(--pink);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.page-text a:hover {
    border-bottom-color: var(--pink);
}

/* --- 友链卡片 --- */
.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 105, 180, 0.15);
    border-radius: 10px;
    margin-bottom: 12px;
    transition: all var(--transition);
    text-decoration: none;
}

.link-card:hover {
    background: rgba(255, 105, 180, 0.06);
    border-color: rgba(255, 105, 180, 0.35);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.1);
}

.link-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 105, 180, 0.3);
}

.link-info {
    overflow: hidden;
}

.link-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.link-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.links-intro {
    margin-bottom: 20px;
    text-align: center;
}

.link-empty {
    padding: 24px 0 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.links-requirement-note {
    margin-top: 12px;
}

/* --- 友链申请 --- */
.link-apply-box {
    position: relative;
    z-index: 3;
}

.apply-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.apply-heading .section-title {
    margin-bottom: 4px;
}

.apply-heading p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.apply-status {
    flex: 0 0 auto;
    padding: 4px 9px;
    color: #28705f;
    background: #eaf7f3;
    border: 1px solid #c4e6db;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.apply-message {
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 7px;
    font-size: 0.86rem;
}

.apply-message-success {
    color: #216b50;
    background: #edf8f3;
    border-color: #b9dfcf;
}

.apply-message-error {
    color: #9b3445;
    background: #fff2f4;
    border-color: #efc1c9;
}

.link-apply-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.apply-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.apply-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.apply-field > span {
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
}

.apply-field input,
.apply-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(98, 108, 120, 0.24);
    border-radius: 7px;
    outline: none;
    font: inherit;
    font-size: 0.88rem;
    letter-spacing: 0;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.apply-field textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.6;
}

.apply-field input:focus,
.apply-field textarea:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.12);
}

.apply-field input::placeholder,
.apply-field textarea::placeholder {
    color: #a0a4aa;
}

.apply-avatar-row {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0;
    align-items: end;
}

.apply-avatar-preview {
    width: 54px;
    height: 54px;
    margin-left: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(98, 108, 120, 0.2);
    border-radius: 7px;
}

.apply-avatar-preview[hidden] {
    display: none;
}

.apply-avatar-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.apply-turnstile {
    width: 100%;
    min-height: 65px;
    display: flex;
    align-items: center;
}

.apply-turnstile .cf-turnstile {
    width: 100%;
}

.apply-geetest {
    width: 100%;
    min-height: 42px;
}

.apply-geetest > [data-geetest-captcha] {
    width: 100%;
    min-height: 42px;
}

.apply-verification-message {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.apply-verification-message.is-error {
    color: #9b3445;
}

.apply-submit {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

.apply-submit button {
    min-height: 42px;
    padding: 0 18px;
    color: #fff;
    background: var(--pink-dark);
    border: 1px solid var(--pink-dark);
    border-radius: 7px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.apply-submit button:hover {
    background: #c94787;
    border-color: #c94787;
    box-shadow: 0 5px 14px rgba(201, 71, 135, 0.2);
}

.apply-submit button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    box-shadow: none;
}

.apply-submit button:focus-visible {
    outline: 3px solid rgba(255, 105, 180, 0.25);
    outline-offset: 2px;
}

.apply-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- 分割线 --- */
.divider {
    height: 2px;
    background: none;
    border: none;
    border-top: 2px dotted var(--pink);
    margin: 28px 0;
}

/* --- 代码/JSON 展示 --- */
.code-block {
    background: rgba(255, 240, 245, 0.8);
    border: 1px solid rgba(255, 105, 180, 0.15);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #555;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --- 参数表格 --- */
.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.param-table th,
.param-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 105, 180, 0.1);
}

.param-table th {
    color: var(--pink-dark);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-table td {
    color: var(--text-secondary);
}

.param-table code {
    background: rgba(255, 105, 180, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--pink-dark);
}

/* --- 列表 --- */
.page-list {
    list-style: none;
    padding: 0;
}

.page-list li {
    padding: 6px 0;
    padding-left: 16px;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.page-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--pink);
}

/* --- 图片 --- */
.page-img {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 12px;
    border: 1px solid rgba(255, 105, 180, 0.15);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

/* --- 响应式 --- */
@media (max-width: 600px) {
    .page-content {
        padding: 20px 14px;
    }

    .glass-box {
        padding: 18px 16px;
    }

    .apply-heading {
        align-items: flex-start;
    }

    .apply-form-grid {
        grid-template-columns: 1fr;
    }

    .apply-avatar-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .apply-submit button {
        width: 100%;
    }
}

/* --- 图片画廊 --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-content.gallery-content {
    max-width: 1380px;
    padding: 28px 24px 44px;
}

.gallery-page {
    width: 100%;
}

.gallery-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.gallery-heading h2 {
    margin: 2px 0 0;
    font-family: var(--font-kat);
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 0;
}

.gallery-eyebrow {
    margin: 0;
    color: var(--pink-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
}

.gallery-count {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.gallery-count strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.gallery-toolbar {
    position: sticky;
    top: calc(var(--topbar-height) + 10px);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 54px;
    padding: 7px 9px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(45, 35, 42, 0.07);
}

.gallery-filters {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
    background: rgba(235, 230, 234, 0.62);
    border-radius: 7px;
}

.gallery-filters a {
    min-width: 76px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    color: var(--text-secondary);
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 600;
}

.gallery-filters a:hover,
.gallery-filters a.active {
    color: var(--pink-dark);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(45, 35, 42, 0.08);
}

.gallery-status {
    padding-right: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.gallery-grid {
    column-count: 4;
    column-gap: 14px;
}

.gallery-item {
    width: 100%;
    display: inline-block;
    margin: 0 0 14px;
    break-inside: avoid;
    vertical-align: top;
}

.gallery-item-button {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
    padding: 0;
    color: #fff;
    background: rgba(35, 35, 40, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    cursor: zoom-in;
    box-shadow: 0 5px 16px rgba(35, 30, 34, 0.1);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.gallery-item[data-form="level"] .gallery-item-button {
    aspect-ratio: 16 / 9;
}

.gallery-item[data-form="vertical"] .gallery-item-button {
    aspect-ratio: 9 / 16;
}

.gallery-item-button:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 105, 180, 0.62);
    box-shadow: 0 9px 24px rgba(79, 49, 65, 0.18);
}

.gallery-item-button:focus-visible {
    outline: 3px solid rgba(255, 105, 180, 0.35);
    outline-offset: 2px;
}

.gallery-item-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.gallery-item.is-loaded .gallery-item-button img {
    opacity: 1;
}

.gallery-item-button:hover img {
    transform: scale(1.015);
}

.gallery-item-meta {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 8px;
    color: #fff;
    background: linear-gradient(to top, rgba(18, 18, 22, 0.78), transparent);
    font-size: 0.74rem;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity var(--transition), transform var(--transition);
}

.gallery-item-button:hover .gallery-item-meta,
.gallery-item-button:focus-visible .gallery-item-meta {
    opacity: 1;
    transform: translateY(0);
}

.gallery-image-error {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
}

.gallery-image-error .fa {
    font-size: 1.25rem;
}

.gallery-item.is-error .gallery-image-error {
    display: flex;
}

.gallery-item.is-error .gallery-item-button {
    cursor: default;
}

.gallery-load-row {
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.gallery-load-button {
    min-width: 132px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 7px;
    box-shadow: 0 5px 16px rgba(45, 35, 42, 0.08);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.gallery-load-button:hover {
    color: var(--pink-dark);
    border-color: rgba(255, 105, 180, 0.38);
}

.gallery-load-button:disabled {
    cursor: wait;
}

.gallery-empty {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: var(--text-muted);
}

.gallery-empty[hidden],
.gallery-load-button[hidden] {
    display: none;
}

.gallery-empty .fa {
    font-size: 2rem;
}

.gallery-viewer {
    position: fixed;
    inset: 0;
    width: min(1180px, calc(100vw - 32px));
    height: min(90vh, 860px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    color: #fff;
    background: rgba(20, 20, 24, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.gallery-viewer::backdrop {
    background: rgba(20, 16, 19, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gallery-viewer-close,
.gallery-viewer-nav {
    position: absolute;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(25, 25, 29, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
}

.gallery-viewer-close {
    top: 14px;
    right: 14px;
}

.gallery-viewer-nav {
    top: 50%;
    transform: translateY(-50%);
}

.gallery-viewer-prev { left: 14px; }
.gallery-viewer-next { right: 14px; }

.gallery-viewer-nav:disabled {
    opacity: 0.28;
    cursor: default;
}

.gallery-viewer-stage {
    position: absolute;
    inset: 0 0 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 68px;
}

.gallery-viewer-stage img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.gallery-viewer-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.74);
    background: rgba(12, 12, 15, 0.72);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
}

.gallery-viewer-footer a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
}

@media (max-width: 1120px) {
    .gallery-grid { column-count: 3; }
}

@media (max-width: 760px) {
    .page-content.gallery-content {
        padding: 20px 12px 36px;
    }

    .gallery-grid {
        column-count: 2;
        column-gap: 10px;
    }

    .gallery-item { margin-bottom: 10px; }
    .gallery-status { display: none; }
    .gallery-toolbar { top: calc(var(--topbar-height) + 6px); }
    .gallery-filters { width: 100%; }
    .gallery-filters a { min-width: 0; padding: 0 8px; }
    .gallery-item-meta { opacity: 1; transform: none; }

    .gallery-viewer {
        width: calc(100vw - 16px);
        height: calc(100dvh - 20px);
    }

    .gallery-viewer-stage { padding: 58px 10px 16px; }
    .gallery-viewer-nav { top: auto; bottom: 68px; }
    .gallery-viewer-prev { left: 12px; }
    .gallery-viewer-next { right: 12px; }
}

@media (max-width: 420px) {
    .gallery-heading { align-items: center; }
    .gallery-heading h2 { font-size: 1.5rem; }
    .gallery-eyebrow { font-size: 0.65rem; }
    .gallery-count { font-size: 0.74rem; }
    .gallery-filters a { gap: 4px; font-size: 0.78rem; }
    .gallery-viewer-footer { padding: 10px 12px; }
}
