﻿:root {
    --portal-bg: #f4f1ea;
    --paper: #fffdfa;
    --paper-soft: #f9f6ef;
    --line: #e4dbca;
    --text: #2f271d;
    --text-soft: #76695b;
    --brown: #4f3b2a;
    --gold: #9a7a3e;
    --shadow: 0 10px 30px rgba(59, 43, 28, 0.08);
}

* {
    box-sizing: border-box;
}

body.portal-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fcfaf6 0%, var(--portal-bg) 100%);
    color: var(--text);
    font-family: "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif;
}

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

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

.portal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 253, 250, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(6px);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #65472f, #9a7a3e);
}

.brand-text strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text small {
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text {
    min-width: 0;
}

.portal-nav {
    display: flex;
    gap: 8px;
}

.portal-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--text-soft);
    transition: all 0.2s ease;
}

.portal-nav a:hover,
.portal-nav a.is-active {
    color: var(--brown);
    background: #efe7d9;
}

.admin-link {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--brown);
}

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

.header-user-menu {
    position: relative;
}

.header-user-menu summary {
    list-style: none;
    cursor: pointer;
}

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

.header-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 160px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffdf8;
    box-shadow: 0 10px 26px rgba(59, 43, 28, 0.12);
    display: grid;
    gap: 6px;
    z-index: 30;
}

.header-user-link,
.header-user-logout {
    width: 100%;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #eadfcf;
    background: #fff8ec;
    color: #5a4228;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.header-user-link:hover,
.header-user-logout:hover {
    background: #f4e8d5;
    border-color: #d9c4a0;
}

.portal-banner {
    padding: 38px 0 24px;
}

.banner-inner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(120deg, #f7f0e5, #fdf9f2);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 32px 38px;
    min-height: 218px;
}

.banner-content {
    max-width: 550px;
    position: relative;
    z-index: 1;
}

.banner-subtitle {
    color: var(--gold);
    margin: 0;
    letter-spacing: 0.12em;
    font-size: 15px;
}

.banner-inner h1 {
    margin: 7px 0 12px;
    font-size: clamp(32px, 3.7vw, 42px);
    letter-spacing: 0.03em;
}

.banner-inner p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.85;
}

.banner-ornament {
    position: absolute;
    right: 28px;
    top: 50%;
    width: 310px;
    height: 310px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.08;
    background:
        radial-gradient(circle at 35% 35%, rgba(154, 122, 62, 0.55), rgba(154, 122, 62, 0) 62%),
        url("/portal/images/logo/logo-hou.png") center / 62% no-repeat,
        repeating-linear-gradient(
            -18deg,
            rgba(120, 92, 56, 0.16) 0 2px,
            rgba(120, 92, 56, 0) 2px 13px
        );
    filter: saturate(82%);
    border-radius: 50%;
}

.portal-main {
    flex: 1 0 auto;
    padding: 16px 0 56px;
}

.portal-header,
.portal-footer {
    flex-shrink: 0;
}

.portal-breadcrumb {
    margin: 0 0 12px;
}

.portal-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: #7a6a58;
    font-size: 13px;
}

.portal-breadcrumb a {
    color: #654a2f;
}

.portal-breadcrumb .sep {
    color: #b39e82;
}

.portal-sidecard {
    border: 1px solid #e2d7c4;
    border-radius: 14px;
    background: #fffdf8;
    padding: 14px;
    position: sticky;
    top: 88px;
    height: fit-content;
}

.portal-sidecard h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.portal-sidecard ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.portal-sidecard a {
    color: #5b4429;
}

.module-block,
.detail-card,
.portal-card,
.article-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.module-block {
    padding: 24px;
    margin-bottom: 22px;
}

.module-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.module-head h2 {
    margin: 0;
    font-size: 24px;
}

