/* ==========================================================================
   粤创易 · 政府门户风格 — 基于 Layui 2.x
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --gov-navy: #1a2744;
    --gov-navy-deep: #0d1628;
    --gov-navy-light: #243356;
    --gov-gold: #c9a84c;
    --gov-gold-light: #e0c876;
    --gov-gold-dim: rgba(201, 168, 76, 0.12);
    --gov-red: #c0392b;
    --bg-page: #f0f2f5;
    --bg-card: #ffffff;
    --text-primary: #1a2744;
    --text-secondary: #5a6377;
    --text-muted: #8c93a2;
    --border-color: #e4e7ed;
    --font-display: 'Noto Serif SC', 'Songti SC', 'SimSun', Georgia, serif;
    --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    padding: 0;
}

/* ==========================================================================
   HERO SECTION — 顶部政务横幅
   ========================================================================== */
.gov-hero {
    position: relative;
    background: linear-gradient(135deg, var(--gov-navy-deep) 0%, var(--gov-navy) 40%, var(--gov-navy-light) 100%);
    padding: 80px 32px 100px;
    text-align: center;
    overflow: hidden;
}

/* Hero logout badge removed — now inside card */

/* Subtle geometric pattern */
.hero-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 60px,
            rgba(255,255,255,0.1) 60px,
            rgba(255,255,255,0.1) 61px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 60px,
            rgba(255,255,255,0.1) 60px,
            rgba(255,255,255,0.1) 61px
        );
}

/* Diagonal accent lines */
.hero-bg-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(115deg, transparent 40%, rgba(201,168,76,0.06) 40%, rgba(201,168,76,0.06) 40.5%, transparent 40.5%),
        linear-gradient(115deg, transparent 55%, rgba(201,168,76,0.04) 55%, rgba(201,168,76,0.04) 55.5%, transparent 55.5%);
}

/* Wave bottom */
.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-page);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    animation: heroFadeIn 1s ease-out both;
}

/* Emblem — 国徽风格的圆章 */
.gov-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gov-gold-dim);
    border: 2px solid rgba(201, 168, 76, 0.3);
    margin-bottom: 28px;
    box-shadow: 0 0 40px rgba(201, 168, 76, 0.08);
}

.emblem-char {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 900;
    color: var(--gov-gold);
    letter-spacing: 0.05em;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.2em;
}

/* ==========================================================================
   MAIN CONTENT — 主体内容
   ========================================================================== */
.gov-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* Section header */
.section-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeUp 0.6s ease-out 0.2s both;
}

.section-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.title-bar {
    display: inline-block;
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--gov-gold), var(--gov-gold-light));
    border-radius: 2px;
}

.section-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 10px;
    letter-spacing: 0.04em;
}

/* ==========================================================================
   SERVICE CARD — 核心服务入口
   ========================================================================== */
.service-section {
    animation: fadeUp 0.6s ease-out 0.3s both;
}

.service-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 12px rgba(26, 39, 68, 0.06);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 32px rgba(26, 39, 68, 0.12),
        0 0 0 1px var(--gov-gold);
}

.card-inner {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    padding: 36px 40px;
}

.card-icon-wrap {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gov-navy), var(--gov-navy-light));
    border-radius: 14px;
    color: var(--gov-gold);
    box-shadow: 0 4px 16px rgba(26, 39, 68, 0.2);
    transition: all 0.35s ease;
}

.service-card:hover .card-icon-wrap {
    box-shadow: 0 6px 24px rgba(26, 39, 68, 0.3), 0 0 20px rgba(201, 168, 76, 0.15);
}

.card-icon-wrap svg {
    width: 32px;
    height: 32px;
}

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

