* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at 10% 20%, #e3f2ff 0%, #d4ebff 25%, #f4f8ff 60%, #fdf6ff 100%);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0e1b2c;
}

a {
    color: inherit;
}

.site-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 18px 28px;
    background: linear-gradient(120deg, #1f6feb, #9333ea);
    color: #fff;
    box-shadow: 0 10px 30px rgba(18, 57, 119, 0.25);
    border-bottom: 6px solid rgba(255, 255, 255, 0.12);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: #0ea5e9;
    display: grid;
    place-items: center;
    font-size: 24px;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.45);
}

.logo-label {
    font-family: 'Baloo 2', cursive;
    font-size: 22px;
    margin: 0;
}

.logo-sub {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
}

.main-nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s, transform 0.2s;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.user-name {
    font-weight: 700;
}

.btn-ghost,
.btn-logout {
    text-decoration: none;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 10px 24px rgba(7, 89, 133, 0.12);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.16);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.btn-logout {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    border: 1px solid rgba(249, 115, 22, 0.45);
}

.btn-ghost:hover,
.btn-logout:hover {
    transform: translateY(-2px);
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-login {
    text-decoration: none;
    padding: 10px 14px;
    background: #0ea5e9;
    color: white;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.35);
}

/* 移动端 */
@media (max-width: 880px) {
    .site-header {
        grid-template-columns: 1fr;
        justify-items: stretch;
        align-items: start;
        gap: 16px;
        padding: 14px 18px 18px;
    }

    .logo-area {
        width: 100%;
        justify-content: space-between;
    }

    .main-nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-nav a {
        background: rgba(255, 255, 255, 0.14);
        padding: 9px 12px;
        flex: 1 1 30%;
        text-align: center;
    }

    .user-box {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .user-info {
        width: 100%;
        padding: 10px 12px;
        justify-content: space-between;
    }

    .user-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }

    .btn-login {
        flex: 1;
        text-align: center;
    }
}

/* Hero responsiveness */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .hero-visual {
        justify-self: start;
        text-align: left;
        max-width: none;
    }

    .hero-orb {
        margin-left: 0;
    }
}

.page-content {
    padding: 32px 24px 60px;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-card {
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0))
            , linear-gradient(135deg, #2563eb, #8b5cf6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 28px;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(10, 72, 141, 0.18);
    margin-bottom: 26px;
    position: relative;
    overflow: hidden;
}


.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    align-items: center;
}

.hero-copy {
    color: #f8fbff;
}