.module-head a {
    color: var(--gold);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.portal-card {
    padding: 16px;
}

.portal-card h3 {
    margin: 8px 0;
}

.portal-card p {
    color: var(--text-soft);
}

.tag {
    display: inline-block;
    font-size: 12px;
    color: var(--gold);
    background: #f4e9d1;
    border-radius: 999px;
    padding: 3px 10px;
}

.detail-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--brown);
    font-weight: 600;
}

.cover-placeholder {
    height: 180px;
    border-radius: 12px;
    border: 1px dashed #cabda7;
    background: repeating-linear-gradient(45deg, #f8f3eb, #f8f3eb 10px, #f2eadf 10px, #f2eadf 20px);
    display: grid;
    place-items: center;
    color: var(--text-soft);
    margin: 12px 0;
}

.cover-placeholder.small {
    height: 120px;
}

.portal-footer {
    position: relative;
    overflow: hidden;
    border-top: 0;
    background:
        radial-gradient(circle at 18% 118%, rgba(157, 126, 78, 0.05) 0%, rgba(157, 126, 78, 0.02) 42%, rgba(157, 126, 78, 0) 72%),
        radial-gradient(circle at 78% -26%, rgba(172, 142, 94, 0.035) 0%, rgba(172, 142, 94, 0) 66%),
        linear-gradient(180deg, #f8f4ec 0%, #f3ede2 100%);
}

.portal-footer::before {
    content: "";
    position: absolute;
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: 76px;
    height: 76px;
    background: url("/portal/images/logo/logo-hou.png") center / contain no-repeat;
    opacity: 0.055;
    filter: grayscale(22%) sepia(18%) saturate(56%) brightness(1.18) contrast(0.9);
    pointer-events: none;
    z-index: 0;
}

.portal-footer::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(204, 182, 142, 0.22), rgba(196, 166, 112, 0.55), rgba(204, 182, 142, 0.22));
    z-index: 1;
}

.footer-inner {
    position: relative;
    z-index: 1;
    padding: 11px 0 10px;
}

.footer-inner-simple {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    text-align: right;
    gap: 3px;
}

.footer-line {
    margin: 0;
    color: color-mix(in srgb, var(--text-soft) 86%, #ffffff 14%);
    line-height: 1.3;
}

.footer-title {
    color: color-mix(in srgb, var(--brown) 82%, #ffffff 18%);
    font-size: 16px;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.footer-slogan {
    font-size: 12px;
    letter-spacing: 0.05em;
}

.footer-copyright {
    font-size: 12px;
    color: #9a8c7a;
}

.portal-success,
.portal-error {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.portal-success {
    color: #1f5d39;
    background: #e9f8ee;
    border: 1px solid #bfe6cb;
}

.portal-error {
    color: #8f3028;
    background: #fdecea;
    border: 1px solid #f0c2be;
}

.status-chip {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    line-height: 1.6;
    border: 1px solid transparent;
}

.status-chip.status-pending {
    color: #8f6a2e;
    background: #fff5de;
    border-color: #edd39a;
}

.status-chip.status-approved {
    color: #2a6b41;
    background: #e7f7ed;
    border-color: #b8dfc6;
}

.status-chip.status-rejected {
    color: #8c322b;
    background: #fdeceb;
    border-color: #efc4c1;
}

@media (max-width: 900px) {
    .header-inner {
        min-height: auto;
        flex-wrap: wrap;
        padding: 14px 0;
    }

    .portal-nav {
        width: 100%;
        overflow: auto;
        padding-bottom: 4px;
    }

    .banner-inner {
        padding: 24px;
    }

    .banner-ornament {
        width: 220px;
        height: 220px;
        right: -12px;
        opacity: 0.06;
    }

    .footer-inner {
        padding: 9px 0 8px;
    }

    .footer-inner-simple {
        align-items: flex-end;
        text-align: right;
    }

    .portal-footer::before {
        left: 6%;
        top: 50%;
        transform: translateY(-50%);
        width: 58px;
        height: 58px;
        opacity: 0.048;
    }

    .portal-sidecard {
        position: static;
        top: auto;
    }
}
