/* ========== CSS 变量（全局色板） ========== */
:root {
    /* 品牌色 */
    --primary: #FF5042;

    /* 功能色 */
    --operate: #0052D9;
    --operate-hover: #0044b8;
    --success: #52C41A;
    --success-hover: #49b018;
    --warning: #E6A23C;
    --warning-hover: #d4942f;
    --danger:#FF4D4F;
    --gray: #999999;
    /* 文字 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: #4C4C4C;
    --text-dark: #191919;
    --text-black: #000000;

    /* 背景 */
    --bg-page: #F6F6F6;
    --bg-white: #FFFFFF;
    --bg-card: #FAFAFA;
    /* 主色 10% 背景色 */
    --primary-bg: color-mix(in srgb, var(--primary) 10%, transparent);
    --success-bg: color-mix(in srgb, var(--success) 10%, transparent);
    --warning-bg: color-mix(in srgb, var(--warning) 10%, transparent);
    --danger-bg:  color-mix(in srgb, var(--danger) 10%, transparent);
    --gray-bg:    color-mix(in srgb, var(--gray) 10%, transparent);
    
    /* 边框 */
    --border-color: #E5E5E5;
    --border-light: #CCCCCC;
    --border-bg:    color-mix(in srgb, var(--border-color) 30%, transparent);

    /* 圆角 */
    --radius-lg: 10px;
    --radius-md: 6px;
    --radius-sm: 3px;

    /* 间距 */
    --space-xs: 0.3rem;
    --space-sm: 0.5rem;
    --space-md: 0.8rem;
    --space-lg: 1.4rem;
    --space-xl: 2.0rem;

    /* Bootstrap 5 变量覆盖 */
    --bs-primary: var(--primary);
    --bs-primary-rgb: 255, 80, 66;
    --bs-link-color: var(--primary);
    --bs-link-hover-color: #E6463A;
    --bs-nav-link-font-size: 14px;
}
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-light { color: var(--text-light) !important; }
.text-dark { color: var(--text-dark) !important; }
.text-black { color: var(--text-black) !important; }
.primary-bg { background: var(--primary-bg) !important; }
.success-bg { background: var(--success-bg) !important; }
.warning-bg { background: var(--warning-bg) !important; }
.danger-bg { background: var(--danger-bg) !important; }
.gray-bg { background: var(--gray-bg) !important; }
.border-bg { background: var(--border-bg) !important; }
.border-color { border-color: var(--border-color) !important; }
.border-light { border-color: var(--border-light) !important; }

.br10 { border-radius: var(--radius-lg); }
.br6 { border-radius: var(--radius-md); }
.br3 { border-radius: var(--radius-sm); }
.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-danger  { background: var(--danger-bg);  color: var(--danger); }
.tag-gray    { background: var(--gray-bg);    color: var(--gray); }

/* ========== 状态圆点 badge ========== */
.dot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.dot-badge-primary { background: var(--primary-bg); }
.dot-badge-primary::before { background: var(--primary); }
.dot-badge-success { background: var(--success-bg); }
.dot-badge-success::before { background: var(--success); }
.dot-badge-warning { background: var(--warning-bg); }
.dot-badge-warning::before { background: var(--warning); }
.dot-badge-danger  { background: var(--danger-bg); }
.dot-badge-danger::before  { background: var(--danger); }
.dot-badge-gray    { background: var(--gray-bg); }
.dot-badge-gray::before    { background: var(--gray); }

/* ========== 段落标题  ========== */
.section-title {
    margin: 0;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--text-primary);
}
.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: #E6463A;
    --bs-btn-hover-border-color: #E6463A;
    --bs-btn-active-bg: #CC3D33;
    --bs-btn-active-border-color: #CC3D33;
}

.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0rem rgba(255, 80, 66, 0.25) !important;
}

.form-check-input {
    width: 18px !important;
    height: 18px !important;
    border-radius: 2px !important;
    border-color: var(--border-color) !important;
}

.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(255, 80, 66, 0.25) !important;
}

.table-checkbox {
    width: 18px;
    height: 18px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    outline: none;
    box-shadow: none;
    background: var(--bg-white);
}

.table-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.table-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--bg-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: block;
}

.permission-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
    width: 60px !important;
}

.permission-checkbox {
    width: 14px;
    height: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    outline: none;
    box-shadow: none;
    background: var(--bg-white);
}

.permission-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.permission-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: block;
}

