:root {
    --brown: #70442d;
    --brown-dark: #4c2b1b;
    --orange: #ff8a38;
    --red: #ff4f3f;
    --bg: #f5f6f8;
    --panel: #fff;
    --text: #25282d;
    --muted: #89909b;
    --line: #e8eaf0;
    --green: #16845b;
    --shadow: 0 8px 28px rgba(30,35,40,.045);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

button,input,select,textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.admin-body {
    background: var(--bg);
}

.topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand,.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, #8e5a38, #4e2c1d);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 auto;
}

.brand-mark svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand strong,.auth-brand strong {
    display: block;
    font-size: 16px;
}

.brand small,.auth-brand small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-identity {
    color: #666;
}

.admin-shell {
    display: grid;
    grid-template-columns: 220px minmax(0,1fr);
    min-height: calc(100vh - 70px);
}

.sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 25px 14px;
}

.sidebar-label {
    padding: 0 13px 10px;
    color: #a0a5ad;
    font-size: 11px;
    letter-spacing: 1px;
}

.sidebar-label-spaced {
    margin-top: 28px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    padding: 0 13px;
    margin: 3px 0;
    border-radius: 9px;
    color: #626974;
    font-weight: 500;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #92705c;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link:hover {
    background: #faf4ef;
    color: var(--brown);
}

.nav-disabled {
    color: #aeb3bb;
    cursor: default;
    font-size: 12px;
}

.nav-disabled em {
    font-size: 10px;
    font-style: normal;
    margin-left: auto;
    color: #b2b6be;
}

.sidebar-note {
    margin: 28px 9px 0;
    padding: 13px;
    background: #faf6f2;
    border: 1px solid #f0e5dc;
    border-radius: 9px;
    color: #8d7564;
    font-size: 11px;
    line-height: 1.7;
}

.main-content {
    min-width: 0;
    padding: 28px 32px 44px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #a5a8ae;
    margin-bottom: 5px;
}

.page-heading h1 {
    font-size: 25px;
    margin: 0;
    font-weight: 750;
    letter-spacing: -.5px;
}

.text-link {
    color: #8a5739;
    font-weight: 600;
    font-size: 13px;
}

.text-link:hover {
    color: #d45e2d;
}

.panel {
    background: var(--panel);
    border: 1px solid #eceef2;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 17px;
}

.panel-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 650;
    font-size: 13px;
    white-space: nowrap;
    transition: background .15s,border-color .15s;
}

.button-icon,
.inline-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inline-icon {
    display: inline-block;
    vertical-align: -3px;
    margin-left: 3px;
}

.placeholder-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #a0a4aa;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.button-primary:hover {
    background: var(--brown-dark);
}

.button-light {
    background: #fff;
    border-color: #e0e3e8;
    color: #555e69;
}

.button-light:hover {
    background: #f7f8fa;
}

.button-quiet {
    background: #f7f3ef;
    color: #85583d;
    border-color: #efe3d9;
}

.button-small {
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

.button-wide {
    width: 100%;
    min-height: 44px;
}

.text-button {
    padding: 0;
    border: 0;
    background: none;
    color: #87573a;
    font-size: 12px;
    font-weight: 650;
}

.danger-text {
    color: #c94c42;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin: 0 0 18px;
    font-size: 13px;
}

.alert-error {
    background: #fff0ef;
    border: 1px solid #ffd4d0;
    color: #b43830;
}

.alert-success {
    background: #ecf8f1;
    border: 1px solid #ccebd9;
    color: #207a4c;
}

.alert-info {
    background: #eef5ff;
    border: 1px solid #d8e7ff;
    color: #365f9a;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 20px 20px 17px;
    background: #fff;
    border: 1px solid #eceef2;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    color: #777f8a;
    font-size: 12px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    line-height: 1.3;
    margin: 10px 0 5px;
    letter-spacing: -.7px;
}

.stat-card small {
    color: #a0a5ad;
    font-size: 11px;
}

.stat-green {
    color: var(--green);
}

.stat-orange {
    color: #d9792d;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 740px;
}

th {
    text-align: left;
    background: #fafbfc;
    color: #89909a;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
}

th,td {
    padding: 13px 12px;
    border-bottom: 1px solid #edf0f3;
    vertical-align: middle;
}

td {
    font-size: 12px;
    color: #59616c;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #fdfdfd;
}

.goods-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 230px;
}

