:root {
    --bg: #121212;
    --card: #1f1f1f;
    --text: #e9eef3;
    --muted: #9aa4af;
    --green: #22c55e;
    --green-2: #16a34a;
    --danger: #ef4444;
    --danger-dark: #b91c1c;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --blue: #3c82f6;
    --blue-dark: #2563eb;
    --orange: #f97316;
    --orange-dark: #ea580c;
    --grey: #374151;
    --grey-dark: #4b5563;
    --tbl-head: #2a2a2a;
    --scroll-thumb: #3a3a3a;
    --scroll-track: #151515;
    --scrollbar-hover-size: 8px;
    /* Added from app-po.css */
    --border: #262626;
    --input: #151515;
}

*{box-sizing:border-box}

html,body{height:100%}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    /* --- 修改这里 --- */
    padding: 18px 20px;
    padding-top: calc(18px + env(safe-area-inset-top)); /* 关键改动 */
    /* --- 结束修改 --- */
    border-bottom: 1px solid #262626;
}

.logo {
    display: inline-block; /* 新增此行 */
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #2a2a2a url('/xenvera.png') center/cover no-repeat
}

.brand {
    font-weight: 700;
    letter-spacing: .3px
}

.login-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 26px 22px;
    border: 1px solid #2a2a2a;
}

.login-title {
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    margin: 8px 0 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0
}

.label {
    font-size: 13px;
    color: var(--muted)
}

.input, .textarea {
    width: 100%;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid #2c2c2c;
    background: var(--input);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border .15s, background .15s;
}

.input:focus, .textarea:focus, .select:focus {
    border-color: var(--blue);
    background: #101010
}

.textarea {
    resize: vertical;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 16px
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    cursor: pointer;
    color: #cfd6dd;
    font-size: 14px;
}

.check input {
    width: 18px;
    height: 18px;
    accent-color: #03387a;
}

.btn {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 10px;
    background: #022d65;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: transform .04s ease, background .15s ease;
}

.btn:active {
    transform: translateY(1px)
}

.btn:hover {
    background: #03387a;
    color: #fff
}

.btn:disabled{
    opacity:.6;
    cursor:not-allowed
}

.error {
    margin-top: 10px;
    color: #ffb4b4;
    font-size: 13px;
    min-height: 18px
}

a.pill {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    background: #262626;
    color: white;
    text-decoration: none;
}

a.pill:hover {
    background: #2c2c2c;
}

#app {
    display: none;
    padding: 18px 16px 36px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 16px;
    align-items: center; /* <-- 新增这一行来垂直居中所有元素 */
}

.pill {
    appearance: none;
    background: #222;
    color: #e8eef5;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid #2b2b2b;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color .2s;
    line-height: 1;
}

.pill:hover {
    background: #2c2c2c
}

.pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #1a1a1a;
}

.pill.active {
    background: #334155;
    color: white;
}

.pill.danger,
.pill#btn-logout { 
    background: var(--danger); 
}

.pill.danger:hover,
.pill#btn-logout:hover { 
    background: var(--danger-dark); 
}

.panel {
    background: #191919;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 22px;
    color: #e9eef3;
}

.muted {
    color: var(--muted);
    font-size: 14px
}

.nav-btn {
    background: #222;
    color: #e8eef5;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid #2b2b2b;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* --- 新增这一行 --- */
    line-height: 1; 
}