.user-info-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
}

.user-info-text:hover {
    color: var(--primary);
    text-decoration: none;
}

.empty-component {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5rem 0;
}

.empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-content img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.empty-text {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

html {
    font-size: 14px;
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MiSans';
    font-size: 14px;
    font-weight: 300;
    color: var(--text-primary);
    background: var(--bg-page);
}

/* ========== 工具栏 ========== */
.toolbar {
    margin-bottom: var(--space-lg);
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.toolbar button {
    padding: 0.6rem 1.1rem;
    background: var(--primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.toolbar button:hover {
    opacity: 0.9;
}

.toolbar input {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 14.3rem;
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 0.1rem 0.7rem rgba(0, 0, 0, 0.1);
    margin-bottom: var(--space-lg);
}

.card h3 {
    color: var(--primary);
    margin-bottom: var(--space-md);
}

.card .number {
    font-size: 1.7rem;
    color: var(--text-primary);
    font-weight: bold;
}

/* ========== Dashboard ========== */
.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

/* ========== 详情页 ========== */
.detail-info {
    background: var(--bg-white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 0.1rem 0.7rem rgba(0, 0, 0, 0.1);
}

/* ========== 收银台 ========== */
.cashier-container {
    display: grid;
    grid-template-columns: 1fr 21.4rem;
    gap: var(--space-lg);
}

.scan-area {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.scan-area input {
    flex: 1;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.scan-area button {
    padding: 0.7rem 1.4rem;
    background: var(--operate);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.checkout-area {
    background: var(--bg-page);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
}

.total-info {
    margin-bottom: var(--space-lg);
}

.total-info p {
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
}

.payment-method {
    margin-bottom: var(--space-lg);
}

.payment-method select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.member-info {
    margin-bottom: var(--space-lg);
    display: flex;
    gap: var(--space-md);
}

.member-info input {
    flex: 1;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.member-info button {
    padding: 0.7rem 1.4rem;
    background: var(--primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.checkout-btn {
    width: 100%;
    padding: 1.1rem;
    background: var(--primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.checkout-btn:hover {
    opacity: 0.9;
}

button[disabled],
.btn[disabled] {
    background: var(--border-color) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
    cursor: not-allowed !important;
    opacity: 1;
    pointer-events: none;
}

button.loading,
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

button.loading::after,
.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.filter-btn-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border-radius: var(--radius-sm);
    justify-content: flex-end;
}

.filter-btn {
    height: 2.6rem;
    padding: 0 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--primary);
    color: var(--bg-white);
    transition: opacity 0.2s;
}

.filter-btn:hover {
    opacity: 0.9;
}

.create-btn {
    height: 2.6rem;
    padding: 0 1rem;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-white);
    color: var(--primary);
    transition: opacity 0.2s;
}

.create-btn:hover {
    opacity: 0.9;
}

.filter-bar {
    display: flex;
    align-items: center;
 }

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
}

.filter-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.filter-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}
.filter-grid-6 {
    grid-template-columns: repeat(6, 1fr);
}
.filter-grid-inline {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-grid-inline .filter-item {
    flex: 1;
    min-width: 0;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0 0.6rem;
    height: 2.9rem;
    background: rgba(229, 229, 229, 0.3);
    border-radius: var(--radius-sm);
}

.filter-item label {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-item input {
    flex: 1;
    padding: 0;
    border: none;
    font-size: 1rem;
    color: var(--text-dark);
    background: transparent;
    outline: none;
}

.filter-item input::placeholder {
    color: rgba(102, 102, 102, 0.6);
    font-weight: 300;
}

.filter-item select {
    flex: 1;
    padding: 0;
    border: none;
    font-size: 1rem;
    color: var(--text-dark);
    background: transparent;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
}

.search-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-area input,
.search-area select {
    height: 2.9rem;
    padding: 0 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--text-dark);
    background: rgba(229, 229, 229, 0.3);
    outline: none;
    cursor: pointer;
}

.search-area input::placeholder {
    color: rgba(102, 102, 102, 0.6);
}

.search-area select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.search-area label {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.col-max-80 { max-width: 5.7rem; }
.col-max-100 { max-width: 7.1rem; }
.col-max-120 { max-width: 8.6rem; }
.col-max-140 { max-width: 10.0rem; }
.col-max-160 { max-width: 11.4rem; }
.col-max-180 { max-width: 12.9rem; }
.col-max-200 { max-width: 14.3rem; }
.col-max-250 { max-width: 17.9rem; }
.col-max-300 { max-width: 21.4rem; }
.id-col { width: 5rem; min-width: 5rem; }
.col-w-50 { width: 5.0rem; min-width: 5.0rem; }
.col-w-60 { width: 6.0rem; min-width: 6.0rem; }
.col-w-70 { width: 7.0rem; min-width: 7.0rem; }
.col-w-80 { width: 8.0rem; min-width: 8.0rem; }
.col-w-90 { width: 9.0rem; min-width: 9.0rem; }
.col-w-100 { width: 10.0rem; min-width: 10.0rem; }
.col-w-110 { width: 11.0rem; min-width: 11.0rem; }
.col-w-120 { width: 12.0rem; min-width: 12.0rem; }
.col-w-130 { width: 13.0rem; min-width: 13.0rem; }
.col-w-140 { width: 14.0rem; min-width: 14.0rem; }

.table-header-wrapper {
    flex-shrink: 0;
    background: var(--bg-page);
    margin-top: 1.2rem;
}

.table-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    margin-top: 1.2rem;
    position: relative;
    background: var(--bg-white);
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.table-body-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    background: var(--bg-white);
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.action-col.fixed-right {
    position: sticky;
    right: 0;
    z-index: 2;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.05);
}

/* ========== 横向滚动表格：列过多时滚动，操作列固定在右侧 ========== */
/* 用法：wrapper 加 .table-scroll-wrap，table 加 .table-scrollable，操作列 th/td 加 .sticky-col */
.table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scrollable {
    width: auto;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.table-scrollable th,
.table-scrollable td {
    padding: 0.8rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 400;
    text-align: left;
    color: var(--text-primary);
    background: var(--bg-white);
}

.table-scrollable th {
    background: var(--bg-page);
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-scrollable tr:hover td {
    background: rgba(255, 80, 66, 0.03);
}

.table-scrollable .sticky-col {
    position: sticky;
    right: 0;
    z-index: 1;
    /* 左侧渐变阴影 — 未滚动时被相邻列背景遮盖，滚动后可现 */
    box-shadow: -8px 0 16px -6px rgba(0, 0, 0, 0.04),
                -3px 0 6px -3px rgba(0, 0, 0, 0.01);
}

.table-scrollable thead .sticky-col {
    z-index: 3;
    background: var(--bg-page);
}

.table-scrollable td.sticky-col {
    background: var(--bg-white);
}

.table-scrollable tr:hover td.sticky-col {
    background: rgba(255, 80, 66, 0.03);
}

/* 选中行也要把 sticky-col 带上 */
.table-scrollable tr.selected-row td,
.table-scrollable tr.selected-row td.sticky-col {
    background: rgba(255, 80, 66, 0.05);
}

.table-scrollable .select-col {
    width: 3.4rem;
    text-align: center;
}

.table-scrollable .center-col {
    text-align: center;
}

.table-scrollable .action-col,
.data-table .action-col,
.data-table .action-col-10 {
    font-size: 0.9rem;
}
/* 首列左侧增加间距 */
.table-scrollable th:first-child,
.table-scrollable td:first-child {
    padding-left: 1.5rem;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table .action-col {
    width: 8.0rem;
    text-align: left;
    padding-left: 0.8rem;
}
.data-table .action-col-10 {
    width: 10.0rem;
    text-align: left;
    padding-left: 0.8rem;
}
.data-table .select-col {
    width: 3.4rem;
    text-align: center;
}

.data-table .center-col {
    text-align: center;
}
/* 首列左侧增加间距 */
.data-table th:first-child,
.data-table td:first-child {
    padding-left: 1.5rem;
}
.table-edit-link {
    color: var(--primary) !important;
    text-decoration: none;
    font-size: 1.0rem;
    margin-left: 0.5rem;
}

.table-edit-link:hover {
     text-decoration: underline;
}


.data-table th,
.data-table td {
    padding: 0.8rem 0.6rem;
    text-align: left;
    /* border-bottom: 1px solid var(--border-color); */
    border-left: none;
    border-right: none;
    font-size: 1rem;
    font-weight: 400;
}

.data-table th {
    background: var(--bg-page);
    font-weight: 400;
    color: var(--text-muted);
    /* border-bottom: 1px solid var(--border-color); */
    position: sticky;
    top: 0;
    z-index: 1;
}
 
.data-table td {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
    background: rgba(255, 80, 66, 0.03);
}

.date-range {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}

.date-input-wrapper {
    position: relative;
    flex: 1;
}

.date-input-wrapper input {
    width: 100%;
    /* padding-right: 1.0rem; */
}

.date-clear {
    position: absolute;
    right: 0rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.date-input-wrapper:hover .date-clear,
.date-clear:hover {
    opacity: 1;
}

/* daterangepicker 日期选择器 */
.calendar-table thead{
    height: 70px;
}
.calendar-table tbody tr .available{
    border: 4px solid transparent;
    min-width: 34px !important;
    height: 30px !important;
    font-size: 14px !important;
}
.calendar-table .table-condensed .month{
    position: relative;
 }
.calendar-table .table-condensed .monthselect{
    position: absolute;
    top: 5px;
    left: 55%;
    width: 40%;
    height: 25px;
    padding-left: 16px;
    border-color: var(--border-color);
    /* transform: translateX(56%); */
}
.calendar-table .table-condensed .yearselect{
    position: absolute;
    top: 5px;
    left: 5%;
    width: 40%;
    height: 25px;
    padding-left: 12px;
    border-color: var(--border-color);

    /* transform: translateX(-58%); */
}
.daterangepicker select.monthselect,
.daterangepicker select.yearselect,
.daterangepicker select.hourselect,
.daterangepicker select.minuteselect {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.3rem center !important;
    cursor: pointer !important;
    outline: none !important;
    height: 25px !important;
}
.daterangepicker select.hourselect,
.daterangepicker select.minuteselect{
    width: 40% !important;
    background-color: var(--bg-white) !important;
    border-color: var(--border-color) !important;
    text-align: center !important;
    line-height: 25px !important;
    padding: 0 !important;
 }

.calendar-table .table-condensed .prev span, 
.calendar-table .table-condensed .next span {
    border-width: 0 1px 1px 0 !important;
}
.daterangepicker .table-condensed td.active{
    background-color: var(--primary) !important;
 }
.daterangepicker .drp-buttons .btn{
    font-weight: normal !important;
}
.daterangepicker {
    border:none !important;
    box-shadow: 0 0 20px 0px rgba(0,0,0,0.05);
}
.daterangepicker:before{
    border-bottom: none !important;
}

/* ============================================================
   自定义下拉(select-enhance.js)：触发器透明融入 + 面板fixed无边框白底阴影选中主色
   面板 position:fixed 脱离父级 overflow 不遮挡；全局自动增强所有 select
   ============================================================ */
.dpn-select {
    position: relative;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.dpn-select-trigger {
    width: 100%;
    height: 2.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    outline: none;
}

/* 表单域内的增强下拉保持原生 select 的边框 */
.form-field .dpn-select-trigger {
    padding: 0 0.7rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
}

.dpn-select-trigger:focus {
    outline: none;
    box-shadow: none;
}

.dpn-select-trigger.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.dpn-select-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    font-size: 1rem;
}

.dpn-select-arrow {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
    width: 0.8rem;
    height: 0.8rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease;
}

.dpn-select-trigger {
    position: relative;
    padding-right: 1.5rem;
}
.dpn-select-trigger[aria-expanded="true"] .dpn-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* 面板：fixed 脱离父级overflow不遮挡，无边框 + 白底 + 细阴影 + 圆角 */
.dpn-select-panel {
    position: fixed;
    z-index: 9999;
    display: none;
    background: #fff;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.12);
    padding: 0;
    max-height: 15rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.dpn-select-panel.show {
    display: block;
    border-radius: var(--radius-sm);
}

.dpn-select-item {
    padding: 0.5rem 0.8rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dpn-select-item:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* 选中项主色高亮 */
.dpn-select-item.active {
    background: var(--primary);
    color: #fff;
}

/* 首末项圆角匹配面板，避免选中项主色背景破坏面板顶部/底部圆角 */
.dpn-select-item:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.dpn-select-item:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.dpn-select-item:first-child:last-child {
    border-radius: var(--radius-sm);
}



/* 输入框内置前缀 */
.input-prefix {
    color: var(--text-dark);
    font-size: 1rem;
    margin-right: -0.7rem;
    z-index: 1;
}

/* 弹窗内 select 加边框 */
.common-modal-body .dpn-select-trigger {
    border: 1px solid var(--border-color);
    padding-left: 0.8rem;
}
