/* ==========================================================================
   LOAKPHP 官网 · 基础样式（浅色主题）
   ========================================================================== */

:root {
    --bg: #ffffff;
    --soft: #f6f8fc;
    --soft-2: #eef3fb;
    --ink: #0b1426;
    --muted: #566178;
    --dim: #667085;
    --line: #e6ebf4;
    --line-2: #d5deeb;
    --brand: #2f6bff;
    --brand-dark: #1f55d6;
    --brand-soft: #eef3ff;
    --violet: #7c3aed;
    --ok: #0f9d58;
    --warn: #b26a00;
    --danger: #d92d20;
    --code-bg: #0d1728;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow: 0 18px 40px -24px rgba(16, 24, 40, 0.24);
    --shadow-lg: 0 30px 70px -34px rgba(16, 24, 40, 0.3);
    --container: 1160px;
    --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Code",
        Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.nav-open {
    overflow: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.16s ease;
}

a:hover {
    color: var(--brand-dark);
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.015em;
    font-weight: 650;
    color: var(--ink);
}

p {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

code, pre, kbd {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.ico {
    width: 1.15em;
    height: 1.15em;
    flex: none;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--brand);
    color: #fff;
    padding: 10px 18px;
    border-radius: 0 0 10px 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: rgba(47, 107, 255, 0.18);
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 19px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease,
        border-color 0.16s ease, color 0.16s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #3f79ff 0%, #2f6bff 100%);
    border-color: #2f6bff;
    box-shadow: 0 10px 24px -12px rgba(47, 107, 255, 0.7);
}

.btn-primary:hover {
    color: #fff;
    background: linear-gradient(180deg, #2f6bff 0%, #1f55d6 100%);
    box-shadow: 0 14px 30px -12px rgba(47, 107, 255, 0.6);
}

.btn-ghost {
    color: var(--ink);
    background: #fff;
    border-color: var(--line-2);
    box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
    color: var(--brand-dark);
    border-color: #b9c9ea;
    background: #fbfcff;
}

.btn-soft {
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-color: #dbe5ff;
}

.btn-soft:hover {
    color: var(--brand-dark);
    background: #e3ebff;
}

.btn-lg {
    padding: 13px 24px;
    font-size: 15.5px;
    border-radius: 12px;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 9px;
}

.btn-block {
    width: 100%;
}

.btn .ico {
    width: 1em;
    height: 1em;
}

/* --------------------------------------------------------------------------
   头部
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.site-header.is-scrolled {
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 26px;
    height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    flex: none;
}

.brand:hover {
    color: var(--ink);
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: 0.03em;
}

.brand-text em {
    font-style: normal;
    font-size: 10.5px;
    letter-spacing: 0.1em;
    color: var(--dim);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.nav-link {
    position: relative;
    padding: 8px 11px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--ink);
    background: var(--soft);
}

.nav-link.is-active {
    color: var(--ink);
}

.nav-link.is-active::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.header-actions .btn {
    padding: 8px 15px;
    font-size: 13.5px;
}

.nav-mobile-actions,
.nav-toggle {
    display: none;
}

/* --------------------------------------------------------------------------
   通用区块
   -------------------------------------------------------------------------- */

.section {
    padding: 88px 0;
}

.section-tight {
    padding: 60px 0;
}

.section-soft {
    background: var(--soft);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    max-width: 720px;
    margin: 0 auto 50px;
    text-align: center;
}

.section-head.left {
    margin-left: 0;
    text-align: left;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    margin-bottom: 16px;
    border: 1px solid #dbe5ff;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}

.section-head h2 {
    font-size: clamp(26px, 3.2vw, 36px);
    margin-bottom: 14px;
}

.section-head p {
    color: var(--muted);
    font-size: 16.5px;
}

.lead {
    font-size: 16.5px;
    color: var(--muted);
    line-height: 1.78;
}

.hl {
    background: linear-gradient(96deg, #2f6bff 0%, #4f8cff 42%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.muted {
    color: var(--muted);
}

.dim {
    color: var(--dim);
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.nowrap {
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   卡片与网格
   -------------------------------------------------------------------------- */

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
    position: relative;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
    border-color: #cfdcf3;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.card-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border-radius: 12px;
    color: var(--brand);
    background: linear-gradient(150deg, #eef3ff, #f3f0ff);
    border: 1px solid #e2e9ff;
}

.card-icon .ico {
    width: 22px;
    height: 22px;
}

.card h3 {
    font-size: 17.5px;
    margin-bottom: 8px;
}

.card p {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.72;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #dbe5ff;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.tag-ok {
    border-color: #cdeedd;
    background: #ecfdf3;
    color: var(--ok);
}

.tag-muted {
    border-color: var(--line);
    background: var(--soft);
    color: var(--dim);
}

/* --------------------------------------------------------------------------
   代码块
   -------------------------------------------------------------------------- */

.codeblock {
    position: relative;
    border: 1px solid #1c2b45;
    border-radius: var(--radius);
    background: var(--code-bg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.codeblock-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.codeblock-title {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #8ba3c7;
    letter-spacing: 0.02em;
}

.codeblock-dots {
    display: flex;
    gap: 6px;
    margin-right: 4px;
}

.codeblock-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.codeblock pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
    color: #d7e4f7;
    line-height: 1.75;
    font-size: 13px;
    tab-size: 4;
}

.copy-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #9fb3d1;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.copy-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.copy-btn.is-done {
    color: #6ee7b7;
    border-color: rgba(110, 231, 183, 0.45);
}

.c-cmt { color: #6b83a8; }
.c-key { color: #c4a6ff; }
.c-str { color: #7ee0b8; }
.c-num { color: #ffc978; }
.c-fn  { color: #7cc4ff; }

/* --------------------------------------------------------------------------
   表格
   -------------------------------------------------------------------------- */

.table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 560px;
}

table.data th,
table.data td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.data th {
    color: var(--dim);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--soft);
}

table.data tr:last-child td {
    border-bottom: 0;
}

table.data tbody tr:hover td {
    background: #fbfcff;
}

table.data td {
    color: var(--muted);
}

table.data td strong {
    color: var(--ink);
    font-weight: 650;
}

table.data code {
    color: var(--brand-dark);
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    background: var(--soft);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr;
    gap: 34px;
    padding-top: 54px;
    padding-bottom: 42px;
}

.footer-brand .brand {
    margin-bottom: 14px;
}

.footer-desc {
    color: var(--muted);
    font-size: 13.5px;
    max-width: 280px;
    margin-bottom: 16px;
}

.footer-mail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--muted);
}

.footer-mail:hover {
    color: var(--brand);
}

.footer-col h3 {
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dim);
}

.footer-col ul {
    display: grid;
    gap: 9px;
}

.footer-col a {
    color: var(--muted);
    font-size: 13.8px;
}

.footer-col a:hover {
    color: var(--brand);
}

.footer-auth-text {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.footer-auth-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border: 1px solid #dbe5ff;
    border-radius: 8px;
    background: #fff;
    color: var(--brand-dark);
    font-family: var(--font-mono);
    font-size: 12.5px;
}

.footer-auth-link:hover {
    border-color: #b9c9ea;
    color: var(--brand-dark);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    padding-bottom: 26px;
    border-top: 1px solid var(--line);
    color: var(--dim);
    font-size: 13px;
    flex-wrap: wrap;
}

.footer-legal {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-legal a {
    color: var(--dim);
}

.footer-legal a:hover {
    color: var(--muted);
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 60;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    box-shadow: var(--shadow);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.back-to-top:hover {
    border-color: #aebbd0;
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.back-to-top .ico {
    width: 17px;
    height: 17px;
    transform: rotate(-90deg);
}

/* --------------------------------------------------------------------------
   滚动出现
   -------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .btn,
    .card {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .header-inner {
        gap: 14px;
    }

    .nav-link {
        padding: 8px 8px;
        font-size: 13.5px;
    }

    .header-actions .btn-ghost {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: 28px;
    }

    .footer-col-auth {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .section {
        padding: 64px 0;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-toggle {
        display: inline-grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid var(--line-2);
        background: #fff;
        color: var(--ink);
        cursor: pointer;
    }

    .nav-toggle .ico {
        width: 20px;
        height: 20px;
    }

    .nav-toggle .nav-toggle-close {
        display: none;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-open {
        display: none;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-close {
        display: block;
    }

    .header-actions .btn {
        display: none;
    }

    .site-nav {
        position: fixed;
        inset: 68px 0 auto 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: 14px 24px 22px;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 24px 48px -24px rgba(16, 24, 40, 0.25);
        max-height: calc(100vh - 68px);
        overflow-y: auto;
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-link {
        padding: 12px 10px;
        font-size: 15px;
        border-radius: 10px;
    }

    .nav-link.is-active::after {
        display: none;
    }

    .nav-link.is-active {
        background: var(--brand-soft);
        color: var(--brand-dark);
    }

    .nav-mobile-actions {
        display: grid;
        gap: 10px;
        margin-top: 12px;
        padding-top: 16px;
        border-top: 1px solid var(--line);
    }

    .nav-mobile-actions .btn {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 26px;
        padding-top: 42px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .container {
        padding: 0 18px;
    }

    .section {
        padding: 52px 0;
    }

    .section-head {
        margin-bottom: 34px;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 22px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .brand-text em {
        display: none;
    }
}
