:root {
    --bg: #f4f7f2;
    --bg-soft: #eef3ec;
    --panel: #ffffff;
    --panel-2: #f8fbf7;
    --panel-solid: #ffffff;
    --line: rgba(31, 74, 53, 0.10);
    --line-strong: rgba(31, 74, 53, 0.18);
    --text: #22312a;
    --text-soft: #4d5f55;
    --muted: #66756b;
    --accent: #3f8f68;
    --accent-2: #2f7452;
    --accent-3: #8fbfa4;
    --pink: #c98f68;
    --green: #3f8f68;
    --amber: #b8862b;
    --danger: #c1555a;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 12px 32px rgba(29, 66, 47, 0.10);
    --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60% 45% at 15% -5%, rgba(63, 143, 104, 0.08), transparent 60%),
        radial-gradient(55% 42% at 88% 2%, rgba(143, 191, 164, 0.14), transparent 62%),
        radial-gradient(45% 40% at 55% 105%, rgba(63, 143, 104, 0.04), transparent 70%);
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(31, 74, 53, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 74, 53, 0.035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 30%, transparent 100%);
    pointer-events: none;
}

::selection {
    background: rgba(63, 143, 104, 0.22);
    color: #163027;
}

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

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

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

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

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

.container-narrow {
    width: min(880px, calc(100% - 40px));
    margin: 0 auto;
}

.main {
    padding: 38px 0 90px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------- Header ---------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(247, 250, 245, 0.86);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #55a67d 0%, #2f7452 100%);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(47, 116, 82, 0.22);
    position: relative;
    overflow: hidden;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.16);
}

.brand-mark svg {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 5px;
}

.brand-text b {
    font-size: 17px;
    letter-spacing: 0.16em;
}

.brand-text small {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.32em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border-radius: 10px;
    color: var(--text-soft);
    font-size: 14px;
    transition: 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: rgba(31, 74, 53, 0.088);
}

.nav-link .icon {
    color: var(--accent);
    opacity: 0.85;
}

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

.nav-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-soft);
    transition: 0.18s ease;
}

.nav-icon-btn:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--panel-2);
}

.nav-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: linear-gradient(135deg, #4a9c72, #2f7452);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 8px rgba(47, 116, 82, 0.3);
}

.user-menu {
    position: relative;
}

.user-menu summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px 5px 5px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    transition: 0.18s ease;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-menu summary:hover {
    border-color: var(--line-strong);
    background: var(--panel-2);
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #3f8f68, #2f7452);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar.lg {
    width: 68px;
    height: 68px;
    font-size: 26px;
}

.avatar.sm {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.user-menu .u-name {
    font-size: 13px;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 186px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    display: none;
    z-index: 70;
}

.user-menu[open] .user-dropdown {
    display: block;
    animation: dropIn 0.16s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border-radius: 9px;
    border: 0;
    background: none;
    color: var(--text-soft);
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--panel-2);
    color: var(--text);
}

.menu-toggle {
    display: none;
}

.mobile-drawer {
    display: none;
    border-top: 1px solid var(--line);
    background: rgba(247, 250, 245, 0.98);
    padding: 14px 20px 20px;
}

.mobile-drawer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    color: var(--text-soft);
    border-radius: 10px;
}

.mobile-drawer a:hover {
    background: var(--panel-2);
    color: var(--text);
}

.mobile-drawer.open {
    display: block;
}

