/* UX round 1 (2026-11-29): presentation only.
 * No permission, status, route or form-field changes live here.
 * Removing this file (and its <link> in index.php) restores the previous look. */

/* 1. Requirement checklist: neutral before the first submit attempt, red only after. */
.required-status.pending {
    border-color: var(--control-line, #c9c4b8);
    background: var(--ui-surface-subtle, #f6f3ec);
    color: var(--muted, #5f5a52);
    font-weight: 600;
}

/* 2. "有问题" dialog: the conclusion is already chosen; show it as text. */
.ux-conclusion-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0;
}
.ux-text-button {
    min-height: 32px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--brand, #2e4aa3);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
/* The checklist above the buttons already states what is missing. */
dialog[id^="inspect-"] .upload-field-hint {
    display: none;
}

/* 3. Photo preview: photos first, technical file details hidden. */
.upload-preview-grid .upload-preview-meta {
    display: none;
}
.upload-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.upload-preview-head .upload-preview-summary {
    margin: 0;
}
.upload-preview-head .upload-preview-clear {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 4px 8px;
    border-color: transparent;
    background: transparent;
    color: var(--brand, #2e4aa3);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.upload-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.upload-preview-grid .upload-preview-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.upload-preview-grid .upload-preview-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
}
.upload-preview-grid .upload-preview-item button {
    width: 100%;
    min-height: 40px;
}

/* 4. Button hierarchy on inspection / correction cards.
 *    "查看详情" is secondary; "撤销" is a quiet text action, still behind its confirm. */
.compact-ui :is(.dashboard-item-row,.correction-card)[data-inspection-card] :is(.dashboard-item-primary-action,.correction-card-actions) [data-inspection-card-control="view"] {
    background: var(--panel, #fff);
    color: var(--ink, #222);
}
.compact-ui :is(.dashboard-item-row,.correction-card)[data-inspection-card] :is(.dashboard-item-primary-action,.correction-card-actions) [data-inspection-card-control="danger"] {
    border-color: transparent;
    background: transparent;
    min-height: 40px;
    font-size: .8125rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.compact-ui .task-actions-danger {
    display: flex;
    justify-content: center;
}
.compact-ui .task-actions-danger > form,
.compact-ui .task-actions-danger [data-inspection-card-control="danger"] {
    width: auto;
}

/* Desktop table: the three results look equal, so "没问题" is not pre-selected visually. */
.dashboard-item-primary-action [data-quick-result="ok"].primary {
    background: var(--panel, #fff);
    color: var(--ink, #222);
    border: 1px solid var(--control-line, #c9c4b8);
    font-weight: 500;
}
.dashboard-item-primary-action .danger-action {
    border-color: transparent;
    background: transparent;
    color: var(--bad, #a33);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 5. Problem summary on the card (mobile only; desktop already has the column). */
.ux-issue-note {
    display: none;
}
@media (max-width: 820px) {
    .dashboard-item-title .ux-issue-note {
        display: block;
        margin: 8px 0 0;
        padding: 8px 10px;
        border-radius: 6px;
        background: var(--bad-soft, #fbe9e7);
        color: var(--ink, #222);
        font-size: .875rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }
    .dashboard-item-title .ux-issue-note small {
        color: var(--muted, #5f5a52);
        white-space: nowrap;
    }
    /* Problem photo thumbnail + note (2026-11-29 cards). */
    .dashboard-item-title div.ux-issue-note {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .dashboard-item-title .ux-issue-note > span {
        flex: 1;
        min-width: 0;
    }
    .dashboard-item-title .ux-issue-note > span.is-empty {
        color: var(--muted, #5f5a52);
        font-style: italic;
    }
    .dashboard-item-title .ux-issue-thumb {
        position: relative;
        flex: none;
        width: 48px;
        height: 48px;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 8px;
        overflow: hidden;
        background: rgba(0, 0, 0, .06);
        box-shadow: none;
    }
    .dashboard-item-title .ux-issue-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .dashboard-item-title .ux-issue-thumb b {
        position: absolute;
        right: 3px;
        bottom: 3px;
        padding: 0 4px;
        border-radius: 5px;
        background: rgba(15, 23, 42, .7);
        color: #fff;
        font-size: .6875rem;
        line-height: 1.5;
    }
    /* The header store switcher already names the store. */
    .compact-ui .store-name {
        display: none;
    }
}

/* 6. Desktop table: keep short status text on one line instead of one character per line. */
@media (min-width: 821px) {
    .dashboard-item-correction {
        min-width: 5.5em;
        white-space: nowrap;
    }
    .dashboard-item-correction p {
        white-space: normal;
    }
}
