/*==================================================
 * style.css - 广州中润挖机配件整站样式
 * 移动优先 | 工业金色调 | 响应式
 *==================================================*/

/* ===== CSS 变量 ===== */
:root {
    --color-primary: #C8851A;
    --color-primary-dark: #A66E0F;
    --color-primary-light: #E6A93B;
    --color-secondary: #2B2B2B;
    --color-bg: #FFF9F0;
    --color-card: #FFFFFF;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #E0C896;
    --color-success: #4a7c2a;
    --color-danger: #c0392b;
    --color-white: #FFFFFF;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.1);
    --shadow-md: 0 2px 8px rgba(0,0,0,.12);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --nav-height: 56px;
    --max-width: 1200px;
}

/* ===== 重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
    /* 整站背景图重复平铺 */
    background-color: var(--color-bg);
    background-image: url('/image1/BG2.jpg');
    background-repeat: repeat;
    background-attachment: fixed;
    min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; transition: color .2s; }
a:hover, a:active { color: var(--color-primary-dark); }

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

/* ===== 页面容器 ===== */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-top: var(--nav-height);
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 12px;
}

/* 产品展示页 - 全屏99%宽度 */
.products-page .main-content {
    max-width: 99%;
    padding: 4px 0.5%;
}

/* ===== 导航栏 ===== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    box-shadow: var(--shadow-md);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    min-height: var(--nav-height);
    flex-wrap: wrap;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-logo-img {
    max-height: 40px;
    width: auto;
    border-radius: 4px;
}

.nav-logo-text {
    color: var(--color-white);
    font-size: 16px;
    font-weight: 700;
    align-items: center;
    padding: 0 8px;
    height: 40px;
}

.nav-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: auto;
    padding: 6px 12px;
    height: 38px;
}

.nav-toggle-bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 20px;
}

.nav-toggle-bars span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: .3s;
}

.nav-toggle-label {
    color: var(--color-white);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-toggle.active .nav-toggle-bars span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.active .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle.active .nav-toggle-bars span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.nav-menu {
    list-style: none;
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 6px 0;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.nav-menu.show {
    display: flex;
}

.nav-menu li {
    border-top: 1px solid rgba(255,255,255,.15);
}

.nav-menu a {
    display: block;
    padding: 14px 16px;
    color: var(--color-white);
    font-size: 15px;
    font-weight: 500;
    transition: background .2s;
    border-radius: var(--radius-sm);
}

.nav-menu a:hover, .nav-menu a.active {
    background: rgba(255,255,255,.25);
    color: var(--color-white);
}

/* ===== 首页页头 ===== */
.home-header {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
    margin-bottom: 16px;
}

.home-header-img {
    display: block;
    width: 100%;
    height: auto;
}

/* ===== 最新产品滚动展示 ===== */
.latest-products-card {
    margin-bottom: 16px;
}

.latest-scroll-wrap {
    overflow: hidden;
    position: relative;
    margin: 0 -4px;
}

.latest-scroll-track {
    display: flex;
    gap: 10px;
    padding: 4px;
    will-change: transform;
    animation: scrollLatest 10s linear infinite;
}

.latest-scroll-track:hover {
    animation-play-state: paused;
}

@keyframes scrollLatest {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.latest-item {
    flex-shrink: 0;
    width: 140px;
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(224,200,150,.3);
    transition: box-shadow .2s, transform .2s;
}

.latest-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.latest-item-img-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--color-bg);
}

.latest-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.latest-item-title {
    padding: 6px 8px 2px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 34px;
}

.latest-item-cat {
    padding: 0 8px 8px;
    font-size: 10px;
    color: var(--color-primary-dark);
}

/* ===== 卡片通用 ===== */
.card {
    background: rgba(255,255,255,.92);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(224,200,150,.4);
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* ===== 公司简介 ===== */
.company-intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.company-intro-img {
    width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    aspect-ratio: 16/9;
    object-fit: cover;
}

.company-intro-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--color-text);
    text-indent: 2em;
}