.goods-cell strong {
    display: block;
    color: #2b3037;
    font-size: 12px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.goods-cell small {
    display: block;
    color: #9aa0a9;
    font-size: 10px;
    margin-top: 4px;
}

.thumb-small {
    width: 54px;
    height: 42px;
    flex: none;
    border-radius: 7px;
    overflow: hidden;
    background: #f0f1f3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a4aa;
    font-size: 10px;
}

.thumb-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.price-cell {
    font-size: 14px;
    font-weight: 800;
    color: #fa513f;
    white-space: nowrap;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 10px;
    white-space: nowrap;
    background: #f0f1f4;
    color: #6f7782;
}

.status-published {
    background: #e8f7ef;
    color: #178454;
}

.status-pending {
    background: #fff2df;
    color: #b86b1c;
}

.status-draft {
    background: #eef1f5;
    color: #69717d;
}

.status-offline {
    background: #fcebea;
    color: #bc4c45;
}

.actions {
    white-space: nowrap;
}

.action-stack {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    min-width: 140px;
}

.quick-import-form {
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid #eee4dc;
    border-radius: 10px;
    background: #fcfaf8;
}

.quick-import-form > label {
    display: block;
    margin-bottom: 8px;
    color: #454a52;
    font-weight: 650;
}

.quick-import-form .input-action {
    align-items: stretch;
}

.quick-import-form .input-action input {
    background: #fff;
}

.quick-import-form > small {
    display: block;
    margin-top: 8px;
    color: #9299a3;
    line-height: 1.6;
}

.source-image-reference {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #e8eaf0;
    border-radius: 8px;
    background: #fafbfc;
    font-size: 12px;
}

.source-image-reference[hidden] {
    display: none;
}

.source-image-reference a {
    color: #87573a;
    font-weight: 650;
    text-decoration: underline;
}

.source-image-reference small {
    flex-basis: 100%;
    color: #9299a3;
}

.category-name-child {
    display: inline-block;
    margin-left: 12px;
    padding-left: 10px;
    border-left: 1px solid #d8dce2;
    color: #68717d;
}

.filter-bar {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filter-bar input {
    flex: 1;
    min-width: 220px;
}

.filter-bar input,.filter-bar select {
    height: 38px;
}

.filter-bar select {
    min-width: 135px;
}

.filter-bar input,.filter-bar select,input,select,textarea {
    border: 1px solid #dfe3e9;
    border-radius: 7px;
    padding: 9px 11px;
    background: #fff;
    color: #2d3239;
    outline: none;
    max-width: 100%;
}

input:focus,select:focus,textarea:focus {
    border-color: #a67b5e;
    box-shadow: 0 0 0 3px rgba(112,68,45,.08);
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
    color: #535b66;
    font-weight: 650;
    min-width: 0;
}

label small {
    font-size: 11px;
    font-weight: 400;
    color: #989fa9;
    line-height: 1.6;
}

input,select,textarea {
    width: 100%;
    font-weight: 400;
    font-size: 13px;
}

textarea {
    resize: vertical;
    line-height: 1.6;
}

.required {
    color: #df4f43;
}

.form-panel {
    padding: 24px 26px;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

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

.goods-basic-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.goods-basic-grid > label { grid-column: span 3; }
.goods-basic-grid > .basic-medium { grid-column: span 4; }
.goods-basic-grid > .basic-half { grid-column: span 6; }
.goods-basic-grid > .field-full { grid-column: 1 / -1; }
.form-grid .field-label { display: inline-flex; align-items: baseline; gap: 4px; }
.goods-cover-field { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.goods-cover-field > label { width: min(100%, 380px); }
.goods-cover-field .cover-preview { margin: 0; }
@media (max-width: 760px) {
    .goods-basic-grid > label, .goods-basic-grid > .basic-medium, .goods-basic-grid > .basic-half { grid-column: span 6; }
    .goods-basic-grid > .field-full { grid-column: 1 / -1; }
}
@media (max-width: 500px) {
    .goods-basic-grid > label, .goods-basic-grid > .basic-medium, .goods-basic-grid > .basic-half { grid-column: 1 / -1; }
}

.field-full {
    grid-column: 1/-1;
}

.form-section {
    border-top: 1px solid #eceef2;
    padding-top: 22px;
}

.form-section h3 {
    font-size: 15px;
    margin: 0 0 18px;
}

.form-section p {
    font-size: 12px;
    color: #9299a3;
    margin: 5px 0 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.input-action {
    display: flex;
    gap: 8px;
}

.input-action input {
    flex: 1;
    min-width: 0;
}

.help-text {
    color: #9299a3;
    font-weight: 400;
}

.cover-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 9px;
    color: #8e949e;
    font-size: 11px;
}

#generated-cover-preview[hidden] { display: none; }

.cover-preview img {
    width: 130px;
    height: 82px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.image-gallery {
    margin-top: 20px;
}

.image-gallery h4 {
    font-size: 12px;
    margin: 0 0 10px;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.image-gallery h4 {
    width: 100%;
}

.gallery-item {
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.gallery-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 5px;
}

.gallery-item span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #c14c42;
}

.gallery-item input {
    width: auto;
}

.gallery-item small {
    font-size: 9px;
    word-break: break-all;
    color: #9aa0a9;
    font-weight: 400;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title-row h3 {
    margin-bottom: 5px;
}

.detail-section-editor {
    border: 1px solid #e6e8ec;
    background: #fcfcfd;
    border-radius: 11px;
    padding: 17px;
    margin: 12px 0;
}

.section-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.section-editor-head strong {
    font-size: 13px;
}

.detail-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.detail-item-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid #edf0f3;
    border-radius: 8px;
}

.detail-item-row label {
    font-size: 11px;
}

.detail-item-row textarea {
    min-height: 38px;
}

.detail-item-row .remove-item {
    margin-bottom: 11px;
    white-space: nowrap;
}

.table-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    color: #9097a1;
    font-size: 12px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination a {
    padding: 5px 9px;
    border: 1px solid #e2e5ea;
    border-radius: 6px;
    color: #6e543f;
}

.empty-state {
    text-align: center;
    padding: 42px 16px;
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto;
    color: #b8c0ca;
}

.empty-icon svg {
    display: block;
    width: 48px;
    height: 48px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state strong {
    display: block;
    font-size: 15px;
    margin-top: 10px;
}

.empty-state p,.empty-inline {
    font-size: 12px;
    color: #969da7;
}

.empty-state .button {
    margin-top: 10px;
}

.empty-inline {
    text-align: center;
    padding: 22px;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top left,#f4e9df 0,transparent 36%),#f4f5f7;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    padding: 34px;
    border-radius: 16px;
    border: 1px solid #eceef2;
    box-shadow: 0 20px 60px rgba(40,35,30,.08);
}

.auth-brand {
    margin-bottom: 27px;
}

.auth-card h1 {
    font-size: 23px;
    margin: 0 0 8px;
}

.auth-intro {
    color: #89909a;
    font-size: 12px;
    margin: 0 0 22px;
}

.form-stack label {
    margin-bottom: 0;
}

.auth-card .form-stack {
    gap: 16px;
}

.auth-foot {
    font-size: 11px;
    color: #9aa0a9;
    margin: 20px 0 0;
    text-align: center;
}

.auth-foot a {
    color: #85563b;
}

.preview-product {
    display: grid;
    grid-template-columns: minmax(260px,42%) 1fr;
    gap: 26px;
}

.preview-cover {
    background: #f3f4f6;
    border-radius: 12px;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #9aa0a9;
}

.preview-cover img {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
}

.preview-info h2 {
    font-size: 21px;
    line-height: 1.5;
    margin: 12px 0;
}

.preview-price {
    font-size: 28px;
    color: #fa513f;
    font-weight: 850;
}

.preview-info p {
    color: #767e89;
    line-height: 1.8;
    white-space: normal;
}

.preview-info dl {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px;
    font-size: 12px;
    margin: 18px 0;
}

.preview-info dt {
    color: #9299a3;
}

.preview-info dd {
    margin: 0;
    color: #444b54;
}

.preview-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.preview-gallery img {
    width: 160px;
    height: 115px;
    object-fit: cover;
    border-radius: 8px;
    background: #f2f3f5;
}

.preview-gallery figure {
    margin: 0;
}

.preview-gallery figcaption {
    font-size: 11px;
    color: #777;
    margin-top: 4px;
}

.preview-section {
    border-top: 1px solid var(--line);
    padding: 20px 0;
}

.preview-section h3 {
    margin: 0 0 14px;
    font-size: 15px;
}

.preview-attributes {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}

.preview-attributes>div {
    padding: 12px;
    background: #fafbfc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.preview-attributes strong {
    font-size: 11px;
    color: #858d98;
}

.preview-attributes span {
    font-size: 12px;
    word-break: break-word;
}

@media(max-width:1100px) {

    .stat-grid {
        grid-template-columns: repeat(3,minmax(0,1fr));
    }

    .main-content {
        padding: 24px 20px;
    }

    .sidebar {
        width: 190px;
    }

    .admin-shell {
        grid-template-columns: 190px minmax(0,1fr);
    }

    .detail-item-row {
        grid-template-columns: 1fr 1fr;
    }

    .detail-item-row .remove-item {
        margin: 0;
    }

    .preview-product {
        grid-template-columns: 1fr 1fr;
    }
}

@media(max-width:760px) {

    .topbar {
        height: auto;
        min-height: 62px;
        padding: 12px 15px;
        gap: 12px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .brand strong {
        font-size: 13px;
    }

    .brand small {
        font-size: 10px;
    }

    .admin-identity {
        display: none;
    }

    .admin-shell {
        display: block;
    }

    .sidebar {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 8px 10px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-label,.sidebar-note {
        display: none;
    }

    .nav-link {
        white-space: nowrap;
        min-height: 36px;
        padding: 0 10px;
        margin: 0;
        font-size: 12px;
    }

    .nav-disabled {
        display: none;
    }

    .main-content {
        padding: 20px 12px 30px;
    }

    .page-heading {
        align-items: center;
        margin-bottom: 17px;
    }

    .page-heading h1 {
        font-size: 21px;
    }

    .page-heading .text-link {
        font-size: 11px;
    }

    .panel {
        padding: 16px 13px;
        border-radius: 11px;
    }

    .panel-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .panel-heading h2 {
        font-size: 15px;
    }

    .panel-heading p {
        line-height: 1.7;
    }

    .stat-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 9px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card strong {
        font-size: 25px;
    }

    .stat-card small {
        font-size: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .field-full {
        grid-column: auto;
    }

    .form-actions {
        flex-wrap: wrap;
    }

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

    .input-action .button {
        width: 100%;
    }

    .detail-item-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .detail-item-row .remove-item {
        text-align: left;
    }

    .section-title-row {
        align-items: flex-start;
    }

    .section-title-row .button {
        padding: 0 10px;
    }

    .table-bottom {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .preview-product {
        grid-template-columns: 1fr;
    }

    .preview-cover {
        min-height: 190px;
        max-height: 300px;
    }

    .preview-info h2 {
        font-size: 18px;
    }

    .preview-attributes {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 25px 20px;
    }

    .auth-card h1 {
        font-size: 21px;
    }

    .filter-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .filter-bar input {
        grid-column: 1/-1;
        min-width: 0;
    }

    .filter-bar .button {
        width: 100%;
    }

    .goods-cell {
        min-width: 200px;
    }
}

.text-success {
    color: #16845b!important;
}

.text-warning {
    color: #b86b1c!important;
}

.text-danger {
    color: #c94c42!important;
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}


/* 官方接口验证页面 */
.nav-link-active {
    background: #faf4ef;
    color: var(--brown);
}

.api-test-panel,
.api-result-panel {
    max-width: 1180px;
}

.api-method-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #dcefe3;
    border-radius: 999px;
    background: #f0faf4;
    color: #28794c;
    font-size: 12px;
    white-space: nowrap;
}

.api-doc-note p {
    margin: 6px 0 0;
    line-height: 1.7;
}

.api-doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 10px;
}

.api-test-form {
    gap: 20px;
}

.api-test-section {
    padding-top: 20px;
}

.api-test-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.api-test-section h3 {
    margin-bottom: 16px;
}

.api-credential-note {
    padding-top: 2px;
}

.credential-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #858d98;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.7;
}

.credential-state-ready {
    color: #28794c;
}

.api-test-actions {
    flex-wrap: wrap;
    border-top: 1px solid #eceef2;
    padding-top: 20px;
}

.api-result-message {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 16px;
    border: 1px solid #e2e6ec;
    border-radius: 10px;
    margin-bottom: 20px;
}

.api-result-success {
    background: #f0faf4;
    border-color: #d5eddf;
    color: #236c43;
}

.api-result-warning {
    background: #fff8e9;
    border-color: #f3e0b2;
    color: #8a6220;
}

.api-result-error {
    background: #fff2f0;
    border-color: #f4d3ce;
    color: #a83d34;
}

.api-result-symbol {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.api-result-symbol svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.api-result-message strong {
    display: block;
    font-size: 14px;
    line-height: 1.6;
}

.api-result-message p {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.6;
}

.api-data-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.api-data-item {
    min-width: 0;
    padding: 15px;
    border: 1px solid #eceef2;
    border-radius: 9px;
    background: #fff;
}

.api-data-item span {
    display: block;
    margin-bottom: 7px;
    color: #9299a3;
    font-size: 12px;
}

.api-data-item strong {
    display: block;
    color: #333943;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.api-description-preview {
    padding: 16px;
    border: 1px solid #eceef2;
    border-radius: 9px;
    margin-bottom: 20px;
}

.api-description-preview h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.api-description-preview p {
    margin: 0;
    color: #626974;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.api-raw-response {
    border-top: 1px solid #eceef2;
    padding-top: 16px;
}

.api-raw-response summary {
    color: var(--brown);
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.api-raw-response pre {
    max-height: 480px;
    overflow: auto;
    padding: 14px;
    border-radius: 8px;
    margin-top: 12px;
    background: #171b22;
    color: #e3e7ee;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .api-data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .api-data-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .api-test-panel,
    .api-result-panel {
        padding: 18px;
    }

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

/* Source-account review; no change to existing product save controls. */
.source-import,
.source-diagnostics {
  padding: 12px 0;
}
.source-import summary,
.source-diagnostics summary {
  cursor: pointer;
  color: #734b34;
}
.source-diagnostics pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.source-counts,
.source-analysis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.source-counts span {
  padding: 8px 12px;
  background: #f1f4f8;
  border: 1px solid #dfe5ed;
}
.source-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  margin-top: 16px;
}
.source-card {
  padding: 12px;
  border: 1px solid #dfe5ed;
  background: #fff;
  overflow-wrap: anywhere;
}
.source-card img {
  display: block;
  max-width: 100%;
  height: 110px;
  object-fit: contain;
  margin: 0 auto;
}
.source-card p {
  margin: 8px 0 0;
  font-size: 13px;
}
.collected-images-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
}
.collected-images-controls label { min-width: 180px; }
.collected-images-controls select { display: block; width: 100%; }
.collected-image-card { display: block; color: inherit; text-decoration: none; }
.collected-image-card:hover { border-color: #805339; }
.captured-card-visual { position: relative; flex: none; overflow: hidden; margin: 0 auto; background-repeat: no-repeat; background-color: #201d18; }
.source-card .captured-card-visual img, .captured-card-dialog .captured-card-visual img {
  display: block; max-width: none; margin: 0; object-fit: fill;
}
.captured-card-visual span { display: block; overflow: hidden; white-space: nowrap; line-height: 1.1; text-align: left; }
.captured-card-dialog { border: 0; border-radius: 8px; max-width: 96vw; max-height: 96vh; padding: 18px; }
.captured-card-dialog::backdrop { background: rgba(0, 0, 0, .75); }
.captured-card-dialog > button { display: block; margin: 0 0 12px auto; }

#collected-images-panel > summary { cursor: pointer; font-weight: 700; }
.source-analysis textarea {
  width: 100%;
}
#source-progress {
  padding: 10px 14px;
  color: #1f486f;
  background: #edf5ff;
}

/* Website settings, banners and news management. */
.content-panel { max-width: 1100px; }
.content-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.api-key-fields { display: grid; align-content: start; gap: 10px; }
.api-key-fields input[readonly] { background: #f5f6f8; color: #384150; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.content-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.content-toolbar input { width: min(320px,100%); }
.content-toolbar select { width: 160px; }
.content-image-field { padding: 20px; background: #faf8f5; border: 1px solid #eee6de; border-radius: 12px; display: grid; gap: 14px; }
.content-image-field h3 { font-size: 15px; margin: 0; }
.content-image-field input[type=file] { background: white; }
.logo-preview { max-width: 240px; max-height: 90px; object-fit: contain; }
.banner-preview { width: min(100%,600px); max-height: 300px; object-fit: contain; border-radius: 10px; }
.content-thumb { width: 140px; height: 70px; object-fit: cover; border-radius: 6px; }
.content-subline { display: block; max-width: 330px; margin-top: 7px; color: #888; overflow-wrap: anywhere; }
.content-seo { padding: 18px; border: 1px solid #e9e1d8; border-radius: 10px; }
.content-seo summary { cursor: pointer; color: #75492f; }
.content-seo .form-stack { margin-top: 18px; }
.article-editor { min-height: 380px; line-height: 1.9; }
.content-pagination { display: flex; justify-content: center; align-items: center; gap: 18px; padding-top: 22px; font-size: 14px; color: #777; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
@media(max-width:700px) { .content-form-grid { grid-template-columns: minmax(0,1fr); } .content-toolbar { gap: 8px; } .content-toolbar input { flex: 1; min-width: 150px; } .content-toolbar select { width: 125px; } .content-image-field { padding: 14px; } }
.admin-site-logo { width: 90px; max-height: 40px; object-fit: contain; flex-shrink: 0; }
.form-stack .checkbox-row { flex-direction: row; justify-content: flex-start; align-items: center; }
@media(max-width:760px) { .sidebar { width: 100%; } }

/* V0.2.2: lightweight line icons and flat admin sections. */
.brand-mark {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 0;
    background: transparent;
    color: var(--brown);
}
.brand-mark svg { width: 26px; height: 26px; stroke-width: 1.4; }
.nav-icon { width: 16px; height: 16px; flex-basis: 16px; stroke-width: 1.4; }
.button-icon, .inline-icon, .api-result-symbol svg { stroke-width: 1.4; }
.placeholder-icon { stroke-width: 1.4; }
.nav-link { border-radius: 3px; }
.panel, .stat-card, .auth-card { border-radius: 6px; box-shadow: none; }
.button, input, select, textarea, .alert { border-radius: 4px; }
.status, .api-method-badge { border-radius: 3px; }
.quick-import-form {
    padding: 0 0 20px;
    margin: 0 0 20px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}
.content-image-field, .content-seo, .detail-section-editor,
.api-description-preview, .api-result-message, .source-image-reference {
    padding: 18px 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.detail-item-row, .preview-attributes > div, .api-data-item, .source-card {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.detail-item-row, .preview-attributes > div { padding-left: 0; padding-right: 0; }
.api-result-success, .api-result-warning, .api-result-error { background: transparent; }
.preview-cover, .preview-gallery img, .banner-preview, .content-thumb,
.thumb-small, .gallery-item, .cover-preview img { border-radius: 3px; }
.source-counts span { border: 0; background: #f6f7f8; padding: 5px 8px; }
.filter-bar input { width: auto; flex: 1 1 280px; }
.filter-bar select { width: 180px; flex: 0 1 180px; }
@media(max-width:760px) {
    .filter-bar input { width: 100%; }
    .filter-bar select { width: 100%; min-width: 0; }
    .content-image-field, .content-seo, .detail-section-editor { padding: 16px 0; }
}

/* V0.2.6: separate row action targets; retain flat lightweight styling. */
.row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 280px;
    white-space: normal;
}
.row-actions > .inline-form {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
}
.row-actions > .text-link,
.row-actions .text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 36px;
    padding: 6px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}
.row-actions > .text-link:hover,
.row-actions .text-button:hover { background: #f7f1eb; }
.row-actions > .text-link:focus-visible,
.row-actions .text-button:focus-visible {
    outline: 2px solid var(--brown);
    outline-offset: 2px;
}
.row-actions > .row-action-danger {
    padding-left: 14px;
    margin-left: 2px;
    border-left: 1px solid var(--line);
}
.row-actions .danger-text { color: #bc4038; }
.row-actions .danger-text:hover { background: #fff1ef; color: #a6312a; }
@media(max-width:760px) {
    .row-actions > .text-link,
    .row-actions .text-button { min-height: 44px; }
}

/* Keep the detail editor grid stable; rich-text styling remains available to news content only. */
.tox.tox-tinymce { max-width: 100%; border-radius: 0; }
.detail-item-row > label { min-width: 0; }
#editor-settings { margin-top: 24px; }

/* V0.2.8: role presets stay flat and wrap on narrow screens. */
.role-template-actions { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }

/* V0.2.12: consistent outer spacing and record IDs. */
.main-content { padding-left:5px; padding-right:5px; max-width:none; margin:0; }
.main-content > .content-panel { max-width:none; }
.record-id { width:64px; min-width:56px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.password-panel .form-stack { max-width:520px; }

/* Keep native hidden semantics inside the reader's action row. */
#source-verification[hidden],
#source-verification [hidden] {
    display: none !important;
}

.source-item-references { grid-column: 1 / -1; overflow-wrap: anywhere; }

.account-card-results { display: grid; gap: 10px; margin-top: 16px; }
.account-card-results > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0f3; }
.account-card-results strong { min-width: 60px; }
.account-card-results [data-card-preview] { display: inline-flex; align-items: center; gap: 8px; color: #765039; }
.account-card-results [data-card-preview][hidden] { display: none; }
.account-card-results [data-card-preview] img { display: block; width: 90px; height: 72px; object-fit: cover; object-position: center top; background: #f8f7f4; border: 1px solid #e7ddd0; }
.account-source-details > summary { cursor: pointer; padding: 12px 0; color: #87613c; }

.partner-admin-identity { display: flex; align-items: center; gap: 10px; }
.partner-admin-identity img { border-radius: 50%; object-fit: cover; }


/* V0.2.43: goods-operation notices use a modal instead of a page-top alert. */
.admin-message-dialog,
.portal-message-dialog {
    width: min(440px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    border: 0;
    border-radius: 14px;
    padding: 0;
    color: #252525;
    box-shadow: 0 18px 60px rgba(0,0,0,.22);
}
.admin-message-dialog::backdrop,
.portal-message-dialog::backdrop { background: rgba(20,24,30,.48); }
.admin-message-content,
.portal-message-content { padding: 24px; }
.admin-message-content h2,
.portal-message-content h2 { margin: 0 0 12px; font-size: 18px; }
.admin-message-content p,
.portal-message-content p { margin: 0 0 22px; line-height: 1.75; overflow-wrap: anywhere; }
.admin-message-content button,
.portal-message-content button { min-width: 96px; }

.cover-preview img[src^="/uploads/account-cards/"] { object-position: left top; }