/* ---------------- Buttons / badges ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.18s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(120deg, #4a9c72, #2f7452 65%, #55a67d);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(47, 116, 82, 0.18);
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 14px 40px rgba(47, 116, 82, 0.28);
}

.btn-ghost {
    background: var(--panel);
    border-color: var(--line);
    color: var(--text-soft);
}

.btn-ghost:hover {
    border-color: var(--line-strong);
    color: var(--text);
    background: var(--panel-2);
}

.btn-soft {
    background: rgba(63, 143, 104, 0.1);
    border-color: rgba(63, 143, 104, 0.22);
    color: var(--accent);
}

.btn-soft:hover {
    background: rgba(63, 143, 104, 0.16);
}

.btn-danger {
    background: rgba(193, 85, 90, 0.12);
    border-color: rgba(193, 85, 90, 0.28);
    color: #a8443f;
}

.btn-danger:hover {
    background: rgba(193, 85, 90, 0.2);
}

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

.btn-lg {
    padding: 13px 26px;
    font-size: 15px;
    border-radius: 13px;
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-soft);
    background: var(--panel);
    border: 1px solid var(--line);
}

.badge-accent {
    color: var(--accent);
    background: rgba(63, 143, 104, 0.09);
    border-color: rgba(63, 143, 104, 0.22);
}

.badge-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

/* ---------------- Hero ---------------- */
.hero {
    position: relative;
    padding: 66px 0 48px;
    text-align: center;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    width: 620px;
    height: 620px;
    left: 50%;
    top: -300px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: conic-gradient(from 180deg, rgba(63, 143, 104, 0.16), rgba(143, 191, 164, 0.20), rgba(63, 143, 104, 0.10), rgba(63, 143, 104, 0.16));
    filter: blur(90px);
    opacity: 0.55;
    pointer-events: none;
}

.hero-inner {
    position: relative;
}

.hero-badge {
    margin-bottom: 22px;
}

.hero h1 {
    font-size: clamp(36px, 5.4vw, 64px);
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin: 0 auto 20px;
    max-width: 900px;
    font-weight: 750;
}

.hero h1 .grad {
    background: linear-gradient(110deg, #2f7452 5%, #3f8f68 52%, #5ea984 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    max-width: 620px;
    margin: 0 auto 34px;
    color: var(--text-soft);
    font-size: 16px;
}

.hero-search {
    max-width: 640px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 7px 7px 18px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(31, 74, 53, 0.08);
    text-align: left;
}

.hero-search .icon {
    color: var(--accent);
    flex-shrink: 0;
}

.hero-search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    padding: 9px 4px;
    font-size: 15px;
}

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

.hero-chips {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.hero-chips a {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text-soft);
    transition: 0.18s ease;
}

.hero-chips a:hover {
    color: var(--accent);
    border-color: rgba(63, 143, 104, 0.3);
    background: rgba(63, 143, 104, 0.06);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: clamp(22px, 6vw, 70px);
    margin-top: 48px;
    flex-wrap: wrap;
}

.hero-stat b {
    display: block;
    font-size: 26px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.hero-stat span {
    font-size: 12.5px;
    color: var(--muted);
    letter-spacing: 0.08em;
}

.announcement {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 30px;
    max-width: 760px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(63, 143, 104, 0.18);
    background: linear-gradient(90deg, rgba(63, 143, 104, 0.07), rgba(47, 116, 82, 0.07));
    color: var(--text-soft);
    font-size: 13px;
    text-align: left;
}

.announcement .icon {
    color: var(--accent);
}

/* ---------------- Sections ---------------- */
.section {
    padding: 42px 0;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.section-eyebrow {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-eyebrow::before {
    content: "";
    width: 18px;
    height: 1px;
    background: var(--accent);
    opacity: 0.7;
}

.section-title {
    font-size: clamp(22px, 3vw, 30px);
}

.section-desc {
    color: var(--muted);
    font-size: 13.5px;
    margin-top: 8px;
    max-width: 560px;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 13.5px;
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid var(--line);
    transition: 0.18s ease;
    flex-shrink: 0;
}

.section-link:hover {
    color: var(--accent);
    border-color: rgba(63, 143, 104, 0.3);
}

/* ---------------- Cards ---------------- */
.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: 0.22s ease;
}

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

.tool-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    min-height: 156px;
    gap: 12px;
}

.tool-card::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -55px;
    top: -60px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--tool-glow, rgba(63, 143, 104, 0.18)), transparent 68%);
    opacity: 0.85;
    transition: 0.25s ease;
    pointer-events: none;
}