.card-heading {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.card-intro {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-tags .layui-badge {
    font-weight: 400;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    background: rgba(26, 39, 68, 0.06);
    color: var(--gov-navy);
}

.card-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 8px;
}

.card-action .layui-btn {
    background: linear-gradient(135deg, var(--gov-navy), var(--gov-navy-light));
    border: none;
    transition: all 0.35s ease;
}

.card-action .layui-btn:hover {
    background: linear-gradient(135deg, var(--gov-navy-light), var(--gov-navy));
    box-shadow: 0 4px 16px rgba(26, 39, 68, 0.25);
}

/* Card logout link (inside service card) */
.card-logout {
    display: flex;
    justify-content: center;
    padding: 0 40px 20px;
    border-top: 1px solid var(--border-color);
}

.btn-logout-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 4px;
    transition: all 0.25s ease;
}

.btn-logout-inline:hover {
    color: var(--gov-red);
    background: rgba(192, 57, 43, 0.04);
}

.btn-logout-inline .layui-icon {
    font-size: 13px;
}

/* ==========================================================================
   FOOTER — 底部
   ========================================================================== */
.gov-footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    text-align: center;
}

.footer-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color) 15%, var(--border-color) 85%, transparent);
    margin-bottom: 16px;
}

.footer-info {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.footer-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    opacity: 0.6;
}

.footer-admin-link:hover {
    color: var(--text-secondary);
    opacity: 1;
}

.footer-admin-link .layui-icon {
    font-size: 13px;
}

/* ==========================================================================
   LOGIN PAGE — 双栏登录布局
   ========================================================================== */
.login-page {
    display: flex;
    min-height: 100vh;
}

/* Left Brand Panel */
.login-brand {
    flex: 0 0 360px;
    background: linear-gradient(160deg, var(--gov-navy-deep) 0%, var(--gov-navy) 50%, var(--gov-navy-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(255,255,255,0.08) 50px,
            rgba(255,255,255,0.08) 51px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(255,255,255,0.08) 50px,
            rgba(255,255,255,0.08) 51px
        );
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px;
    animation: fadeUp 0.8s ease-out both;
}

.brand-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.1);
    border: 2px solid rgba(201, 168, 76, 0.25);
    margin-bottom: 24px;
    box-shadow: 0 0 50px rgba(201, 168, 76, 0.08);
}

.brand-emblem span {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 900;
    color: var(--gov-gold);
}

.brand-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.brand-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
    letter-spacing: 0.15em;
    margin-bottom: 24px;
}

.brand-divider {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--gov-gold), rgba(201, 168, 76, 0.2));
    margin: 0 auto 20px;
    border-radius: 1px;
}

.brand-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.12em;
}

/* Right Form Area */
.login-form-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--bg-page);
}

.login-form-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(26, 39, 68, 0.08);
    border: 1px solid var(--border-color);
    padding: 48px 44px;
    animation: fadeUp 0.6s ease-out 0.15s both;
}

.form-header {
    text-align: center;
    margin-bottom: 36px;
}

.form-header h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 300;
}

/* Form */
.login-form .form-item {
    margin-bottom: 24px;
}

.login-form .form-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.login-form .form-item input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.login-form .form-item input::placeholder {
    color: #b8bec7;
}

.login-form .form-item input:focus {
    border-color: var(--gov-navy);
    box-shadow: 0 0 0 3px rgba(26, 39, 68, 0.08);
}

.login-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gov-navy), var(--gov-navy-light));
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.login-btn:hover {
    box-shadow: 0 4px 16px rgba(26, 39, 68, 0.25);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

/* Error message */
.login-error {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(229, 57, 53, 0.06);
    border: 1px solid rgba(229, 57, 53, 0.15);
    border-radius: 8px;
    color: #c0392b;
    font-size: 13px;
    margin-bottom: 24px;
}

.login-error .layui-icon {
    font-size: 16px;
}

/* Footer link */
.form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-footer a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.form-footer a:hover {
    color: var(--text-secondary);
}

.form-footer .layui-icon {
    font-size: 14px;
    vertical-align: middle;
    margin-right: 2px;
}

/* ==========================================================================
   SIMPLE LOGIN — 简约登录（管理员）
   ========================================================================== */
.simple-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
}

.simple-login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(26, 39, 68, 0.08);
    border: 1px solid var(--border-color);
    padding: 40px 36px;
    text-align: center;
    animation: fadeUp 0.5s ease-out both;
}

