body {
    font-family: Arial, sans-serif;
    background-image: url('/img/background.png');
    /*background: linear-gradient(to bottom, rgb(68, 89, 138), rgb(10, 56, 111));*/
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    margin: 0;
    padding: 0;
}

@font-face {
    font-family: 'Verdana';
    src: url('/css/font/Verdana-1.ttf') format('woff2'),
        url('/css/font/verdanab-3.ttf') format('woff'),
        url('/css/font/verdanai-2.ttf') format('truetype'),
        url('/css/font/verdanaz-4.ttf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lobster';
    src: url('/css/font/Lobster_1_4.otf') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Lobster1.4";
    src: url("/css/font/Lobster_1_4.eot") format("eot"),
        url("/css/font/Lobster_1_4.woff") format("woff"),
        url("/css/font/Lobster_1_4.ttf") format("truetype"),
        url("/css/font/Lobster_1_4.svg#Lobster1.4") format("svg");
    font-weight: normal;
    font-style: normal;
}

.header-high {
    background: linear-gradient(135deg,
            #00336C,
            rgba(0, 51, 108, 0.8),
            rgba(75, 93, 141, 0.8),
            #4B5D8D);
    text-align: center;
}

.header-high h2 {
    font-size: 28px;
    /* color: #2c3e50; */
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0 auto;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #ffffff;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-image {
    display: block;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.main-box {
    max-width: 100%;
    background-color: #2b2b2b;
}

.main {
    max-width: 78%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
}

.main h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 22px;
    color: #2c3e50;
}

.main h1 img {
    max-height: 100px;
    width: auto;
}

.main h1 a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

.main ul {
    float: right;
    list-style: none;
}

.main a {
    color: black;
    text-decoration: none;
}

.main a:hover {
    color: red;
}

.main li {
    float: left;
    line-height: 20px;
    margin: 0px 0 0px 40px;
}

.main img {
    vertical-align: top;
}

.main-content {
    margin-top: 150px;
    margin-bottom: 200px;
    display: flex;
    padding: 20px;
}

.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-item {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.sidebar-item:hover {
    transform: translateX(5px);
    border-left: 4px solid #3498db;
    background: linear-gradient(145deg, #ffffff, #e8f4fc);
}

/* 中文文本样式 */
.sidebar-item {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 500;
    line-height: 1.4;
}

/* 英文文本样式 */
.sidebar-item br+ :last-child {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 4px;
    font-weight: normal;
}

/* 激活状态 */
.sidebar-item.active {
    background: linear-gradient(145deg, #e8f4fc, #ffffff);
    border-left: 4px solid #3498db;
    color: #3498db;
}

.main-area {
    width: 80%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 20px;
    padding-left: 20px;
    align-items: start;
}

.main-area-index {
    width: 70%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    row-gap: 100px;
}

.product-image {
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    color: #ffffff;
}

.product-image span {
    font-size: 14px;
    width: 200px;
    word-break: break-all;
    display: inline-block;
}

.product-image img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.product-image img:hover {
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.editor {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 300px;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #2b2b2b;
    text-align: center;
    padding: 10px 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    color: #ffffff;
    font-family: Arial, sans-serif;
}

footer ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

footer li {
    margin: 5px 0;
}

footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #cccccc;
}

header {
    /* background: linear-gradient(to right, #f8f9fa, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); */
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #3498db;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #555;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
}

.menu li {
    position: relative;
}

.menu li a {
    text-decoration: none;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
    display: block;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.menu li a:hover {
    color: #3498db;
}

.menu li a br {
    margin: 2px 0;
}

.menu li a:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu li a:hover:after {
    width: 100%;
}

/* 英文文本样式 */
.menu li a br+ :last-child {
    color: #888;
    font-size: 12px;
    font-weight: normal;
}

/* 当前页面激活状态 */
.menu li a.active {
    color: #3498db;
}

.menu li a.active:after {
    width: 100%;
}

/* 退出登录按钮样式 */
.logout-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: linear-gradient(145deg, #ff6b6b, #f03e3e);
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(240, 62, 62, 0.2);
    border: none;
    height: 22px;
    line-height: 1;
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(240, 62, 62, 0.2);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.upload-group {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.upload-left {
    flex: 1;
}

.file-label {
    display: inline-block;
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.file-label:hover {
    background: #45a049;
}

input[type="file"] {
    display: none;
}

.file-name {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

.preview-container {
    height: 100px;
    border: 1px dashed #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.preview-container #editImgPreview {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#imgPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.submit-btn,
.cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.submit-btn {
    background: #4CAF50;
    color: white;
}

.submit-btn:hover {
    background: #45a049;
}

.cancel-btn {
    background: #f5f5f5;
    color: #333;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

/* 图片操作按钮容器 */
.image-actions {
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.product-image:hover .image-actions {
    opacity: 1;
    transform: scale(1);
}

/* 删除按钮样式 */
.delete-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff4757;
    border: 2px solid #fff;
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #ff6b81;
    transform: scale(1.1);
}

.delete-icon {
    font-style: normal;
    font-weight: bold;
}

.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    width: 300px;
    text-align: center;
}

.confirm-dialog h3 {
    margin: 0 0 15px 0;
    color: #2d3436;
}

.confirm-dialog p {
    margin: 0 0 20px 0;
    color: #636e72;
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.confirm-btn,
.cancel-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.confirm-btn {
    background: #ff4757;
    color: white;
}

.confirm-btn:hover {
    background: #ff6b81;
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* 编辑按钮样式 */
.edit-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2ecc71;
    border: 2px solid #fff;
    color: white;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #27ae60;
    transform: scale(1.1);
}

.edit-icon {
    font-style: normal;
    font-weight: bold;
}

/* ================================================
   响应式布局 — 移动端适配
   ================================================ */

/* 汉堡菜单按钮 */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}
.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* 移动端导航遮罩 */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ── 平板 (≤1199px) ── */
@media screen and (max-width: 1199px) {
    .main { max-width: 95%; }
    .main li { margin: 0 0 0 25px; }
    .menu li a { font-size: 13px; padding: 5px 8px; }
    .main-area-index { grid-template-columns: repeat(4, 1fr); row-gap: 60px; }
    .product-image img { width: 200px; height: 200px; }
    .product-image span { width: 180px; font-size: 13px; }
    .main-content { margin-top: 130px; margin-bottom: 150px; padding: 15px; }
    .header-high h2 { font-size: 22px; }
    .modal-content { width: 70%; max-width: 500px; }
}

/* ── 平板竖屏 (≤991px) ── */
@media screen and (max-width: 991px) {
    .main { height: auto; padding: 10px 15px; }
    .main li { margin: 0 0 0 18px; }
    .menu { flex-wrap: wrap; justify-content: center; gap: 0; }
    .menu li a { font-size: 12px; padding: 6px 8px; }
    .main-area-index { grid-template-columns: repeat(3, 1fr); row-gap: 40px; width: 95%; }
    .product-image img { width: 180px; height: 180px; }
    .product-image span { width: 160px; font-size: 12px; }
    .main-content { margin-top: 110px; margin-bottom: 120px; }
    .header-high h2 { font-size: 18px; padding: 8px 0; }
    .modal-content { width: 85%; padding: 20px; }
    .confirm-dialog { width: 85%; max-width: 300px; }
    .upload-group { flex-direction: column; }
    .main h1 img { max-height: 60px; }
}

/* ── 手机 (≤767px) ── */
@media screen and (max-width: 767px) {
    /* 汉堡菜单显示 */
    .hamburger { display: block; position: absolute; right: 10px; top: 10px; }
    .main { position: relative; }

    /* 导航默认隐藏 */
    .main nav { display: none; }
    .main nav.mobile-open {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #2b2b2b;
        z-index: 1000;
        padding: 10px 0;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }
    .main nav.mobile-open .menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .main nav.mobile-open .menu li {
        float: none;
        margin: 0;
    }
    .main nav.mobile-open .menu li a {
        display: block;
        text-align: left;
        padding: 12px 20px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* 移动端其他调整 */
    .main-area-index { grid-template-columns: repeat(2, 1fr); row-gap: 30px; width: 100%; }
    .product-image { height: auto; }
    .product-image img { width: 42vw; height: 42vw; max-width: 200px; max-height: 200px; }
    .product-image span { width: 42vw; max-width: 200px; font-size: 12px; }
    .main-content { margin-top: 90px; margin-bottom: 100px; padding: 10px; }
    .header-high h2 { font-size: 16px; }
    footer { position: relative; }
    .modal-content { width: 92%; padding: 15px; }
    .form-buttons { flex-direction: column; }
    .form-buttons button { width: 100%; }
    .main h1 img { max-height: 45px; }
}

/* ── 小手机 (≤480px) ── */
@media screen and (max-width: 480px) {
    .main-area-index { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
    .product-image img { width: 40vw; height: 40vw; max-width: 160px; max-height: 160px; }
    .product-image span { width: 40vw; max-width: 160px; font-size: 11px; }
    .main-content { margin-top: 80px; margin-bottom: 80px; padding: 5px; }
    .header-high h2 { font-size: 14px; }
    .main h1 { font-size: 16px; }
    .main { padding: 10px; }
}