.tool-card:hover::after {
    opacity: 1;
    transform: scale(1.15);
}

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 19px;
    background: color-mix(in srgb, var(--tool-color, #3f8f68) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--tool-color, #3f8f68) 32%, transparent);
    color: var(--tool-color, #3f8f68);
    box-shadow: 0 0 22px color-mix(in srgb, var(--tool-color, #3f8f68) 14%, transparent);
    flex-shrink: 0;
    font-weight: 600;
}

.tool-card h3 {
    font-size: 15.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-card .tagline {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--muted);
    font-size: 11.5px;
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    transition: 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cat-card:hover {
    border-color: var(--line-strong);
    background: var(--panel-2);
    transform: translateY(-2px);
}

.cat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 19px;
    background: color-mix(in srgb, var(--cat-color, #3f8f68) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--cat-color, #3f8f68) 26%, transparent);
    color: var(--cat-color, #3f8f68);
    flex-shrink: 0;
}

.cat-card b {
    font-size: 14.5px;
    display: block;
}

.cat-card small {
    color: var(--muted);
    font-size: 12px;
}

.cat-card .cat-arrow {
    margin-left: auto;
    color: var(--muted);
    transition: 0.2s ease;
}

.cat-card:hover .cat-arrow {
    color: var(--accent);
    transform: translateX(2px);
}

/* Work cards */
.work-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.work-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #121a2b, #0a0f1a);
    overflow: hidden;
}

.work-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s ease;
}

.work-card:hover .work-cover img {
    transform: scale(1.04);
}

.work-cover-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(80% 80% at 20% 10%, rgba(63, 143, 104, 0.26), transparent 70%),
        radial-gradient(70% 70% at 85% 90%, rgba(47, 116, 82, 0.3), transparent 70%),
        linear-gradient(140deg, #0d1524, #070b13);
}

.work-cover-fallback::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(31, 74, 53, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 74, 53, 0.08) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at 50% 50%, #000, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 85%);
}

.work-cover-fallback span {
    position: relative;
    font-size: 40px;
    font-weight: 750;
    letter-spacing: 0.06em;
    background: linear-gradient(110deg, #3f8f68, #5ea984, #8fbfa4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    opacity: 0.92;
}

.work-body {
    padding: 17px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.work-title {
    font-size: 16.5px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-excerpt {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.work-author {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
}

.work-foot .stats {
    margin-left: auto;
    display: inline-flex;
    gap: 12px;
    align-items: center;
}

.work-foot .stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---------------- Tool page ---------------- */
.page-head {
    padding: 34px 0 26px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12.5px;
    margin-bottom: 16px;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.page-title {
    font-size: clamp(26px, 4vw, 40px);
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-desc {
    color: var(--muted);
    margin-top: 12px;
    max-width: 680px;
    font-size: 14px;
}

.tool-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tool-hero .tool-icon {
    width: 64px;
    height: 64px;
    font-size: 27px;
    border-radius: 17px;
}

.tool-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}

.tool-stage {
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(31, 74, 53, 0.072), rgba(31, 74, 53, 0.024));
    position: relative;
    overflow: hidden;
}

.tool-stage::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--tool-glow, rgba(63, 143, 104, 0.12)), transparent 70%);
    pointer-events: none;
}

.stage-title {
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-card {
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
}

.side-card h3 {
    font-size: 14px;
    margin-bottom: 14px;
    color: var(--text-soft);
}

.side-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-tool {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    transition: 0.18s ease;
}

.side-tool:hover {
    background: rgba(31, 74, 53, 0.08);
}

.side-tool .tool-icon {
    width: 34px;
    height: 34px;
    font-size: 15px;
    border-radius: 10px;
}

.side-tool b {
    font-size: 13px;
    display: block;
}

.side-tool small {
    color: var(--muted);
    font-size: 11.5px;
}

.tool-facts {
    display: flex;
    flex-direction: column;
    gap: 11px;
    font-size: 13px;
}

.tool-facts .row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
}

.tool-facts .row b {
    color: var(--text-soft);
    font-weight: 550;
}

/* ---------------- Forms ---------------- */
.form-card {
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}

.field:last-child {
    margin-bottom: 0;
}

.field > label,
.field-label {
    font-size: 12.5px;
    color: var(--text-soft);
    letter-spacing: 0.02em;
}

.field .hint {
    font-size: 11.5px;
    color: var(--muted);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    outline: 0;
    transition: 0.18s ease;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--muted);
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: rgba(63, 143, 104, 0.55);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(63, 143, 104, 0.08);
}

.textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.7;
}

.textarea.mono,
.input.mono {
    font-family: var(--mono);
    font-size: 13px;
}

.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    font-size: 13px;
    padding: 9px 0;
    cursor: pointer;
}

.checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-2);
}

