/* ============================================================
   components.css —— UI 组件库（全站可复用组件）
   按钮 / 标签 / 图标 / 卡片 / 面板 / 表单 / 选项卡 / 筛选
   手风琴 / 提示条 / 步骤条 / 表格 / 分页 / 骨架屏 / 空状态
   Toast / Modal / 面包屑
   依赖：variables.css、base.css
   来源：UI系统示范文件不能修改.html
   ============================================================ */

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 23px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 750;
    transition: .2s transform, .2s background, .2s box-shadow;
    white-space: nowrap
}
.btn:hover {
    transform: translateY(-2px)
}
.btn-primary {
    background: var(--brand);
    color: #fff
}
.btn-primary:hover {
    background: #393c89;
    color: #fff;
    box-shadow: 0 9px 20px rgba(36,39,103,.18)
}
.btn-outline {
    border-color: var(--brand);
    color: var(--brand);
    background: #fff
}
.btn-outline:hover {
    background: var(--brand-light)
}
.btn-soft {
    background: var(--brand-light);
    color: var(--brand)
}
.btn-ghost {
    background: transparent;
    color: var(--brand)
}
.btn-accent {
    background: var(--accent);
    color: #171842
}
.btn-accent:hover {
    background: #ff917a;
    color: #171842
}
.btn:disabled {
    opacity: .36;
    cursor: not-allowed;
    transform: none
}
.btn-sm {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13px
}
.btn-lg {
    min-height: 54px;
    padding: 12px 30px
}

/* ---------- 标签 pill ---------- */
.pill {
    display: inline-block;
    border-radius: 100px;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12px;
    padding: 4px 12px;
    font-weight: 700
}
.pill.orange {
    background: #fff0eb;
    color: #bc4b37
}
.pill.green {
    background: #e7f7f1;
    color: #16745b
}
.pill.gray {
    background: #f1f2f5;
    color: #777e92
}

/* ---------- 图标 ---------- */
.icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}
.iconbox {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--brand-light)
}
.iconbox .icon {
    width: 26px;
    height: 26px
}

/* ---------- 面板 / 卡片 ---------- */
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden
}
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .22s, box-shadow .22s, border-color .22s
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: #d5d9ed
}
.card-body {
    padding: 23px
}
.card-body h3 {
    font-size: 19px;
    margin: 12px 0 8px;
    line-height: 1.4
}
.card-body p {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 18px;
    min-height: 43px
}
.card-bottom {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px
}
.card-bottom a {
    color: var(--brand);
    font-weight: 750
}
.meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}
.micro {
    font-size: 12px;
    letter-spacing: 1.4px;
    color: var(--muted);
    font-weight: 700
}

/* ---------- 表单 ---------- */
.field label {
    font-size: 13px;
    font-weight: 750;
    display: block;
    margin-bottom: 7px
}
.field input,
.field select,
.field textarea,
.search-control {
    width: 100%;
    border: 1px solid #dce0ed;
    border-radius: 9px;
    background: #fff;
    min-height: 46px;
    padding: 10px 13px;
    color: var(--text);
    outline: none;
    transition: .2s border, .2s box-shadow
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.search-control:focus {
    border-color: #797bb3;
    box-shadow: 0 0 0 3px #eeeeff
}
.field textarea {
    resize: vertical;
    min-height: 112px
}
.hint {
    font-size: 12px;
    color: var(--subtle);
    display: block;
    margin-top: 5px
}
.field.error input {
    border-color: var(--error)
}
.field.error .hint {
    color: var(--error)
}

/* ---------- 选项卡 ---------- */
.tab-list {
    display: flex;
    border-bottom: 1px solid var(--line);
    gap: 24px;
    overflow: auto
}
.tab-list button {
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    padding: 12px 1px;
    white-space: nowrap;
    border-bottom: 3px solid transparent
}
.tab-list button[aria-selected="true"] {
    color: var(--brand);
    border-bottom-color: var(--brand)
}
.tab-panel {
    padding: 22px 0 3px
}

/* ---------- 筛选 chips ---------- */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px
}
.filter-chip {
    border: 1px solid var(--line);
    border-radius: 100px;
    background: #fff;
    padding: 7px 15px;
    color: var(--muted);
    font-size: 13px
}
.filter-chip.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff
}