/* ===== 公司位置 ===== */
.location-img {
    width: 100%;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .2s;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.location-img:active {
    transform: scale(.98);
}

.location-hint {
    text-align: center;
    color: var(--color-text-light);
    font-size: 12px;
    margin-top: 8px;
}

.location-addr {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--color-text);
    border-left: 3px solid var(--color-primary);
}

/* ===== 联系方式 ===== */
.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
    border: 1px solid transparent;
}

.contact-item:hover, .contact-item:active {
    border-color: var(--color-primary-light);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.contact-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
}

.contact-label {
    font-size: 12px;
    color: var(--color-text-light);
}

.contact-value {
    font-size: 15px;
    color: var(--color-text);
    font-weight: 600;
}

.contact-copy {
    font-size: 12px;
    color: var(--color-primary);
    opacity: 0;
    transition: opacity .2s;
}

.contact-item:hover .contact-copy,
.contact-item:active .contact-copy {
    opacity: 1;
}

/* ===== 产品瀑布流 ===== */
.products-header {
    margin-bottom: 12px;
    text-align: center;
}

.products-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.products-search-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.products-search-input {
    width: 180px;
    max-width: 60%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--color-white);
    outline: none;
    transition: border-color .2s;
}

.products-search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(200,133,26,.1);
}

.products-search-btn {
    height: 34px;
    padding: 0 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
    font-family: inherit;
}

.products-search-btn:hover {
    background: var(--color-primary-dark);
}

.products-search-clear {
    font-size: 12px;
    color: var(--color-text-light);
    text-decoration: underline;
}

.products-cat-filter {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cat-btn {
    padding: 5px 10px;
    background: rgba(255,255,255,.9);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.cat-btn:hover, .cat-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.masonry {
    column-count: 3;
    column-gap: 5px;
}

.product-card {
    break-inside: avoid;
    margin-bottom: 5px;
    background: var(--color-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
    border: 1px solid rgba(224,200,150,.3);
    cursor: pointer;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-card-media {
    position: relative;
    width: 100%;
}

.product-card-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: var(--color-bg);
    display: block;
}

.product-card-title-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 6px 6px;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.75) 100%);
    color: var(--color-white);
    font-size: 11px;
    line-height: 1.4;
}

.product-card-title-overlay span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-cat {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    background: var(--color-bg);
    border-radius: 10px;
    font-size: 11px;
    color: var(--color-primary-dark);
}

.product-card-date {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

/* ===== 产品相册弹窗 ===== */
.product-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.product-lightbox.show {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.92);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-stage {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    cursor: pointer;
}

.lightbox-title-bar {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0,0,0,.7);
    color: var(--color-white);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lightbox-title-bar small {
    font-size: 12px;
    color: rgba(255,255,255,.7);
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: var(--color-white);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,.3);
}

.lightbox-hint {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: rgba(255,255,255,.6);
    font-size: 12px;
    background: rgba(0,0,0,.4);
    padding: 4px 12px;
    border-radius: 20px;
    pointer-events: none;
}

/* ===== 产品详情 ===== */
.product-detail {
    background: rgba(255,255,255,.95);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.product-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.product-detail-meta {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.product-gallery {
    margin-bottom: 16px;
}

.product-gallery-main {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.product-gallery-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.product-gallery-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.product-gallery-thumb.active {
    border-color: var(--color-primary);
}

.product-detail-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--color-text);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 10px;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding-bottom: 20px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: rgba(255,255,255,.9);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--color-text);
    transition: all .2s;
}

.pagination a:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.pagination .current {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* ===== 页脚 ===== */
.site-footer {
    background: #8B4513;
    color: rgba(255,255,255,.9);
    padding: 20px 12px 16px;
    margin-top: 20px;
    border-top: 4px solid var(--color-primary-light);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}

.footer-brand {
    text-align: center;
    min-width: 140px;
}

.footer-brand-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: 2px;
    line-height: 1.1;
    text-shadow: 1px 1px 2px rgba(0,0,0,.3);
}