.form-errors {
    padding: 12px 16px;
    border-radius: 11px;
    background: rgba(193, 85, 90, 0.09);
    border: 1px solid rgba(193, 85, 90, 0.25);
    color: #a8443f;
    font-size: 13px;
    margin-bottom: 18px;
}

.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.form-errors li {
    margin: 2px 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.auth-wrap {
    min-height: calc(100vh - 70px);
    display: grid;
    place-items: center;
    padding: 40px 20px 70px;
}

.auth-card {
    width: min(430px, 100%);
    padding: 32px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: #ffffff;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: -140px;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    height: 260px;
    background: radial-gradient(circle, rgba(47, 116, 82, 0.22), transparent 70%);
    pointer-events: none;
}

.auth-head {
    text-align: center;
    margin-bottom: 26px;
    position: relative;
}

.auth-head h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

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

.auth-switch {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--accent);
}

/* ---------------- Comments ---------------- */
.comments {
    margin-top: 28px;
}

.comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.comment-list {
    display: flex;
    flex-direction: column;
}

.comment {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.comment:first-child {
    border-top: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-top {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.comment-top b {
    font-size: 13px;
}

.comment-top .time {
    color: var(--muted);
    font-size: 11.5px;
}

.comment-text {
    color: var(--text-soft);
    font-size: 13.5px;
    white-space: pre-line;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: 14px;
    margin-top: 7px;
    font-size: 12px;
    color: var(--muted);
}

.comment-actions button,
.comment-actions a {
    background: none;
    border: 0;
    padding: 0;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.comment-actions button:hover,
.comment-actions a:hover {
    color: var(--accent);
}

.comment-replies {
    margin-top: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-replies .comment {
    border-top: 0;
    padding: 8px 0;
}

.reply-form {
    margin-top: 8px;
    display: none;
}

.reply-form.open {
    display: block;
}

.reply-form .textarea {
    min-height: 70px;
    font-size: 13px;
}

.comment-form {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(31, 74, 53, 0.048);
    margin-bottom: 10px;
}

.comment-login {
    padding: 16px;
    border-radius: 14px;
    border: 1px dashed var(--line-strong);
    color: var(--muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------------- Messages ---------------- */
.msg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-item {
    display: flex;
    gap: 13px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    transition: 0.18s ease;
    position: relative;
}

.msg-item:hover {
    border-color: var(--line-strong);
    background: var(--panel-2);
}

.msg-item.unread {
    border-color: rgba(63, 143, 104, 0.22);
    background: linear-gradient(90deg, rgba(63, 143, 104, 0.055), rgba(31, 74, 53, 0.032));
}

.msg-item.unread::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 2px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.msg-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(63, 143, 104, 0.08);
    border: 1px solid rgba(63, 143, 104, 0.16);
    color: var(--accent);
    flex-shrink: 0;
}

.msg-body b {
    font-size: 13.5px;
    display: block;
    margin-bottom: 3px;
}

.msg-body p {
    color: var(--muted);
    font-size: 12.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.msg-time {
    margin-left: auto;
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
}

/* ---------------- Profile / works ---------------- */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(120deg, rgba(63, 143, 104, 0.06), rgba(47, 116, 82, 0.05));
    flex-wrap: wrap;
}

.profile-info h1 {
    font-size: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-handle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.profile-bio {
    color: var(--text-soft);
    font-size: 13.5px;
    margin-top: 10px;
    max-width: 620px;
}

.profile-stats {
    display: flex;
    gap: 28px;
    margin-top: 18px;
}

.profile-stats b {
    font-size: 19px;
}

.profile-stats span {
    color: var(--muted);
    font-size: 12px;
    margin-left: 5px;
}

.profile-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 6px;
    margin: 26px 0 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
    overflow-x: auto;
}

.tab {
    padding: 9px 15px;
    border-radius: 9px 9px 0 0;
    color: var(--muted);
    font-size: 13.5px;
    white-space: nowrap;
}

.tab.active {
    color: var(--text);
    background: rgba(31, 74, 53, 0.08);
    border-bottom: 2px solid var(--accent);
}

/* ---------------- Filter bar ---------------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.chips {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.chip {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-soft);
    font-size: 12.5px;
    transition: 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.chip.active {
    color: var(--accent);
    border-color: rgba(63, 143, 104, 0.32);
    background: rgba(63, 143, 104, 0.09);
}

.filter-search {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-search .input {
    width: 200px;
    padding: 8px 12px;
    font-size: 13px;
}

/* ---------------- AI chat ---------------- */
.ai-shell {
    display: flex;
    flex-direction: column;
    height: min(62vh, 620px);
    min-height: 380px;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 6px 4px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(31, 74, 53, 0.22) transparent;
}

.ai-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
}

.ai-msg.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.ai-msg .bubble {
    padding: 12px 15px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(31, 74, 53, 0.08);
    font-size: 13.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-msg.user .bubble {
    background: linear-gradient(120deg, rgba(63, 143, 104, 0.16), rgba(47, 116, 82, 0.16));
    border-color: rgba(63, 143, 104, 0.26);
}

.ai-msg .who {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 13px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--accent);
    flex-shrink: 0;
}

.ai-compose {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.ai-compose .textarea {
    min-height: 48px;
    max-height: 140px;
    padding: 12px 14px;
}

.ai-hint {
    color: var(--muted);
    font-size: 11.5px;
    margin-top: 8px;
}

.ai-empty {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    font-size: 13px;
}

.ai-empty span {
    display: block;
    font-size: 34px;
    margin-bottom: 12px;
    background: linear-gradient(120deg, #3f8f68, #2f7452);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ai-typing::after {
    content: "···";
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ---------------- Tool widgets ---------------- */
.tool-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.result-box {
    margin-top: 16px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(31, 74, 53, 0.048);
    font-family: var(--mono);
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 50px;
    color: var(--text-soft);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-box {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(31, 74, 53, 0.048);
    text-align: center;
}

.stat-box b {
    display: block;
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    line-height: 1.2;
}

.stat-box span {
    color: var(--muted);
    font-size: 11.5px;
}

.qr-wrap {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    padding: 20px;
    background: rgba(31, 74, 53, 0.064);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.qr-wrap canvas,
.qr-wrap img {
    border-radius: 10px;
}

.range-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}

.range-val {
    min-width: 48px;
    text-align: right;
    font-family: var(--mono);
    color: var(--accent);
    font-size: 13px;
}

.dropzone {
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    padding: 26px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: 0.18s ease;
    background: rgba(31, 74, 53, 0.032);
}

.dropzone:hover,
.dropzone.drag {
    border-color: rgba(63, 143, 104, 0.4);
    background: rgba(63, 143, 104, 0.05);
    color: var(--text-soft);
}

.dropzone b {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
}

.preview-img {
    max-height: 220px;
    margin: 14px auto 0;
    border-radius: 10px;
    border: 1px solid var(--line);
}

/* ---------------- Pager ---------------- */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    font-size: 13px;
}

.pager a,
.pager span.pager-btn {
    padding: 8px 15px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-soft);
    transition: 0.18s ease;
}

.pager a:hover {
    border-color: rgba(63, 143, 104, 0.3);
    color: var(--accent);
}

.pager .disabled {
    opacity: 0.45;
}

.pager-info {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ---------------- Empty / footer / toast ---------------- */
.empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: rgba(31, 74, 53, 0.024);
}

.empty b {
    display: block;
    color: var(--text-soft);
    font-size: 16px;
    margin-bottom: 6px;
}

.empty .big {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.empty p {
    font-size: 13px;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 44px 0 34px;
    color: var(--muted);
    font-size: 12.5px;
    background: rgba(31, 74, 53, 0.024);
}

.footer-grid {
    display: flex;
    gap: 40px;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: flex-start;
}

.footer-brand p {
    max-width: 320px;
    margin-top: 12px;
    font-size: 12.5px;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

.footer-col b {
    display: block;
    color: var(--text-soft);
    font-size: 12.5px;
    margin-bottom: 12px;
    letter-spacing: 0.06em;
}

.footer-col a {
    display: block;
    padding: 4px 0;
    transition: 0.16s ease;
}

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

.footer-bottom {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%) translateY(20px);
    z-index: 100;
    padding: 12px 20px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(14px);
    color: var(--text);
    font-size: 13px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: 0.25s ease;
    pointer-events: none;
    max-width: calc(100% - 40px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: rgba(63, 143, 104, 0.35);
}

.toast.error {
    border-color: rgba(193, 85, 90, 0.35);
}

/* ---------------- Article ---------------- */
.article-card {
    padding: clamp(20px, 4vw, 42px);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(31, 74, 53, 0.067), rgba(31, 74, 53, 0.019));
}

.article-head h1 {
    font-size: clamp(25px, 4vw, 38px);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 18px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.article-cover {
    margin: 24px 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.article-content {
    margin-top: 24px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.95;
    white-space: pre-line;
    word-break: break-word;
}

.article-tags {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.like-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 34px 0 10px;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--panel);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 13.5px;
    transition: 0.18s ease;
}

.like-btn:hover {
    border-color: rgba(201, 143, 104, 0.4);
    color: #a8443f;
}

.like-btn.liked {
    background: rgba(201, 143, 104, 0.12);
    border-color: rgba(201, 143, 104, 0.35);
    color: #a8443f;
}

.like-btn.liked svg {
    fill: currentColor;
}

/* ---------------- Detail list (admin-ish shared) ---------------- */
.table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
}

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

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

table.data th {
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.04em;
    background: rgba(31, 74, 53, 0.04);
    white-space: nowrap;
}

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

table.data tr:hover td {
    background: rgba(31, 74, 53, 0.032);
}

table.data .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    border: 1px solid var(--line);
}

.status-pill.on,
.status-pill.published,
.status-pill.active {
    color: #2f7452;
    background: rgba(63, 143, 104, 0.09);
    border-color: rgba(63, 143, 104, 0.25);
}

.status-pill.off,
.status-pill.banned {
    color: #a8443f;
    background: rgba(193, 85, 90, 0.08);
    border-color: rgba(193, 85, 90, 0.22);
}

.status-pill.pending {
    color: #8a6516;
    background: rgba(184, 134, 43, 0.10);
    border-color: rgba(184, 134, 43, 0.26);
}

.status-pill.rejected {
    color: #a8443f;
}

@media (max-width: 1020px) {
    .grid-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tool-layout { grid-template-columns: minmax(0, 1fr); }
    .nav-links { display: none; }
    .menu-toggle { display: inline-flex; }
}

@media (max-width: 860px) {
    .grid-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: 1fr; }
    .filter-search { margin-left: 0; width: 100%; }
    .filter-search .input { width: 100%; }
}

@media (max-width: 640px) {
    .container, .container-narrow { width: calc(100% - 28px); }
    .nav-inner { height: 62px; gap: 12px; }
    .brand-text small { display: none; }
    .nav-actions .btn { display: none; }
    .grid-tools, .grid-works, .grid-cats { grid-template-columns: 1fr; }
    .hero { padding: 44px 0 34px; }
    .hero-stats { gap: 26px; margin-top: 34px; }
    .section { padding: 30px 0; }
    .section-head { align-items: flex-start; flex-direction: column; gap: 12px; }
    .page-head { padding-top: 24px; }
    .tool-grid-2 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-actions { margin-left: 0; }
    .msg-time { display: none; }
    .auth-card { padding: 24px; }
    .ai-shell { height: 65vh; }
    .article-content { font-size: 14px; }
}