.nav-btn:hover { background: #2c2c2c; }

#btns { display: flex; gap: .8rem; align-items: center; margin-top: 1rem; }
#clear { background: var(--grey); color: var(--text); }
#clear:hover { background: var(--grey-dark); }
#search { margin-left: auto; background: var(--blue); }
#search:hover { background: var(--blue-dark); }
#btn-add-sku { background: var(--orange); }
#btn-add-sku:hover { background: var(--orange-dark); }

.item-card {
    background: var(--card);
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.item-img {
    flex-shrink: 0;
}

.item-img img, .group-head img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

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

.item-info p { margin: .3rem 0; font-size: .95rem; text-align: left }
.item-info p strong { display: inline-block; min-width: 110px; font-weight: 600; color: var(--muted); }
.item-info a { color: #93c5fd; text-decoration:none; }
.item-info a:hover { text-decoration:underline; }

.item-actions { 
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    width: 220px;
}

.item-actions button {
    padding: .5rem .9rem; 
    font-size: .85rem; 
    border: none; 
    border-radius: .5rem; 
    background: var(--grey-dark); 
    color: #fff; 
    cursor: pointer; 
    transition: .2s;
    text-align: center;
}

.item-actions button:hover { 
    filter: brightness(1.2);
}

.item-actions .btn-edit-item { background: var(--blue); }
.item-actions .btn-delete-item { background: var(--danger); }

.group-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .6rem }
.group-head span { font-weight: 600; font-size: 1.1rem; }

.purchase-group, .profit-group {
    background: var(--card);
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.2rem;
}

.profit-summary {
    padding: .6rem 1rem;
    border-bottom: 1px solid #2f2f2f;
    font-size: .9rem;
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
    align-items: center;
}

.profit-summary span strong { margin-left: .3rem; font-weight: 600; color: var(--text); }

.table-scroll { 
    overflow: auto; 
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.table-scroll::-webkit-scrollbar {
    width: var(--scrollbar-hover-size);
    height: var(--scrollbar-hover-size);
}

.table-scroll::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 8px;
}

.table-scroll::-webkit-scrollbar-track {
    background: var(--scroll-track);
}

table { width: 100%; border-collapse: collapse; }

.table-scroll table { font-size: .9rem; table-layout: auto; }

th, .table-scroll th, .table-scroll td {
    border: 1px solid #333;
    padding: .55rem .85rem;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    min-width: 120px;
    vertical-align: middle;
}

th, .table-scroll th { 
    background: var(--tbl-head); 
    font-weight: 600 
}

.table-scroll td.editable { background: #3a321d; }

.right{text-align:right}

.profit-details-table td:first-child {
    font-weight: 600;
    color: var(--muted);
    text-align: right;
    width: 40%;
}

.profit-details-table td:last-child {
    text-align: left;
    color: var(--text);
}

.overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(5px);
    display: none; align-items: center; justify-content: center; z-index: 1000;
}

.modal-box {
    background: var(--card); color: var(--text); border: 1px solid #333;
    border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column;
    max-height: 90vh; width: 92vw; max-width: 820px;
}

.modal-header {
    padding: 1rem 1.2rem; border-bottom: 1px solid #333; display: flex;
    justify-content: space-between; align-items: center; font-weight: 600;
    gap: .75rem;
}

.close-btn {
    border: none; background: var(--grey); color: var(--text); width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; line-height: 32px; text-align: center; font-size: 1rem;
    font-weight: 700; transition: .2s;
}

.close-btn:hover { background: var(--grey-dark) }

.modal-body { 
    padding: 1rem; 
    overflow: auto; 
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.modal-body::-webkit-scrollbar {
    width: var(--scrollbar-hover-size);
    height: var(--scrollbar-hover-size);
}
.modal-body::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; }
.modal-body::-webkit-scrollbar-track { background: var(--scroll-track); }

.modal-footer {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #252525;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.form-grid .field { margin: 0; }
.form-grid .grid-col-span-2 { grid-column: span 2; }

.form-fieldset {
    grid-column: span 2;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 0.8rem;
    margin: 0;
}

.form-fieldset legend {
    padding: 0 0.5rem;
    font-size: 13px;
    color: var(--muted);
}

.fieldset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.fieldset-grid .field { margin: 0; }
.label-sm { font-size: 12px; color: var(--muted); }

.notification-box {
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 90vw;
    max-width: 400px;
    padding: 1.5rem;
    border: 1px solid #333;
    text-align: center;
}

.notification-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.notification-message {
    margin: 0 0 1.5rem;
    line-height: 1.6;
    color: var(--muted);
}

.notification-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.notification-actions .nav-btn {
    flex: 1;
}


.data-status-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 1rem;
    color: var(--muted);
}

.data-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    font-size: 0.9rem;
}

.data-status-item strong {
    color: var(--text);
    font-weight: 600;
}

.data-status-item span {
    color: var(--muted);
}
  

.rates-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 1rem;
    color: var(--muted);
}

.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.rate-card {
    background: #222;
    border: 1px solid #2f2f2f;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.rate-card .currency {
    font-weight: 700;
    font-size: 1.2rem;
}

.rate-card .value {
    font-weight: 300;
    font-size: 1.8rem;
    color: var(--green);
    margin: 0.5rem 0;
}

.rates-updated-time {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
}

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2a2a2a;
    padding: 1rem;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    flex-wrap: wrap;
    text-align: center;
}

#cookie-banner p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

#cookie-banner button {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    background: var(--blue);
    color: white;
    cursor: pointer;
    transition: background-color .2s;
}

#cookie-banner button:hover {
    background: var(--blue-dark);
}

.supplier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: #2a2a2a;
    margin-bottom: 0.5rem;
}

.supplier-item-name {
    font-weight: 600;
}

.supplier-item-actions {
    display: flex;
    gap: 0.5rem;
}

