* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f2f5fa;
    --border: #d9e0ea;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #15803d;
    --success-hover: #166534;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --secondary: #64748b;
    --info-soft: #dbeafe;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #ffffff, var(--bg) 55%);
    color: var(--text);
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

h1,
h2,
h4,
h5,
h6,
p {
    margin-top: 0;
}

.container,
.container-fluid {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.container-fluid {
    width: calc(100% - 2rem);
}

.container {
    margin-top: 30px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.row > [class*="col-"] {
    width: 100%;
    padding: 0 0.75rem;
}

.justify-content-center,
.justify-content-md-center {
    justify-content: center;
}

.justify-content-end,
.text-end {
    justify-content: flex-end;
    text-align: right;
}

.align-items-center {
    align-items: center;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.d-grid {
    display: grid;
}

.gap-2 {
    gap: 0.75rem;
}

.h-100 {
    height: 100%;
}

.w-100 {
    width: 100%;
}

.mt-auto {
    margin-top: auto;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.my-4 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.my-5 {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.p-0 {
    padding: 0;
}

.p-4 {
    padding: 1.5rem;
}

.p-5 {
    padding: 2rem;
}

.pt-3 {
    padding-top: 1rem;
}

.px-4 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.text-center {
    text-align: center;
}

.text-start {
    text-align: left;
}

.text-white {
    color: #fff;
}

.text-muted {
    color: var(--muted);
}

.text-danger {
    color: var(--danger);
}

.small,
small {
    font-size: 0.875rem;
}

.lead {
    font-size: 1.125rem;
}

.bg-white {
    background: rgba(255, 255, 255, 0.9);
}

.bg-light {
    background: var(--surface-soft);
}

.bg-secondary {
    background: var(--secondary);
}

.bg-success {
    background: #dcfce7;
}

.border-bottom {
    border-bottom: 1px solid var(--border);
}

.border-top {
    border-top: 1px solid var(--border);
}

.border-danger {
    border: 1px solid rgba(185, 28, 28, 0.35);
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
}

.navbar > .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.navbar-brand:hover {
    text-decoration: none;
}

.navbar-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
}

.navbar-toggler-icon,
.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform 0.2s ease;
    content: "";
}

.navbar-toggler-icon {
    position: relative;
}

.navbar-toggler-icon::before {
    position: absolute;
    top: -6px;
}

.navbar-toggler-icon::after {
    position: absolute;
    top: 6px;
}

.navbar-collapse {
    display: none;
    width: 100%;
}

.navbar-collapse.is-open {
    display: block;
    margin-top: 1rem;
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ms-auto {
    margin-left: auto;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: var(--text);
    font-weight: 500;
}

.card {
    overflow: hidden;
    border: 1px solid rgba(217, 224, 234, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
}

.card-img-top {
    width: 100%;
}

.card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

.card-body,
.card-header {
    padding: 1.25rem;
}

.card-header {
    border-bottom: 1px solid var(--border);
}

.card-title {
    margin-bottom: 0.75rem;
}

.card-text {
    margin-bottom: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 42px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-outline-secondary {
    border-color: var(--border);
    background: #fff;
    color: var(--text);
}

.btn-sm {
    min-height: 36px;
    padding: 0.55rem 0.8rem;
    border-radius: 10px;
    font-size: 0.92rem;
}

.btn-lg {
    min-height: 50px;
    padding: 0.9rem 1.25rem;
}

.alert {
    position: relative;
    margin-bottom: 1rem;
    padding: 1rem 2.75rem 1rem 1rem;
    border: 1px solid transparent;
    border-radius: 14px;
}

.alert-info {
    border-color: #93c5fd;
    background: var(--info-soft);
}

.alert-danger {
    border-color: #fca5a5;
    background: var(--danger-soft);
}

.btn-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.btn-close::before,
.btn-close::after {
    position: absolute;
    top: 11px;
    left: 4px;
    width: 16px;
    height: 2px;
    background: var(--muted);
    content: "";
}

.btn-close::before {
    transform: rotate(45deg);
}

.btn-close::after {
    transform: rotate(-45deg);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge.bg-success {
    color: #166534;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    border-color: #93c5fd;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.45rem;
    font-weight: 600;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
}

footer {
    margin-top: 50px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    font-size: 0.9rem;
}

.list-unstyled {
    padding-left: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .col-md-4 {
        width: 33.333333%;
    }

    .col-md-6 {
        width: 50%;
    }

    .col-md-8 {
        width: 66.666667%;
    }

    .navbar-toggler {
        display: none;
    }

    .navbar-collapse {
        display: block;
        width: auto;
    }

    .navbar-nav {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .d-md-flex {
        display: flex;
    }
}

@media (min-width: 992px) {
    .col-lg-4 {
        width: 33.333333%;
    }
}
