/**
 * UI组件样式 - 金色主题版
 * Toast、Modal、Loading、表单验证等组件样式
 * 与 art.vnex.cn 风格保持一致
 * 
 * @package VNEX
 * @author  VNEX Team
 * @since   2026-06-15
 */

:root {
    --gold:        #D4A843;
    --gold-hover:  #C49A3A;
    --gold-dim:    rgba(212, 168, 67, 0.30);
    --gold-faint:  rgba(212, 168, 67, 0.10);
    --bg:          #080808;
    --bg-deeper:   #050505;
    --bg-card:     #0E0E0E;
    --white:       #FAFAFA;
    --slate:       #94A3B8;
    --slate-dim:   #647080;
    --border:      rgba(250, 250, 250, 0.08);
    --border-strong: rgba(250, 250, 250, 0.15);
    --success:     #22c55e;
    --warning:     #f59e0b;
    --danger:      #ef4444;
}

/* ==================== Toast提示 ==================== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--success);
    background: rgba(34, 197, 94, 0.10);
}

.toast-error {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.10);
}

.toast-warning {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.10);
}

.toast-info {
    border-left: 4px solid var(--gold);
    background: var(--gold-faint);
}

.toast-icon {
    font-size: 18px;
    font-weight: bold;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info .toast-icon {
    color: var(--gold);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--white);
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--slate-dim);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--white);
}

/* ==================== Modal弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-show {
    opacity: 1;
}

.modal-hide {
    opacity: 0;
}

.modal-dialog {
    background: var(--bg-card);
    border-radius: 2px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    min-width: 320px;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}

.modal-show .modal-dialog {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin: 0;
    font-size: 14px;
    color: var(--slate);
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border);
}

/* ==================== Loading加载 ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 8, 8, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    margin-top: 16px;
    font-size: 14px;
    color: var(--slate);
}

/* ==================== 按钮加载状态 ==================== */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ==================== 进度条 ==================== */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 8, 8, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9997;
}

.progress-container {
    width: 400px;
    padding: 30px;
    background: var(--bg-card);
    border-radius: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.progress-percent {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
}

.progress-message {
    font-size: 14px;
    color: var(--slate);
}

.progress-track {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ==================== 表单验证 ==================== */
.field-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.field-valid {
    border-color: var(--success) !important;
}

.field-error-message {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--danger);
}

/* ==================== 骨架屏 ==================== */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 2px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

.skeleton-image {
    height: 200px;
    margin-bottom: 16px;
}

.skeleton-button {
    height: 40px;
    width: 120px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    color: rgba(255,255,255,0.2);
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 18px;
    color: var(--slate);
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 14px;
    color: var(--slate-dim);
    margin-bottom: 24px;
}

.empty-state-action {
    display: inline-block;
}

/* ==================== 通用按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gold);
    color: #0A0A0A;
    border-color: var(--gold);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--gold-hover);
    border-color: var(--gold-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--slate);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: transparent;
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

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

/* ==================== 标签页组件 ==================== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab-item {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-dim);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.25s ease;
    margin-bottom: -1px;
}

.tab-item:hover {
    color: var(--slate);
}

.tab-item.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* ==================== 开关组件 ==================== */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: rgba(255,255,255,0.6);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--gold);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background: #fff;
}

/* ==================== 文件上传组件 ==================== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 2px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--bg-card);
}

.upload-area:hover {
    border-color: var(--gold-dim);
    background: var(--gold-faint);
}

.upload-area.dragover {
    border-color: var(--gold);
    background: var(--gold-faint);
}

.upload-icon {
    font-size: 48px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    color: var(--white);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 13px;
    color: var(--slate-dim);
}

/* ==================== 下拉选择组件 ==================== */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-deeper);
    color: var(--white);
    cursor: pointer;
    appearance: none;
    transition: all 0.25s ease;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.02);
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--slate-dim);
    pointer-events: none;
}

/* ==================== 复选框组件 ==================== */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 2px;
    background: var(--bg-deeper);
    cursor: pointer;
    accent-color: var(--gold);
}

.checkbox-wrapper label {
    font-size: 14px;
    color: var(--slate);
    cursor: pointer;
}

/* ==================== 单选框组件 ==================== */
.radio-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-wrapper input[type="radio"] {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    background: var(--bg-deeper);
    cursor: pointer;
    accent-color: var(--gold);
}

.radio-wrapper label {
    font-size: 14px;
    color: var(--slate);
    cursor: pointer;
}

/* ==================== 文本域组件 ==================== */
.textarea-wrapper textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-deeper);
    color: var(--white);
    resize: vertical;
    min-height: 100px;
    transition: all 0.25s ease;
}

.textarea-wrapper textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.02);
}

/* ==================== 数字输入框组件 ==================== */
.number-input {
    display: flex;
    align-items: center;
    background: var(--bg-deeper);
    border: 1px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.number-input button {
    width: 40px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--slate);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.number-input button:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.number-input input {
    flex: 1;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--white);
    text-align: center;
    font-size: 14px;
    outline: none;
}

/* ==================== 时间选择器组件 ==================== */
.time-picker {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-deeper);
    color: var(--white);
    transition: all 0.25s ease;
}

.time-picker:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.02);
}

/* ==================== 日期选择器组件 ==================== */
.date-picker {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-deeper);
    color: var(--white);
    transition: all 0.25s ease;
}

.date-picker:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.02);
}