.supplier-item-actions button {
    padding: .4rem .8rem;
    font-size: .8rem;
    border: none;
    border-radius: .5rem;
    color: #fff;
    cursor: pointer;
    transition: .2s;
}

.supplier-item-actions button:hover {
    filter: brightness(1.2);
}

.btn-edit-supplier { background: var(--blue); }
.btn-delete-supplier { background: var(--danger); }

footer {
    padding: 16px;
    border-top: 1px solid #262626;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    margin-top: auto;
}

/* --- Styles from app-po.css --- */

select, .select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-block;
    width: 100%; 
    padding: 11px 36px 11px 12px;
    border-radius: 10px;
    border: 1px solid #2c2c2c;
    background-color: var(--input);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border .15s, background .15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239aa4af'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2em;
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #1a1a1a;
}

.topbar.show{display:flex}
.topbar .nav{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}

.container{
    display:none;width:100%;max-width:1200px;margin:0 auto;
    padding:18px 16px;flex-direction:column;gap:18px
}
.container.show{display:flex}

.card{
    background:var(--card);border:1px solid var(--border);border-radius:var(--radius);
    box-shadow:var(--shadow);padding:18px
}

.actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.inline-check{display:inline-flex;gap:8px;align-items:center}
.hidden{display:none!important}

.login-screen{
    position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
    padding:24px;background:radial-gradient(1200px 800px at 20% -10%,rgba(60,130,246,.22),transparent 60%),radial-gradient(1000px 700px at 120% 20%,rgba(34,197,94,.16),transparent 50%),var(--bg);
}
.login-screen .login-card{
    width:100%;max-width:560px;background:var(--card);border:1px solid var(--border);
    border-radius:18px;box-shadow:var(--shadow);padding:22px
}
.login-screen .login-header{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.login-screen .login-logo{width:40px;height:40px;border-radius:10px;background:#2a2a2a url('/xenvera.png') center/cover no-repeat}
.login-screen .login-title{font-size:18px;font-weight:800}
.login-screen .login-row{display:flex;gap:12px;flex-wrap:wrap}
.login-screen .login-row .field{min-width:200px}
.login-screen .login-actions{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-top:8px}
.login-screen .login-muted{margin-top:6px;color:#a8b3bf;min-height:18px}


/* === [ADDED] Responsive Grid Classes for PO Generator === */
.form-grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
}
.form-grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 1.5rem;
    margin-top: 1rem;
}
.field-span-2 { grid-column: span 2; }
.field-span-3 { grid-column: span 3; }
.form-grid-query {
    grid-template-columns: 2fr 1fr;
    gap: 1rem 1.5rem;
    align-items: flex-end;
}
/* === End of Added Styles === */


/* --- Media Queries --- */

@media(max-width: 768px) {
    .brand {
        display: none; /* 在小屏幕上隐藏文字品牌，仅保留 LOGO */
    }
    .modal-box {
        width: 95vw;
        max-width: 95vw; /* 确保弹窗宽度适应屏幕 */
    }
    .form-grid {
        grid-template-columns: 1fr 1fr; /* 在平板上使用两列表单 */
    }

    /* === [ADDED] PO Generator Responsive Rules (Tablet) === */
    .form-grid-cols-3 { grid-template-columns: 1fr 1fr; }
    .field-span-3 { grid-column: span 2; }
    .form-grid-query { grid-template-columns: 1fr; }
    /* === End of Added Styles === */

    .item-card {
      flex-direction: column;
      align-items: flex-start;
    }
    .item-actions {
      width: 100%;
    }
    .item-img img, .group-head img { width: 70px; height: 70px }
    .item-info p { display: flex; flex-wrap: wrap; margin: .2rem 0; }
    .item-info p strong { min-width: auto; margin-right: .35rem; }
    #btns .nav-btn { flex: 1; padding: .75rem 0; font-size: .95rem; }
    #search { order: 2; margin-left: 0; }
    #clear { order: 1 }

    /* --- [MODIFIED] Dropdown Menu for Toolbar (Mobile Optimization) --- */
    .dropdown-content {
        width: 280px; /* 减小移动端宽度 */
    }
}

@media (max-width:640px){
    /* --- [ADDED] Mobile Padding Optimization --- */
    .topbar {
        padding: 12px 14px;
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    .login-card {
        padding: 22px 18px 18px;
    }
    .panel {
        padding: 16px;
    }
    #app {
        padding: 12px 10px 24px;
    }
    /* --- End of Added Styles --- */

    .field{min-width:100%}
    .login-screen .login-row .field{min-width:100%}
    .form-grid {
        grid-template-columns: 1fr; /* 在手机上使用单列表单 */
    }

    /* === [ADDED] PO Generator Responsive Rules (Mobile) === */
    .form-grid-cols-2, .form-grid-cols-3 { grid-template-columns: 1fr; }
    .field-span-2, .field-span-3 { grid-column: span 1; }
    #card-generate .form-grid { margin-top: 0; } /* Reset top margin for stacked layout */
    /* === End of Added Styles === */

    .form-grid .grid-col-span-2 {
        grid-column: span 1; /* 在单列布局中重置跨列 */
    }
    .form-fieldset {
        grid-column: span 1; /* 在单列布局中重置跨列 */
    }
}

/* --- Dropdown Menu for Toolbar (FIXED) --- */
.dropdown-menu {
    position: relative;
    display: inline-block;
    padding-bottom: 8px; /* This creates a hoverable "bridge" */
}

/* 这里原有的 .dropdown-toggle 样式已被移除，
  因为它会覆盖 .pill 的默认样式。
*/

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 10;
    padding: 12px;
    width: 220px; /* 修改了宽度以适应单列 */
    grid-template-columns: 1fr; /* 修改为单列布局 */
    gap: 10px;
}

