:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f59e0b;
    --text: #1f2937;
    --background: #f8fafc;
    --card: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.logo p {
    font-size: 12px;
    opacity: 0.8;
}

nav {
    display: flex;
    gap: 5px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
    background: white;
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 40px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.generator-section {
    background: var(--card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.generator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.generator-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.generate-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.theme-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.theme-tag {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.theme-tag:hover {
    background: #e0e0e0;
}

.theme-tag.active {
    background: var(--primary);
    color: white;
}

.color-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.color-card {
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.color-card:hover {
    transform: translateY(-5px);
}

.color-card .color-box {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.color-card .color-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.color-card .color-value {
    font-family: monospace;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.color-card .color-rgb {
    font-family: monospace;
    font-size: 11px;
    color: #999;
}

.color-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.color-action-btn {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.color-action-btn:hover {
    background: white;
}

.preview-section {
    background: var(--card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.preview-demo {
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.preview-demo h4 {
    margin-bottom: 15px;
    font-size: 16px;
}

.preview-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.preview-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.preview-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.preview-card {
    padding: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.3);
}

.preview-card h5 {
    margin-bottom: 8px;
    font-size: 14px;
}

.preview-card p {
    font-size: 13px;
    opacity: 0.8;
}

.palette-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.palette-action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.palette-action-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.palette-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.palette-action-btn.secondary {
    background: #f0f0f0;
    color: #666;
}

.palette-action-btn.secondary:hover {
    background: #e0e0e0;
}

.ai-prompt-section {
    background: var(--card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.ai-prompt-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.ai-prompt {
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    border: 2px dashed #e0e0e0;
}

.upload-section {
    margin-bottom: 25px;
}

.upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.upload-area i {
    font-size: 48px;
    color: #999;
    margin-bottom: 15px;
}

.upload-area p {
    color: #666;
    font-size: 14px;
}

.upload-area input[type="file"] {
    display: none;
}

.uploaded-image {
    max-width: 300px;
    border-radius: 10px;
    margin-top: 15px;
}

.custom-palette-section {
    background: var(--card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.custom-colors {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.custom-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.custom-color-item input[type="color"] {
    width: 60px;
    height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    padding: 2px;
}

.custom-color-item input[type="text"] {
    width: 80px;
    padding: 5px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    text-align: center;
    outline: none;
}

.custom-color-item input[type="text"]:focus {
    border-color: var(--primary);
}

.add-color-btn {
    width: 60px;
    height: 60px;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 24px;
    color: #999;
    transition: all 0.3s ease;
}

.add-color-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.remove-color-btn {
    padding: 3px 8px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

.chinese-colors-section {
    background: var(--card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.search-box {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    margin-bottom: 25px;
}

.search-box:focus {
    border-color: var(--primary);
}

.category-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.category-tag {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.category-tag:hover {
    background: #e0e0e0;
}

.category-tag.active {
    background: var(--primary);
    color: white;
}

.chinese-colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.chinese-color-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chinese-color-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.chinese-color-card .color-box {
    width: 100%;
    height: 100px;
}

.chinese-color-card .color-info {
    padding: 15px;
}

.chinese-color-card .color-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.chinese-color-card .color-pinyin {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.chinese-color-card .color-hex {
    font-family: monospace;
    font-size: 13px;
    color: #666;
}

.chinese-color-card .color-category {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
    margin-top: 8px;
}

.chinese-color-card .add-btn {
    margin-top: 10px;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    width: 100%;
}

.chinese-color-card .add-btn:hover {
    background: var(--secondary);
}

.saved-palettes-section {
    background: var(--card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.saved-palettes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.saved-palette-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.saved-palette-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.saved-palette-card .palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.saved-palette-card .palette-name {
    font-weight: 600;
    color: #333;
}

.saved-palette-card .palette-type {
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
}

.saved-palette-card .palette-colors {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.saved-palette-card .color-chip {
    width: 35px;
    height: 35px;
    border-radius: 6px;
}

.saved-palette-card .palette-actions {
    display: flex;
    gap: 8px;
}

.saved-palette-card .action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

.saved-palette-card .action-btn.view {
    background: #dbeafe;
    color: #3b82f6;
}

.saved-palette-card .action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.modal-content .form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.modal-content .form-group input:focus {
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.modal-actions button.primary {
    background: var(--primary);
    color: white;
}

.modal-actions button.secondary {
    background: #f0f0f0;
    color: #666;
}

footer {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

.user-section {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.points-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: white;
    font-weight: 500;
}

.login-btn, .register-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.login-btn:hover, .register-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.register-btn {
    background: rgba(255, 255, 255, 0.2);
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 15px;
    min-width: 200px;
    margin-top: 10px;
    z-index: 100;
}

.user-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 15px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

.user-menu .user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.user-menu .user-info {
    margin-bottom: 15px;
}

.user-menu .user-info span:first-child {
    display: block;
    font-weight: 600;
    color: #333;
}

.user-menu .user-info .points {
    font-size: 12px;
    color: #f59e0b;
}

.user-menu-items {
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

.user-menu-items a {
    display: block;
    padding: 8px 0;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.user-menu-items a:hover {
    color: var(--primary);
}

.auth-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.auth-switch:hover {
    color: var(--primary);
}

.checkin-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.checkin-status p {
    text-align: center;
    color: #666;
}

.points-log-list {
    max-height: 300px;
    overflow-y: auto;
}

.points-log-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.points-log-item:last-child {
    border-bottom: none;
}

.points-log-item .log-reason {
    font-size: 13px;
    color: #333;
}

.points-log-item .log-date {
    font-size: 11px;
    color: #999;
}

.points-log-item .log-points {
    font-size: 14px;
    font-weight: 600;
}

.points-log-item .log-points.earn {
    color: #10b981;
}

.points-log-item .log-points.spend {
    color: #ef4444;
}

.recharge-rules {
    max-height: 300px;
    overflow-y: auto;
}

.recharge-rule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recharge-rule-item:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.recharge-rule-item.active {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

.recharge-rule-item .rule-info {
    flex: 1;
}

.recharge-rule-item .rule-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.recharge-rule-item .rule-description {
    font-size: 12px;
    color: #999;
}

.recharge-rule-item .rule-points {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.recharge-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.recharge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.points-info {
    margin-top: 20px;
}

.points-rule {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.points-rule span:first-child {
    color: #666;
}

.points-rule span:last-child {
    font-weight: 600;
    color: #ef4444;
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .theme-selector {
        gap: 8px;
    }
    
    .color-preview {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .preview-cards {
        grid-template-columns: 1fr;
    }
    
    .palette-actions {
        flex-direction: column;
    }
    
    .palette-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .chinese-colors-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .custom-colors {
        justify-content: center;
    }
}