.footer-brand-url {
    font-size: 12px;
    color: rgba(255,255,255,.7);
    margin-top: 4px;
    letter-spacing: 1px;
}

.footer-contact {
    flex: 1;
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
}

.footer-row {
    margin-bottom: 2px;
}

.footer-site-name {
    font-size: 14px;
    color: var(--color-white);
    margin-bottom: 6px;
}

.footer-item {
    display: inline-block;
    margin: 0 8px 0 0;
    cursor: pointer;
    transition: color .2s;
}

.footer-item:hover {
    color: var(--color-primary-light);
}

.footer-addr-row {
    color: rgba(255,255,255,.85);
}

.footer-notice {
    color: rgba(255,255,255,.8);
    font-size: 12px;
    margin-top: 2px;
}

.footer-notice a {
    color: rgba(255,255,255,.8);
    text-decoration: underline;
    margin-left: 8px;
}

.footer-notice a:hover {
    color: var(--color-primary-light);
}

.footer-stars {
    color: #FFD700;
    letter-spacing: 1px;
}

.footer-qr {
    text-align: center;
    min-width: 100px;
}

.footer-qr img {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    background: var(--color-white);
    padding: 3px;
    margin: 0 auto;
}

.footer-qr p {
    font-size: 12px;
    margin-top: 6px;
    color: rgba(255,255,255,.85);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    text-align: center;
}

.footer-bottom-info {
    font-size: 12px;
    color: rgba(255,255,255,.6);
}

.footer-icp {
    margin-bottom: 4px;
}

.footer-icp a {
    color: rgba(255,255,255,.7);
}

.footer-icp a:hover {
    color: var(--color-primary-light);
}

.footer-copy {
    font-size: 11px;
}

.footer-secret {
    display: flex;
    gap: 6px;
    align-items: center;
}

.footer-secret-input {
    width: 120px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 4px;
    background: rgba(255,255,255,.1);
    color: var(--color-white);
    font-size: 13px;
    outline: none;
}

.footer-secret-input::placeholder {
    color: rgba(255,255,255,.5);
}

.footer-secret-btn {
    height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 4px;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
}

.footer-secret-btn:hover {
    background: var(--color-primary-light);
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,.8);
    color: #fff;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 后台管理样式 ===== */
.admin-body {
    background: #f0ede5;
    background-image: none;
}

.admin-header {
    background: var(--color-secondary);
    color: var(--color-white);
    padding: 0 16px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.admin-header h1 {
    font-size: 16px;
    font-weight: 600;
}

.admin-header a {
    color: var(--color-white);
    font-size: 13px;
}

.admin-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 12px;
}

.admin-nav {
    display: flex;
    gap: 0;
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.admin-nav a {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    font-size: 13px;
    color: var(--color-text);
    border-right: 1px solid #eee;
    min-width: 80px;
}

.admin-nav a:last-child { border-right: none; }
.admin-nav a:hover { background: var(--color-bg); }
.admin-nav a.active { background: var(--color-primary); color: var(--color-white); }

/* 登录页 */
.login-box {
    max-width: 360px;
    margin: 40px auto;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    box-shadow: var(--shadow-lg);
}

.login-title {
    text-align: center;
    font-size: 20px;
    color: var(--color-primary-dark);
    margin-bottom: 24px;
    font-weight: 700;
}

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

.form-label {
    display: block;
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color .2s;
    background: var(--color-white);
}

.form-input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(200,133,26,.1);
}

.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color .2s;
}

.form-textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(200,133,26,.1);
}

.form-select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--color-white);
    cursor: pointer;
}

.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-img {
    height: 42px;
    width: 120px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.captcha-refresh {
    font-size: 12px;
    color: var(--color-primary);
    cursor: pointer;
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    font-family: inherit;
}

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #a93226;
    color: var(--color-white);
}

.btn-default {
    background: #f0f0f0;
    color: var(--color-text);
}

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

/* ===== 仿朋友圈发布 ===== */
.moment-editor {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.moment-textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid #eee;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 15px;
    resize: vertical;
    font-family: inherit;
}

.moment-textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}

.moment-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.moment-img-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg);
}

