/*
Theme Name: Shangwu Competition
Theme URI: https://demo.shangwudasai.cn/
Author: Shangwu Project
Description: 面向院校投稿、专家评审和赛事展示的定制主题。
Version: 0.1.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: shangwu-competition
*/

:root {
    --sw-bg: #f4f7fb;
    --sw-surface: #fbfdff;
    --sw-surface-muted: #e8eef7;
    --sw-text: #172238;
    --sw-muted: #5b687c;
    --sw-line: #d5dfec;
    --sw-accent: #1658c7;
    --sw-accent-dark: #0e4199;
    --sw-deep: #132f55;
    --sw-on-deep: #f1f6ff;
    --sw-radius-card: 18px;
    --sw-radius-control: 10px;
    --sw-shadow: 0 24px 70px rgba(24, 48, 84, .12);
    --sw-container: 1380px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --sw-bg: #101722;
        --sw-surface: #151f2d;
        --sw-surface-muted: #202d3f;
        --sw-text: #edf3fb;
        --sw-muted: #a9b6c8;
        --sw-line: #2d3b4f;
        --sw-accent: #76a8ff;
        --sw-accent-dark: #9bc0ff;
        --sw-deep: #0c1d35;
        --sw-on-deep: #f3f7fd;
        --sw-shadow: 0 24px 70px rgba(0, 0, 0, .28);
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--sw-text);
    background: var(--sw-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

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

.sw-container {
    width: min(calc(100% - 48px), var(--sw-container));
    margin-inline: auto;
}

.sw-site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid color-mix(in srgb, var(--sw-line) 86%, transparent);
    background: color-mix(in srgb, var(--sw-bg) 88%, transparent);
    backdrop-filter: blur(18px);
}

.admin-bar .sw-site-header {
    top: 32px;
}

.sw-header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 34px;
}

.sw-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--sw-text);
    font-size: 16px;
    font-weight: 760;
    text-decoration: none;
    white-space: nowrap;
}

.sw-brand-mark {
    width: 34px;
    height: 34px;
    position: relative;
    display: inline-block;
    border-radius: 9px;
    background: var(--sw-accent);
}

.sw-brand-mark::before,
.sw-brand-mark::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    height: 3px;
    border-radius: 3px;
    background: #f7fbff;
}

.sw-brand-mark::before {
    top: 10px;
}

.sw-brand-mark::after {
    bottom: 10px;
}

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

.sw-nav > a,
.sw-nav summary {
    color: var(--sw-muted);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
}

.sw-nav summary::-webkit-details-marker {
    display: none;
}

.sw-nav > a:hover,
.sw-nav > a:focus,
.sw-nav summary:hover,
.sw-nav summary:focus {
    color: var(--sw-accent);
}

.sw-mega {
    position: relative;
}

.sw-mega-panel {
    width: min(680px, calc(100vw - 48px));
    position: absolute;
    top: calc(100% + 22px);
    right: -190px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius-card);
    background: var(--sw-line);
    box-shadow: var(--sw-shadow);
}

.sw-mega:not([open]) .sw-mega-panel {
    display: none;
}

.sw-mega-section {
    padding: 28px;
    background: var(--sw-surface);
}

.sw-mega-section strong,
.sw-mega-section a,
.sw-mega-section small {
    display: block;
}

.sw-mega-section strong {
    margin-bottom: 16px;
    font-size: 13px;
}

.sw-mega-section a {
    margin: 11px 0;
    color: var(--sw-text);
    font-weight: 650;
    text-decoration: none;
}

.sw-mega-section a:hover,
.sw-mega-section a:focus {
    color: var(--sw-accent);
}

.sw-mega-section small {
    color: var(--sw-muted);
    font-size: 12px;
}

.sw-header-cta,
.sw-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 19px;
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius-control);
    color: var(--sw-text);
    background: var(--sw-surface);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.sw-header-cta,