.dropdown-menu:hover .dropdown-content {
    display: grid;
}

.dropdown-content .pill {
    text-align: center;
    width: 100%;
}

/* --- 修复 PO 生成页面的布局对齐问题 --- */

/* 为包含“编辑”按钮的标签容器启用 Flex 布局 */
.label-with-btn {
    display: flex;
    justify-content: space-between; /* 让标签文本和按钮分布在两端 */
    align-items: center; /* 垂直居中对齐 */
    width: 100%;
}

/* 按钮的微调样式 */
.label-with-btn .btn-sm {
    padding: 2px 10px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 500;
    margin-left: 8px; /* 与标签文本保持一点距离 */
}

/* 强制所有 .field 容器的内容底部对齐，确保输入框/下拉框都在一条直线上 */
#card-generate .form-grid {
    align-items: end;
}

/* PO 查询详情页表格底部的财务汇总样式 */
.financial-summary td {
    border-color: #333;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.financial-summary tr:first-child td {
    border-top: 2px solid #555; /* 在汇总区上方加一条粗一点的分割线 */
}

.financial-summary strong {
    font-weight: bold;
    color: var(--text);
}
/* --- 在 app.css 文件末尾添加以下代码 --- */

/* 针对“搜索”按钮进行光学微调 */
#search {
    /* 增加顶部内边距，减少底部内边距，将文字向下推移 1px */
    padding-top: 10px;
    padding-bottom: 8px;
}

/* --- 新增的共享样式 --- */
.info-box {
    background: #222;
    border: 1px solid #2f2f2f;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
}
/* === [新增] 利润页表格容器与吸顶表头（与 stock.html 明细一致） === */
.table-wrap {
    margin-top: .8rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: auto;
    background: #151515;
    max-height: 70vh;
}
#profit-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--tbl-head);
}
/* ---【新增】手动垂直微调下拉菜单按钮，以抵消内边距影响 --- */
.toolbar .dropdown-menu {
    /* 通过调整外边距来补偿额外的内边距，实现视觉上的对齐 */
    margin-bottom: -8px;
}
/* --- [新增] 加载动画样式 --- */
#loading-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-out;
}

.progress-bar {
    width: 200px;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, transparent, var(--blue));
    animation: indeterminate-progress 1.5s infinite ease-in-out;
}

@keyframes indeterminate-progress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}
.sku-select-item {
  padding: 0.75rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--bg-secondary);
}
.sku-select-item:hover {
  background-color: var(--bg-tertiary);
}
.sku-select-item.selected {
  background-color: var(--blue);
  color: white;
  font-weight: 600;
}
/* --- 新增：用于长备注截断和弹窗的样式 --- */

/* 截断备注单元格的容器样式 */
.truncated-cell .content-wrapper {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制为2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    max-height: 2.8em; /* 2行的高度 (line-height * 2) */
}

/* “展开”按钮的样式 */
.expand-btn {
    margin-left: 8px;
    font-size: 12px;
    padding: 2px 6px;
    cursor: pointer;
    background: var(--grey);
    border: none;
    color: white;
    border-radius: 4px;
    vertical-align: middle;
    display: inline-block; /* 确保按钮显示 */
}

/* 备注查看弹窗的文本区样式 */
#text-viewer-content {
    white-space: pre-wrap;      /* 保留换行和空格 */
    word-break: break-word;     /* 长单词或URL自动换行 */
    max-height: 60vh;
    overflow-y: auto;
}