.moment-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moment-img-status {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px 4px;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
    color: #fff;
    pointer-events: none;
}

.moment-img-status.uploading {
    background: rgba(30,58,95,.78);
}

.moment-img-status.error {
    background: rgba(192,57,43,.85);
}

.moment-img-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.moment-img-add {
    aspect-ratio: 1/1;
    border: 2px dashed #ddd;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ccc;
    font-size: 12px;
    gap: 4px;
    transition: border-color .2s, color .2s;
}

.moment-img-add:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.moment-img-add span.plus {
    font-size: 28px;
    line-height: 1;
}

.moment-hidden-input {
    display: none;
}

.moment-category {
    margin-top: 12px;
}

/* ===== 后台产品列表 ===== */
.admin-product-list {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.admin-product-item {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.admin-product-item:last-child {
    border-bottom: none;
}

.admin-product-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-bg);
}

.admin-product-info {
    flex: 1;
    min-width: 0;
}

.admin-product-title {
    font-size: 14px;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.admin-product-meta {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 2px;
}

.admin-product-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ===== 设置表单 ===== */
.settings-form .form-group {
    margin-bottom: 14px;
}

.qr-preview {
    width: 120px;
    height: 120px;
    border: 1px dashed #ddd;
    border-radius: var(--radius-sm);
    margin-top: 6px;
    object-fit: cover;
    background: var(--color-bg);
}

/* ===== 提示消息 ===== */
.msg-box {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.msg-success {
    background: #e8f5e9;
    color: var(--color-success);
    border: 1px solid #c8e6c9;
}

.msg-error {
    background: #fdecea;
    color: var(--color-danger);
    border: 1px solid #f5c6cb;
}

.msg-info {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

/* ===== 响应式 - 平板 ===== */
@media (min-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    .main-content {
        padding: 20px;
    }

    .nav-toggle {
        display: none;
    }

    .nav-menu {
        display: flex !important;
        flex-direction: row;
        width: auto;
        padding: 0;
        margin-left: auto;
        background: none;
        box-shadow: none;
        border-radius: 0;
    }

    .nav-menu li {
        border-top: none;
    }

    .nav-menu a {
        padding: 8px 14px;
        font-size: 14px;
    }

    .latest-item {
        width: 180px;
    }

    .latest-item-title {
        font-size: 13px;
    }

    .latest-item-title {
        font-size: 13px;
    }

    .company-intro {
        flex-direction: row;
        align-items: flex-start;
    }

    .company-intro-img {
        width: 45%;
        flex-shrink: 0;
    }

    .company-intro-text {
        flex: 1;
        font-size: 15px;
    }

    .products-cat-filter {
        flex-direction: row;
        justify-content: center;
    }

    .products-search-input {
        width: 220px;
    }

    .masonry {
        column-count: 4;
        column-gap: 14px;
    }

    .product-card {
        margin-bottom: 14px;
    }

    .contact-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .contact-item {
        flex: 1;
        min-width: 220px;
    }

    .footer-main {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 24px;
    }

    .footer-brand {
        text-align: left;
    }

    .footer-contact {
        text-align: left;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .footer-qr img {
        width: 110px;
        height: 110px;
    }

    .moment-images {
        grid-template-columns: repeat(5, 1fr);
    }

    .admin-container {
        padding: 24px 20px;
    }
}

/* ===== 响应式 - 桌面大屏 ===== */
@media (min-width: 1024px) {
    .main-content {
        padding: 24px;
    }

    .masonry {
        column-count: 5;
    }

    .company-intro-text {
        font-size: 16px;
    }

    .card {
        padding: 24px;
    }

    .moment-images {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1440px) {
    .masonry {
        column-count: 6;
    }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .product-card {
    animation: fadeIn .3s ease-out;
}

/* ===== 微信二维码 ===== */
.wechat-qr {
    text-align: center;
    margin-top: 12px;
}

.wechat-qr img {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.wechat-qr p {
    margin-top: 8px;
    font-size: 13px;
    color: var(--color-text-light);
}
