/* `public/assets/css/app.css` 自定义样式 */

/* ========================================
   Logo 图标 - 四色星形
   ======================================== */
.logo-icon {
    background: conic-gradient(from 180deg at 50% 50%, #FF4500, #3B82F6, #10B981, #EAB308, #FF4500);
        clip-path: polygon(50% 0%, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0% 50%, 39% 35%);
}

/* ========================================
   基础样式
   ======================================== */

/* 行数限制 */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 平滑滚动 */
html { scroll-behavior: smooth; }

/* 选中文本颜色 */
::selection {
    background-color: #3B82F6;
    color: white;
}

/* ========================================
   组件样式
   ======================================== */

/* 按钮基础 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary { background-color: #3B82F6; color: white; }
.btn-primary:hover { background-color: #2563EB; }

.btn-secondary { background-color: #6B7280; color: white; }
.btn-secondary:hover { background-color: #4B5563; }

.btn-success { background-color: #10B981; color: white; }
.btn-success:hover { background-color: #059669; }

.btn-danger { background-color: #EF4444; color: white; }
.btn-danger:hover { background-color: #DC2626; }

.btn-outline { background-color: transparent; border: 1px solid #D1D5DB; color: #374151; }
.btn-outline:hover { background-color: #F3F4F6; }

/* 输入框 */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-input.error { border-color: #EF4444; }

/* 标签 */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

/* 错误消息 */
.form-error {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #EF4444;
}

/* ========================================
   Deal 卡片
   ======================================== */

.deal-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid #f3f4f6;
}
.deal-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 投票按钮 */
.vote-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}
.vote-btn:hover { background-color: #F3F4F6; }
.vote-btn.voted-up { color: #10B981; }
.vote-btn.voted-down { color: #EF4444; }

/* ========================================
   标签和徽章
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-green { background-color: #D1FAE5; color: #065F46; }
.badge-red { background-color: #FEE2E2; color: #991B1B; }
.badge-yellow { background-color: #FEF3C7; color: #92400E; }
.badge-blue { background-color: #DBEAFE; color: #1E40AF; }
.badge-gray { background-color: #F3F4F6; color: #4B5563; }

/* ========================================
   下拉菜单
   ======================================== */

.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 12rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 50;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #374151;
    transition: background-color 0.2s;
}
.dropdown-item:hover { background-color: #F3F4F6; }

/* ========================================
   模态框
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 0.75rem;
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header { padding: 1rem 1.5rem; border-bottom: 1px solid #E5E7EB; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid #E5E7EB; display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ========================================
   加载动画
   ======================================== */

.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #E5E7EB;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

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

/* ========================================
   分页
   ======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a:hover { background-color: #F3F4F6; }
.pagination .active { background-color: #3B82F6; color: white; }
.pagination .disabled { color: #9CA3AF; pointer-events: none; }

/* ========================================
   Toast 通知
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.toast-success { background-color: #10B981; color: white; }
.toast-error { background-color: #EF4444; color: white; }
.toast-warning { background-color: #F59E0B; color: white; }
.toast-info { background-color: #3B82F6; color: white; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========================================
   响应式工具
   ======================================== */

@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 641px) {
    .hide-desktop { display: none !important; }
}