.hero-eyebrow {
    margin: 0 0 8px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.hero-title {
    font-family: 'Baloo 2', cursive;
    font-size: 36px;
    margin: 0 0 8px;
}

.hero-sub {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.hero-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #f8fafc;
    font-weight: 700;
    font-size: 13px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.hero-visual {
    justify-self: end;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
    max-width: 280px;
}

.hero-orb {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-left: auto;
    display: grid;
    place-items: center;
    font-size: 40px;
    background: radial-gradient(circle at 30% 30%, #fff 0%, #a5b4fc 40%, #4338ca 80%);
    box-shadow: 0 16px 40px rgba(67, 56, 202, 0.4);
}

.hero-note {
    margin-top: 10px;
    font-weight: 600;
    line-height: 1.5;
}

.article-list {
    display: grid;
    gap: 18px;
}

.article-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 20px;
    background: linear-gradient(160deg, #ffffff, #f8fbff);
    border-radius: 18px;
    border: 1px solid rgba(14, 165, 233, 0.12);
    box-shadow: 0 12px 24px rgba(7, 89, 133, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(7, 89, 133, 0.16);
}

.article-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(31, 111, 235, 0.18), rgba(14, 165, 233, 0.05));
    mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

.article-card > * {
    position: relative;
    z-index: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #e0f2fe;
    object-fit: cover;
    background: #e0f2fe;
}

.article-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
}

.article-title a {
    text-decoration: none;
    color: #0f172a;
}

.article-info {
    color: #475569;
    font-size: 14px;
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.article-summary {
    margin: 8px 0 0;
    color: #334155;
    line-height: 1.6;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #0ea5e914;
    border: 1px solid #bae6fd;
    color: #075985;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
}

.article-actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 10px 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(120deg, #1f6feb, #0ea5e9);
    color: white;
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.35);
}

.btn-ghost {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
}

.article-page {
    background: #fff;
    border-radius: 24px;
    padding: 26px;
    box-shadow: 0 16px 36px rgba(7, 89, 133, 0.16);
    border: 1px solid rgba(14, 165, 233, 0.12);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-page h2 {
    margin-top: 0;
    font-size: 32px;
}

.article-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.article-eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 800;
    color: #2563eb;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
    background: #eff6ff;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    width: fit-content;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
}

.back-link:hover {
    background: #dbeafe;
}

.article-cover {
    margin: 4px 0 2px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.article-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.article-body-card {
    background: linear-gradient(120deg, #f8fafc, #f1f5f9);
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 14px;
}

.article-body {
    line-height: 1.75;
    color: #1e293b;
    font-size: 17px;
    margin-top: 4px;
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(148, 163, 184, 0.18);
}

.form-card {
    background: #fff;
    padding: 22px;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(7, 89, 133, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.14);
}

label { font-weight: 700; }

input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 16px;
    margin-top: 6px;
    background: #f8fafc;
}

textarea { resize: vertical; }

footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    background: #0f172a;
    color: white;
    border-top: 4px solid #1f6feb;
}

.account-card {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    background: #f5f5f5;
}

.account-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    margin-bottom: 15px;
}

.btn-logout {
    display: inline-block;
    padding: 8px 16px;
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

.btn-logout:hover {
    opacity: 0.9;
}

/* ===== 首页文章列表：左边正方形缩略图 ===== */

.article-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
}

/* PC：三列布局 → [缩略图] [标题+摘要] [按钮] */
.article-card {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    column-gap: 18px;
    row-gap: 8px;
    align-items: flex-start;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(160deg, #ffffff, #f8fbff);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.article-card-no-thumb {
    grid-template-columns: 1fr auto;
}

/* 正方形缩略图容器 */
.article-thumb {
    grid-row: 1 / span 3;
    width: 110px;
    height: 110px;
    border-radius: 20px;
    overflow: hidden;
    background: #e5e7eb;
    display: block;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* 把 600×400 缩略图裁成正方形显示 */
    display: block;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.article-thumb:hover .thumb-img {
    transform: scale(1.04);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
}

/* 标题 + 作者 + 日期 */
.article-meta {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 摘要 */
.article-summary {
    grid-column: 2;
    grid-row: 2;
    margin: 6px 0 0;
    color: #4b5563;
    font-size: 0.95rem;
}

/* 按钮：PC 上放在最右边竖排 */
.article-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* 没有缩略图时：meta/summary 在左列，按钮在右列 */
.article-card-no-thumb .article-meta {
    grid-column: 1;
}

.article-card-no-thumb .article-summary {
    grid-column: 1;
}

.article-card-no-thumb .article-actions {
    grid-column: 2;
}

/* ===== 手机 / 平板：缩略图变小，整体更紧凑 ===== */

@media (max-width: 768px) {

    /* 手机：两列布局 → [小缩略图] [标题]，下面摘要+按钮占整行 */
    .article-card,
    .article-card-no-thumb {
        grid-template-columns: 80px 1fr;
        padding: 14px 14px;
        row-gap: 6px;
    }

    .article-card-no-thumb {
        grid-template-columns: 1fr;
    }

    .article-thumb {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 72px;
        height: 72px;
        border-radius: 16px;
        margin: 0;
    }

    .article-meta,
    .article-card-no-thumb .article-meta {
        grid-column: 2;
        grid-row: 1;
        align-items: flex-start;
    }

    /* 摘要铺满整行，放在第二行 */
    .article-summary,
    .article-card-no-thumb .article-summary {
        grid-column: 1 / span 2;
        grid-row: 2;
        margin-top: 4px;
        font-size: 0.9rem;
    }

    /* 按钮在第三行，横向排 */
    .article-actions,
    .article-card-no-thumb .article-actions {
        grid-column: 1 / span 2;
        grid-row: 3;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        margin-top: 4px;
    }

    /* 没有缩略图：头像和标题在第一列起始位置对齐 */
    .article-card-no-thumb .article-meta {
        grid-column: 1;
    }

    .article-card-no-thumb .article-summary {
        grid-column: 1;
    }

    .article-card-no-thumb .article-actions {
        grid-column: 1;
    }
}
