/* ============================================================
   前台统一视觉主题（仅样式，不影响任何功能逻辑）
   加载顺序：各页面 <style> 之后引入，用于统一基础元件观感
   ============================================================ */

:root {
    --ui-primary: #ff5d43;
    --ui-primary-light: #ff8a65;
    --ui-text: #1f2937;
    --ui-text-sub: #6b7280;
    --ui-border: #e9ebef;
    --ui-radius: 12px;
    --ui-radius-sm: 10px;
    --ui-shadow: 0 2px 6px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.07);
    --ui-shadow-hover: 0 6px 16px rgba(16, 24, 40, 0.08), 0 16px 40px rgba(16, 24, 40, 0.10);
    --ui-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--ui-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a, button {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

/* 可访问性与交互反馈 */
*:focus-visible {
    outline: 2px solid rgba(255, 93, 67, 0.45);
    outline-offset: 2px;
}

button, .btn {
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease, background-color 0.18s ease;
}

button:not(:disabled):active, .btn:not(:disabled):active {
    transform: scale(0.97);
}

button:disabled, .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* 表单控件统一 */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="color"]),
select,
textarea {
    font-family: inherit;
    border-radius: var(--ui-radius-sm) !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="color"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ui-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 93, 67, 0.12);
}

input::placeholder, textarea::placeholder {
    color: #b8bcc4;
}

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--ui-primary);
}

/* 表格统一 */
table {
    border-collapse: collapse;
}

th {
    font-weight: 600;
    color: var(--ui-text-sub);
    letter-spacing: 0.2px;
}

th, td {
    border-bottom: 1px solid #f1f2f4;
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: #fff8f6;
}

/* 标题字距微调，更接近主流前台观感 */
h1, h2, h3 {
    letter-spacing: 0.2px;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.28);
}
::-webkit-scrollbar-track {
    background: transparent;
}

/* 通用空状态 */
.empty-state {
    color: #9aa0aa;
}

/* 降低动画偏好时保持可用 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