.sw-button-primary {
    color: #f8fbff;
    border-color: #1658c7;
    background: #1658c7;
}

.sw-header-cta:hover,
.sw-header-cta:focus,
.sw-button-primary:hover,
.sw-button-primary:focus {
    color: #ffffff;
    background: #0e4199;
}

.sw-header-cta:focus-visible,
.sw-button:focus-visible,
.sw-nav a:focus-visible,
.sw-nav summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--sw-accent) 35%, transparent);
    outline-offset: 3px;
}

.sw-button:active,
.sw-header-cta:active {
    transform: translateY(1px);
}

.sw-mobile-nav {
    display: none;
    margin-left: auto;
}

.sw-mobile-nav summary {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius-control);
    background: var(--sw-surface);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.sw-mobile-links {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius-card);
    background: var(--sw-surface);
    box-shadow: var(--sw-shadow);
}

.sw-mobile-links a {
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
}

.sw-mobile-links a:hover,
.sw-mobile-links a:focus {
    color: var(--sw-accent);
    background: var(--sw-surface-muted);
}

.sw-hero {
    min-height: calc(100dvh - 73px);
    display: grid;
    grid-template-columns: minmax(0, .88fr) minmax(500px, 1.12fr);
    align-items: center;
    gap: clamp(38px, 6vw, 92px);
    padding-block: clamp(56px, 8vh, 92px);
}

.sw-eyebrow {
    margin: 0 0 18px;
    color: var(--sw-accent);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .12em;
}

.sw-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(42px, 5.2vw, 76px);
    font-weight: 760;
    letter-spacing: -.055em;
    line-height: 1.05;
}

.sw-hero-copy > p:not(.sw-eyebrow) {
    max-width: 580px;
    margin: 24px 0 0;
    color: var(--sw-muted);
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.75;
}

.sw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.sw-hero-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--sw-radius-card);
    background: var(--sw-surface-muted);
    box-shadow: var(--sw-shadow);
}

.sw-hero-media::before {
    content: "";
    display: block;
    padding-top: 68%;
}

.sw-hero-media img {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.16, 1, .3, 1);
}

.sw-hero-media:hover img {
    transform: scale(1.025);
}

.sw-section {
    padding-block: clamp(72px, 10vw, 136px);
}

.sw-section-muted {
    background: var(--sw-surface-muted);
}

.sw-section-deep {
    color: var(--sw-on-deep);
    background: var(--sw-deep);
}

.sw-section-header {
    max-width: 760px;
    margin-bottom: 42px;
}

.sw-section-header h2 {
    margin: 0;
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.12;
    letter-spacing: -.045em;
}

.sw-section-header p {
    max-width: 640px;
    margin: 18px 0 0;
    color: var(--sw-muted);
    font-size: 17px;
}

.sw-section-deep .sw-section-header p {
    color: #bdcde2;
}

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

.sw-competition {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius-card);
    background: var(--sw-surface);
}

.sw-competition h3 {
    margin: 0;
    font-size: 23px;
    line-height: 1.35;
}

.sw-competition p {
    margin: 12px 0 0;
    color: var(--sw-muted);
}

.sw-competition footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    color: var(--sw-muted);
    font-size: 13px;
}

.sw-empty-competitions {
    min-height: 260px;
    display: grid;
    place-items: center;
    padding: 38px;
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius-card);
    color: var(--sw-muted);
    background: var(--sw-surface);
    text-align: center;
}

.sw-process {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sw-process li {
    min-height: 220px;
    padding: 28px;
    border-left: 1px solid rgba(255, 255, 255, .18);
}

.sw-process li:last-child {
    border-right: 1px solid rgba(255, 255, 255, .18);
}

.sw-process strong,
.sw-process span {
    display: block;
}

.sw-process strong {
    margin-bottom: 46px;
    color: #9fc2ff;
    font-size: 13px;
}

.sw-process span {
    font-size: 21px;
    font-weight: 720;
}

.sw-process p {
    margin: 12px 0 0;
    color: #bdcde2;
    font-size: 14px;
}

.sw-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
    align-items: center;
    gap: clamp(38px, 7vw, 96px);
}

