/* ===========================================
   SANMING ALLINEW IMP & EXP CO., LTD.
   Global stylesheet
   =========================================== */
:root {
    --wood-900: #3d2b1f;
    --wood-700: #6b4a2f;
    --wood-600: #8b5e34;
    --wood-500: #a9713f;
    --wood-300: #d8bb98;
    --wood-100: #f6efe7;
    --sand: #faf7f2;
    --ink: #23201d;
    --muted: #6b6560;
    --line: #e6ded4;
    --green: #2f7a52;
    --white: #ffffff;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(61, 43, 31, .08);
    --shadow: 0 6px 24px rgba(61, 43, 31, .10);
    --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--white);
    line-height: 1.65;
    font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: var(--wood-600); text-decoration: none; }
a:hover { color: var(--wood-500); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--wood-900); margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 6px;
    border: 2px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    font-size: .95rem;
    text-align: center;
}
.btn-primary { background: var(--wood-600); color: #fff; border-color: var(--wood-600); }
.btn-primary:hover { background: var(--wood-700); border-color: var(--wood-700); color: #fff; }
.btn-outline { background: transparent; color: var(--wood-700); border-color: var(--wood-300); }
.btn-outline:hover { background: var(--wood-100); color: var(--wood-900); }
.btn-light { background: #fff; color: var(--wood-700); border-color: #fff; }
.btn-light:hover { background: var(--wood-100); color: var(--wood-900); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: var(--shadow-sm); }
.topbar { background: var(--wood-900); color: #e8ddd1; font-size: .82rem; }
.topbar-inner { display: flex; justify-content: space-between; gap: 16px; padding: 7px 20px; }
.topbar a { color: #f2e6d8; }
.topbar-contact { display: inline-flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-contact a:hover { color: #fff; text-decoration: underline; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 44px; height: 44px; border-radius: 8px;
    background: linear-gradient(135deg, var(--wood-600), var(--wood-500));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; letter-spacing: .5px; font-size: 1rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: var(--wood-900); font-size: 1.08rem; letter-spacing: .3px; }
.brand-text small { color: var(--muted); font-size: .72rem; letter-spacing: 1.2px; }
.main-nav { display: flex; align-items: center; gap: 26px; }
.main-nav a { color: var(--ink); font-weight: 500; font-size: .96rem; }
.main-nav a:hover, .main-nav a.active { color: var(--wood-600); }
.main-nav a.active { position: relative; }
.main-nav .nav-cta { color: #fff; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--wood-700); cursor: pointer; }

/* ---------- hero ---------- */
.hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    background: var(--wood-900) center/cover no-repeat;
}
.hero::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(35,25,18,.86) 0%, rgba(35,25,18,.62) 45%, rgba(35,25,18,.25) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 640px; padding: 90px 20px; color: #fff; }
.hero h1 { color: #fff; font-size: 2.7rem; margin-bottom: .35em; }
.hero p { color: #e6dbcd; font-size: 1.1rem; margin-bottom: 1.6em; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.hero-badges span {
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
    color: #fff; padding: 5px 13px; border-radius: 20px; font-size: .82rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- sections ---------- */
section { padding: 70px 0; }
.section-sand { background: var(--sand); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 45px; }
.section-head .eyebrow {
    text-transform: uppercase; letter-spacing: 2.5px; font-size: .74rem;
    color: var(--wood-500); font-weight: 700; margin-bottom: 10px;
}
.section-head p { color: var(--muted); margin-bottom: 0; }

/* ---------- feature cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: .25s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--wood-300); }
.card-img { aspect-ratio: 4/3; overflow: hidden; background: var(--wood-100); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: .35em; font-size: 1.08rem; }
.card-body p { color: var(--muted); font-size: .92rem; margin-bottom: 1em; flex: 1; }
.card-link { font-weight: 600; font-size: .88rem; }

.feature { text-align: center; padding: 30px 22px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.feature .icon {
    width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--wood-100); color: var(--wood-600);
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat strong { display: block; font-size: 2rem; color: var(--wood-600); }
.stat span { color: var(--muted); font-size: .88rem; }

/* ---------- page banner ---------- */
.page-banner {
    background: linear-gradient(rgba(45,32,22,.82), rgba(45,32,22,.82)), var(--wood-900);
    color: #fff; padding: 62px 0; text-align: center;
}
.page-banner h1 { color: #fff; margin-bottom: .2em; font-size: 2.1rem; }
.page-banner p { color: #d9cdbf; margin: 0; }
.breadcrumb { font-size: .85rem; color: #c9bcac; margin-top: 12px; }
.breadcrumb a { color: var(--wood-300); }

/* ---------- products filter ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }
.filter-bar a {
    padding: 9px 20px; border-radius: 30px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); font-size: .9rem; transition: .2s;
}
.filter-bar a:hover { border-color: var(--wood-300); }
.filter-bar a.active { background: var(--wood-600); border-color: var(--wood-600); color: #fff; }

/* ---------- product detail ---------- */
.product-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 46px; align-items: start; }
.product-gallery .main-img {
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    background: var(--wood-100); aspect-ratio: 4/3;
}
.product-gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; margin-top: 12px; }
.thumbs img {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px;
    border: 2px solid transparent; cursor: pointer; transition: .2s; opacity: .78;
}
.thumbs img:hover { opacity: 1; }
.thumbs img.active { border-color: var(--wood-600); opacity: 1; }

.product-info h1 { font-size: 1.9rem; margin-bottom: .3em; }
.product-cat { color: var(--wood-500); font-size: .82rem; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; }
.product-desc { color: #4a443f; }
.spec-table { width: 100%; border-collapse: collapse; margin: 22px 0 26px; font-size: .92rem; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table th {
    text-align: left; padding: 11px 14px 11px 0; color: var(--wood-700);
    font-weight: 600; width: 42%; vertical-align: top;
}
.spec-table td { padding: 11px 0; color: #4a443f; }
.spec-table tr:nth-child(odd) { background: #fdfbf8; }

/* ---------- content / prose ---------- */
.prose { max-width: 860px; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: .5em; color: #4a443f; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gallery-grid a { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: var(--wood-100); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.gallery-grid a:hover img { transform: scale(1.06); }

/* ---------- forms ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; color: var(--wood-900); }
.field .req { color: #c0392b; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], select, textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px;
    font-size: .95rem; font-family: inherit; color: var(--ink); background: #fff; transition: .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--wood-500); box-shadow: 0 0 0 3px rgba(169,113,63,.12); }
textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: .82rem; color: var(--muted); }

.alert { padding: 13px 18px; border-radius: 8px; margin-bottom: 22px; font-size: .93rem; }
.alert-success { background: #eaf6ef; color: #1f5c3d; border: 1px solid #bfe2cd; }
.alert-error { background: #fdecea; color: #922b21; border: 1px solid #f5c6c0; }

.contact-info-list { list-style: none; padding: 0; margin: 0; }
.contact-info-list li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.contact-info-list li:last-child { border-bottom: 0; }
.contact-info-list .lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); display: block; }
.contact-info-list .val { font-weight: 600; color: var(--wood-900); }

/* ---------- CTA ---------- */
.cta-band { background: var(--wood-700); color: #fff; padding: 56px 0; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #e4d7c8; max-width: 640px; margin: 0 auto 26px; }

/* ---------- footer ---------- */
.site-footer { background: var(--wood-900); color: #c9bcac; padding-top: 56px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr; gap: 40px; padding-bottom: 40px; }
.site-footer h4 { color: #fff; font-size: 1rem; letter-spacing: .5px; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #c9bcac; }
.site-footer a:hover { color: #fff; }
.contact-list a { color: #e6dccd; }
.contact-list a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: .84rem; text-align: center; }

/* ---------- admin ---------- */
.admin-body { background: #f4f1ed; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 12px; padding: 40px 34px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.4rem; text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .88rem; margin-bottom: 26px; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 232px; background: var(--wood-900); color: #cfc2b3; flex-shrink: 0; padding: 22px 0; }
.admin-side .logo { padding: 0 22px 22px; color: #fff; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.admin-side .logo small { display: block; font-weight: 400; font-size: .7rem; color: #a4958a; letter-spacing: 1px; }
.admin-side a { display: block; padding: 11px 22px; color: #cfc2b3; font-size: .93rem; border-left: 3px solid transparent; }
.admin-side a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-side a.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--wood-500); }
.admin-side .menu-label { padding: 16px 22px 6px; font-size: .68rem; letter-spacing: 1.8px; text-transform: uppercase; color: #8d8073; font-weight: 700; }
.admin-side .menu-label:first-of-type { padding-top: 6px; }
.admin-main { flex: 1; min-width: 0; }
.admin-top { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 26px; display: flex; justify-content: space-between; align-items: center; }
.admin-top h1 { font-size: 1.15rem; margin: 0; }
.admin-content { padding: 26px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; }
.admin-card h2 { font-size: 1.05rem; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card strong { display: block; font-size: 1.9rem; color: var(--wood-600); line-height: 1.2; }
.stat-card span { color: var(--muted); font-size: .85rem; }

table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; padding: 11px 12px; background: var(--sand); color: var(--wood-900); font-weight: 600; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #fdfbf8; }
table.data img.thumb { width: 56px; height: 44px; object-fit: cover; border-radius: 4px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .74rem; font-weight: 600; }
.badge-new { background: #fdecea; color: #b03a2e; }
.badge-read { background: #eef1f3; color: #6b6560; }
.badge-yes { background: #eaf6ef; color: #1f5c3d; }
.badge-no { background: #f2f2f2; color: #888; }
.badge-draft { background: #fdf3e3; color: #8a5a12; }

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #a93226; border-color: #a93226; color: #fff; }
.btn-xs { padding: 5px 12px; font-size: .8rem; }

.img-manage { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.img-manage .item { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.img-manage .item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.img-manage .item .cover-tag {
    position: absolute; top: 6px; left: 6px; background: var(--wood-600); color: #fff;
    font-size: .68rem; padding: 2px 7px; border-radius: 12px;
}
.img-manage .item .del {
    position: absolute; top: 6px; right: 6px; background: rgba(192,57,43,.92); color: #fff;
    width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: .8rem; line-height: 1;
}

/* ---------- misc ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.6rem; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.tag-list li { background: var(--wood-100); color: var(--wood-700); padding: 5px 13px; border-radius: 20px; font-size: .82rem; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
    .grid-4, .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .product-layout, .split { grid-template-columns: 1fr; gap: 30px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .admin-shell { flex-direction: column; }
    .admin-side { width: 100%; display: flex; overflow-x: auto; padding: 0; }
    .admin-side .logo { display: none; }
    .admin-side a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
    .admin-side a.active { border-bottom-color: var(--wood-500); }
}
@media (max-width: 720px) {
    h1 { font-size: 1.9rem; }
    .hero h1 { font-size: 2rem; }
    .hero-inner { padding: 66px 20px; }
    section { padding: 48px 0; }
    .grid-2, .grid-3, .grid-4, .stats, .form-row, .footer-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .main-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: #fff; flex-direction: column; align-items: stretch; gap: 0;
        padding: 10px 0; box-shadow: var(--shadow); border-top: 1px solid var(--line);
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 20px; }
    .main-nav .nav-cta { margin: 10px 20px; border-radius: 6px; }
    .header-inner { position: relative; }
    .topbar-inner { flex-direction: column; gap: 2px; text-align: center; }
    .admin-content { padding: 16px; }
    .table-scroll { overflow-x: auto; }
}

/* ===================== Rich text editor ===================== */
.rt-wrap { border:1px solid var(--line); border-radius:8px; background:#fff; }
.rt-bar { display:flex; flex-wrap:wrap; gap:4px; padding:8px; border-bottom:1px solid var(--line); background:#faf7f2; border-radius:8px 8px 0 0; align-items:center; }
.rt-btn { min-width:32px; height:30px; padding:0 9px; border:1px solid transparent; background:transparent; border-radius:6px; cursor:pointer; font-size:.9rem; color:#3d372f; display:inline-flex; align-items:center; justify-content:center; gap:4px; }
.rt-btn:hover { background:#efe8dc; border-color:var(--line); }
.rt-sel { height:30px; border:1px solid var(--line); border-radius:6px; background:#fff; font-size:.82rem; padding:0 4px; color:#3d372f; max-width:132px; }
.rt-color { width:32px; height:30px; padding:2px; border:1px solid var(--line); border-radius:6px; background:#fff; cursor:pointer; }
.rt-area { min-height:150px; max-height:480px; overflow:auto; padding:14px 16px; outline:none; font-size:.95rem; line-height:1.65; color:#3d372f; border-radius:0 0 8px 8px; background:#fff; }
.rt-area:empty::before { content:attr(data-ph); color:#a89f92; }
.rt-area img { max-width:100%; height:auto; border-radius:6px; }
.rt-area:focus { box-shadow:inset 0 0 0 2px rgba(160,120,70,.28); }
.rt-uploading { opacity:.45; pointer-events:none; }