/* ---------- 手风琴 ---------- */
.acc-item {
    border-bottom: 1px solid var(--line)
}
.acc-trigger {
    border: 0;
    background: none;
    width: 100%;
    padding: 18px 0;
    display: flex;
    justify-content: space-between;
    text-align: left;
    gap: 15px;
    color: var(--text);
    font-weight: 730
}
.acc-content {
    display: none;
    padding: 0 0 18px;
    color: var(--muted);
    font-size: 14px
}
.acc-item.open .acc-content {
    display: block
}
.acc-trigger .plus {
    font-size: 20px;
    color: var(--brand)
}
.acc-item.open .plus {
    transform: rotate(45deg)
}

/* ---------- 提示条 alert ---------- */
.alert {
    padding: 14px 17px;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: start
}
.alert.info {
    background: #edf0ff;
    color: #303875
}
.alert.success {
    background: #eaf8f2;
    color: #176d59
}
.alert.warn {
    background: #fff6e7;
    color: #946218
}
.alert.fail {
    background: #fff0f1;
    color: #bb3e53
}
.alert .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    margin-top: 7px
}

/* ---------- 步骤条 ---------- */
.stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    gap: 5px
}
.stepper:before {
    content: "";
    position: absolute;
    top: 18px;
    left: 11%;
    width: 78%;
    border-top: 1px dashed #c3c8dd
}
.step {
    position: relative;
    text-align: center;
    flex: 1
}
.step span {
    margin: auto;
    display: grid;
    place-items: center;
    width: 37px;
    height: 37px;
    border-radius: 50%;
    background: #eef0f8;
    color: var(--muted);
    font-weight: 800;
    border: 2px solid white
}
.step.done span,
.step.current span {
    background: var(--brand);
    color: #fff
}
.step.current span {
    box-shadow: 0 0 0 3px #d8dafa
}
.step p {
    font-size: 13px;
    margin: 10px 0 0
}

/* ---------- 数据表格 ---------- */
.table-wrap {
    overflow: auto
}
.data-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 590px;
    text-align: left
}
.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 13px
}
.data-table th {
    background: var(--surface);
    color: var(--muted)
}
.data-table td:first-child {
    font-weight: 730
}

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    gap: 6px
}
.pager button {
    width: 37px;
    height: 37px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px
}
.pager button.current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff
}

/* ---------- 骨架屏 ---------- */
.skeleton {
    height: 15px;
    background: linear-gradient(90deg, #f1f2f8 20%, #e6e9f4 44%, #f1f2f8 70%);
    background-size: 200% 100%;
    animation: loading 1.6s infinite;
    border-radius: 4px
}
@keyframes loading {
    to {
        background-position-x: -200%
    }
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 36px;
    color: var(--muted)
}
.empty-state .empty-icon {
    font-size: 38px;
    color: #b4bad0
}
.empty-state h3 {
    color: var(--text);
    margin: 8px
}

/* ---------- Toast 轻提示 ---------- */
.toast-stack {
    position: fixed;
    right: 23px;
    bottom: 25px;
    z-index: 201;
    display: grid;
    gap: 8px
}
.toast {
    color: #fff;
    background: var(--brand-deep);
    padding: 13px 18px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 13px
}

/* ---------- Modal 弹窗 ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13,18,52,.62);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px
}
.modal-backdrop.open {
    display: flex
}
.modal {
    background: #fff;
    border-radius: 19px;
    max-width: 510px;
    width: 100%;
    padding: 31px;
    box-shadow: 0 30px 60px rgba(10,13,49,.23)
}
.modal h3 {
    margin: 0 0 9px;
    font-size: 23px
}
.modal p {
    color: var(--muted)
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px
}
.modal-close {
    float: right;
    border: 0;
    background: transparent;
    font-size: 25px;
    line-height: 1;
    color: var(--muted)
}

/* ---------- 面包屑 breadcrumb ---------- */
.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    padding: 0;
    list-style: none
}
.breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 8px
}
.breadcrumb li + li:before {
    content: "/";
    color: var(--subtle)
}
.breadcrumb a:hover {
    color: var(--brand)
}
.breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 700
}
