/**
 * 水晶手串系统 - 页面样式
 * 包含DIY页面和用户中心页面的样式
 */

/* 基础样式重置 */
.luck-sys-page * {
    box-sizing: border-box;
}

/* DIY页面样式 */
.diy-order-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 上部：手围、珠子数、价格 */
.diy-header-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.wrist-size-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.wrist-size-control label {
    font-weight: 500;
    color: #555;
    font-size: 16px;
}

.wrist-size-control select {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s ease;
}

.wrist-size-control select:focus {
    border-color: #667eea;
    outline: none;
}

.summary-info {
    display: flex;
    gap: 30px;
    align-items: center;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.summary-item .label {
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.summary-item .value {
    font-weight: 600;
    color: #333;
    font-size: 18px;
}

.total-price .value {
    color: #e74c3c;
    font-size: 24px;
}

/* 中部：预览区 */
.diy-preview-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.preview-container h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    text-align: center;
}

.bracelet-display {
    position: relative;
    height: 150px;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #667eea;
}

.bracelet-string {
    position: absolute;
    width: 80%;
    height: 6px;
    background: linear-gradient(90deg, #8e44ad, #3498db);
    border-radius: 3px;
    z-index: 1;
}

.beads-container {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.bead-on-string {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f39c12, #e67e22);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    animation: beadAdd 0.6s ease-out;
    border: 2px solid white;
}

@keyframes beadAdd {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(90deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 下部：撤销、搜索、保存 */
.diy-bottom-section {
    display: grid;
    grid-template-columns: 150px 1fr 300px;
    gap: 20px;
    align-items: start;
}

/* 左侧：撤销按钮 */
.undo-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.undo-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #6c757d;
    color: white;
}

.undo-btn:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.undo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 中间：搜索区域 */
.search-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.filter-group select {
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    border-color: #667eea;
    outline: none;
}

.filter-btn, .clear-filter-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    font-weight: 500;
}

.filter-btn {
    background: #667eea;
    color: white;
}

.filter-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.clear-filter-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e1e5e9;
}

.clear-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.beads-grid-container {
    max-height: 400px;
    overflow-y: auto;
}

/* 水晶手串系统 - 现代化页面样式 */

/* 珠子网格样式 */
.beads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.beads-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bead-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bead-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.bead-item.selected {
    border-color: #38a169;
    background: #f0fff4;
    transform: scale(1.05);
}

.bead-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.bead-image {
    text-align: center;
    margin-bottom: 10px;
}

.bead-image img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.bead-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    margin: 0 auto;
    border: 2px solid #e2e8f0;
}

.bead-info {
    text-align: center;
}

.bead-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bead-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #718096;
}

/* 预览珠子样式 */
.preview-bead {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 2px;
    position: relative;
    animation: beadAdd 0.6s ease-out;
    cursor: pointer;
}

.preview-bead img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.preview-bead .bead-placeholder {
    width: 100%;
    height: 100%;
    font-size: 12px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bead-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.preview-bead:hover .bead-tooltip {
    opacity: 1;
}

@keyframes beadAdd {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(90deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 拖拽效果 */
.drag-over {
    background: rgba(102, 126, 234, 0.1) !important;
    border: 2px dashed #667eea !important;
}

/* 模态框内容样式 */
.bead-detail-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.bead-image-large {
    flex-shrink: 0;
}

.bead-image-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
}

.bead-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 48px;
    border: 3px solid #e2e8f0;
}

.bead-info-detail {
    flex: 1;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-row .label {
    font-weight: 600;
    color: #4a5568;
}

.info-row .value {
    color: #2d3748;
}

.info-row .value.price {
    color: #e53e3e;
    font-weight: 600;
}

/* 保存设计样式 */
.saved-design-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.saved-design-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.design-info h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #2d3748;
}

.design-info p {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: #718096;
}

.design-info small {
    color: #a0aec0;
    font-size: 11px;
}

.design-actions {
    display: flex;
    gap: 8px;
}

.load-design-btn,
.delete-design-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-design-btn {
    background: #667eea;
    color: white;
}

.load-design-btn:hover {
    background: #5a67d8;
}

.delete-design-btn {
    background: #e53e3e;
    color: white;
}

.delete-design-btn:hover {
    background: #c53030;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #38a169;
}

.notification.error {
    background: #e53e3e;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 列表视图样式 */
.beads-list .bead-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
}

.beads-list .bead-image {
    margin-bottom: 0;
    flex-shrink: 0;
}

.beads-list .bead-info {
    text-align: left;
    flex: 1;
}

.beads-list .bead-name {
    font-size: 14px;
    margin-bottom: 4px;
}

.beads-list .bead-details {
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .beads-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .bead-item {
        padding: 12px;
    }
    
    .bead-image img,
    .bead-placeholder {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .bead-name {
        font-size: 12px;
    }
    
    .bead-details {
        font-size: 11px;
    }
    
    .preview-bead {
        width: 25px;
        height: 25px;
    }
    
    .preview-bead .bead-placeholder {
        font-size: 10px;
    }
    
    .bead-detail-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .bead-image-large img,
    .bead-placeholder-large {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    .info-row {
        flex-direction: column;
        gap: 4px;
        text-align: left;
    }
}

/* 加载状态样式 */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #718096;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态样式 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #a0aec0;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

/* 工具提示样式 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

[data-tooltip]:hover:before {
    opacity: 1;
}

/* 滚动条样式 */
.beads-container::-webkit-scrollbar {
    width: 8px;
}

.beads-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.beads-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.beads-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 焦点样式 */
.bead-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .bead-item {
        border-width: 3px;
    }
    
    .bead-item:hover {
        border-width: 4px;
    }
    
    .notification {
        border: 2px solid currentColor;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .bead-item,
    .preview-bead,
    .saved-design-item,
    .notification {
        animation: none;
        transition: none;
    }
    
    .spinner {
        animation: none;
    }
} 