.sw-review-image {
    overflow: hidden;
    border-radius: var(--sw-radius-card);
    box-shadow: var(--sw-shadow);
}

.sw-review-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.16, 1, .3, 1);
}

.sw-review-image:hover img {
    transform: scale(1.025);
}

.sw-review-copy h2 {
    margin: 0;
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.12;
    letter-spacing: -.045em;
}

.sw-review-copy > p {
    margin: 20px 0 0;
    color: var(--sw-muted);
    font-size: 17px;
}

.sw-review-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.sw-review-points div {
    padding-top: 16px;
    border-top: 2px solid var(--sw-accent);
}

.sw-review-points strong,
.sw-review-points span {
    display: block;
}

.sw-review-points span {
    margin-top: 6px;
    color: var(--sw-muted);
    font-size: 13px;
}

.sw-role-layout {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
}

.sw-role-primary,
.sw-role-secondary > div {
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius-card);
    background: var(--sw-surface);
}

.sw-role-primary {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px;
}

.sw-role-secondary {
    display: grid;
    gap: 18px;
}

.sw-role-secondary > div {
    padding: 30px;
}

.sw-role-layout h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.sw-role-primary h3 {
    font-size: 36px;
}

.sw-role-layout p {
    margin: 0;
    color: var(--sw-muted);
}

.sw-role-link {
    margin-top: 26px;
    color: var(--sw-accent);
    font-weight: 720;
    text-decoration: none;
}

.sw-site-footer {
    padding-block: 46px;
    border-top: 1px solid var(--sw-line);
    background: var(--sw-surface);
}

.sw-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.sw-footer-inner p {
    margin: 0;
    color: var(--sw-muted);
    font-size: 13px;
}

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

.sw-footer-links a {
    color: var(--sw-muted);
    font-size: 13px;
    text-decoration: none;
}

.sw-footer-links a:hover,
.sw-footer-links a:focus {
    color: var(--sw-accent);
}

.sw-content {
    min-height: 60vh;
    padding-block: 72px;
}

@media (max-width: 1080px) {
    .sw-nav,
    .sw-header-cta {
        display: none;
    }

    .sw-mobile-nav {
        display: block;
    }

    .sw-hero {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .sw-hero-media {
        max-width: 860px;
    }

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

    .sw-process li:nth-child(2) {
        border-right: 1px solid rgba(255, 255, 255, .18);
    }

    .sw-review-layout,
    .sw-role-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .admin-bar .sw-site-header {
        top: 46px;
    }

    .sw-container {
        width: min(calc(100% - 32px), var(--sw-container));
    }

    .sw-header-inner {
        min-height: 66px;
    }

    .sw-mobile-links {
        top: 66px;
    }

    .sw-brand {
        font-size: 14px;
    }

    .sw-brand-mark {
        width: 30px;
        height: 30px;
    }

    .sw-hero {
        padding-block: 48px 68px;
    }

    .sw-hero h1 {
        font-size: clamp(38px, 12vw, 54px);
    }

    .sw-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .sw-button {
        width: 100%;
    }

    .sw-competition-list,
    .sw-process,
    .sw-review-points {
        grid-template-columns: 1fr;
    }

    .sw-process li,
    .sw-process li:nth-child(2),
    .sw-process li:last-child {
        min-height: auto;
        border-right: 1px solid rgba(255, 255, 255, .18);
        border-bottom: 1px solid rgba(255, 255, 255, .18);
    }

    .sw-process strong {
        margin-bottom: 24px;
    }

    .sw-role-primary {
        min-height: 340px;
        padding: 30px;
    }

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

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

    .sw-button,
    .sw-header-cta,
    .sw-hero-media img,
    .sw-review-image img {
        transition: none;
    }
}