.simple-login-card h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.simple-login-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ==========================================================================
   ADMIN — 管理后台
   ========================================================================== */
.admin-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    animation: fadeUp 0.4s ease-out both;
}

.admin-toolbar h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.06em;
}

.admin-toolbar h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--gov-gold), var(--gov-gold-light));
    border-radius: 2px;
    margin-right: 10px;
    vertical-align: middle;
}

.admin-toolbar .layui-btn-group .layui-btn {
    font-size: 13px;
}

/* Admin module cards */
.mod-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(26, 39, 68, 0.04);
    transition: all 0.3s ease;
    animation: fadeUp 0.5s ease-out both;
}

.mod-card:nth-child(1) { animation-delay: 0.1s; }
.mod-card:nth-child(2) { animation-delay: 0.2s; }
.mod-card:nth-child(3) { animation-delay: 0.3s; }

.mod-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(26, 39, 68, 0.1);
    border-color: var(--gov-gold);
}

.mod-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gov-navy), var(--gov-navy-light));
    color: var(--gov-gold);
    margin-bottom: 16px;
}

.mod-icon .layui-icon {
    font-size: 26px;
}

.mod-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}

.mod-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* Admin table overrides */
.admin-wrapper .layui-table {
    border-color: var(--border-color);
    box-shadow: 0 1px 6px rgba(26, 39, 68, 0.04);
}

.admin-wrapper .layui-table th {
    background: var(--bg-page);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.admin-wrapper .layui-table td {
    font-size: 13px;
    color: var(--text-primary);
}

.admin-wrapper .layui-table a {
    color: var(--gov-navy);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.admin-wrapper .layui-table a:hover {
    color: var(--gov-gold);
}

/* Admin form card */
.admin-form-card {
    max-width: 560px;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26, 39, 68, 0.06);
    border: 1px solid var(--border-color);
    animation: fadeUp 0.5s ease-out 0.1s both;
}

.admin-form-card .form-title {
    background: linear-gradient(135deg, var(--gov-navy), var(--gov-navy-light));
    padding: 18px 24px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.admin-form-card .layui-form {
    padding: 28px 24px;
}

.admin-form-card .layui-form-label {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Badges in admin */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge-admin {
    background: var(--gov-gold-dim);
    color: var(--gov-gold);
    border: 1px solid rgba(201, 168, 76, 0.25);
}

.role-badge-user {
    background: rgba(39, 174, 96, 0.08);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.status-badge {
    display: inline-block;
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .gov-hero { padding: 56px 20px 72px; }
    .hero-title { font-size: 26px; letter-spacing: 0.04em; }
    .hero-subtitle { font-size: 13px; letter-spacing: 0.12em; }
    .gov-emblem { width: 56px; height: 56px; margin-bottom: 20px; }
    .emblem-char { font-size: 24px; }

    .card-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 28px 24px;
    }

    .card-tags { justify-content: center; }
    .card-action { justify-content: center; }
    .user-info { flex-direction: column; gap: 12px; }

    .admin-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    /* Login page mobile */
    .login-page { flex-direction: column; }
    .login-brand { flex: none; padding: 48px 20px 36px; }
    .brand-content { padding: 0; }
    .brand-emblem { width: 56px; height: 56px; margin-bottom: 16px; }
    .brand-emblem span { font-size: 24px; }
    .brand-title { font-size: 22px; }
    .brand-divider { margin-bottom: 16px; }
    .brand-desc { display: none; }
    .login-form-area { padding: 0 16px 40px; }
    .login-form-card { padding: 32px 24px; }
}

/* ==========================================================================
   SAFARI FIXES
   ========================================================================== */
@supports (-webkit-backdrop-filter: none) {
    .login-form .form-item input {
        line-height: 44px;
    }
}

/* Fix Safari flex centering issues */
.login-form-area {
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

.login-form-card {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    will-change: transform;
}

/* ==========================================================================
   SCROLLBAR (Chrome/Safari)
   ========================================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cad3; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a6b0; }
