/* 商品销售系统样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

/* 密码验证模态框样式 */
.password-modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
}

.password-modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: modalSlideIn 0.5s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.password-header h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.password-header p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#passwordInput {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    outline: none;
}

#passwordInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    display: none;
    background: #f8d7da;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
}

/* 登录信息样式 */
.login-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    justify-content: center;
}

.login-status {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 退出登录按钮样式 */
.logout-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c82333, #dc3545);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.products-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.products-section h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.product-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.product-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #ee5a24, #ff6b6b);
}

.product-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.product-btn h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.product-btn p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: bold;
}

.paypal-btn {
    background: linear-gradient(135deg, #0070ba, #003087);
    color: white;
}

.paypal-btn:hover {
    background: linear-gradient(135deg, #003087, #0070ba);
    transform: translateY(-2px);
}

.cash-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.cash-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
}

.payment-icon {
    font-size: 1.5rem;
}

.payment-text {
    flex: 1;
    text-align: center;
}

.payment-price {
    font-size: 1.2rem;
    font-weight: bold;
}

/* 销售记录样式 */
.sales-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.sales-section h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
    text-align: center;
}

.sales-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.sales-table th,
.sales-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.sales-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
}

.sales-table tr:hover {
    background-color: #f8f9fa;
}

.total-row {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    color: white !important;
    font-weight: bold;
}

.no-sales-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 10px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.export-btn, .sync-btn, .reset-btn, .test-btn, .undo-btn {
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.export-btn:active, .sync-btn:active, .reset-btn:active, .test-btn:active, .undo-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.export-btn:disabled, .sync-btn:disabled, .reset-btn:disabled, .test-btn:disabled, .undo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.undo-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    margin-right: 10px;
}

.undo-btn:hover {
    background: linear-gradient(135deg, #ff5252, #e53935);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.undo-btn:disabled {
    background: linear-gradient(135deg, #ccc, #999);
    color: #666;
}

.export-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.export-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.reset-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #c82333, #dc3545);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.test-btn {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: white;
}

.test-btn:hover {
    background: linear-gradient(135deg, #5a32a3, #6f42c1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.sync-btn {
    background: linear-gradient(135deg, #24292e, #1a1e22);
    color: white;
}

.sync-btn:hover {
    background: linear-gradient(135deg, #1a1e22, #24292e);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* GitHub Gist同步模态框样式 */
.sync-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.sync-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.sync-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.sync-close:hover {
    color: #000;
}

.sync-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.sync-option {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.sync-option h3 {
    margin-bottom: 10px;
    color: #333;
}

.sync-option p {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

.gist-config {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.gist-input {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.9rem;
}

.gist-input:focus {
    outline: none;
    border-color: #24292e;
    box-shadow: 0 0 0 2px rgba(36, 41, 46, 0.1);
}

.upload-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.upload-gist-btn, .update-gist-btn, .download-gist-btn {
    background: linear-gradient(135deg, #24292e, #1a1e22);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    flex: 1;
}

.upload-gist-btn:hover, .update-gist-btn:hover, .download-gist-btn:hover {
    background: linear-gradient(135deg, #1a1e22, #24292e);
    transform: translateY(-1px);
}

.update-gist-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.update-gist-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
}

.gist-result, .download-result {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

.gist-link {
    color: #24292e;
    text-decoration: none;
    font-weight: bold;
}

.gist-link:hover {
    text-decoration: underline;
}

.gist-help {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.gist-help h4 {
    margin-bottom: 10px;
    color: #1976d2;
}

.gist-help ol {
    margin: 0;
    padding-left: 20px;
}

.gist-help li {
    margin-bottom: 5px;
    color: #333;
}

.gist-help a {
    color: #1976d2;
    text-decoration: none;
}

.gist-help a:hover {
    text-decoration: underline;
}

/* 成功消息样式 */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
    
    .sales-table {
        font-size: 0.9rem;
    }
    
    .sales-table th,
    .sales-table td {
        padding: 10px 8px;
    }
    
    /* 密码页面响应式 */
    .password-modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .password-header h2 {
        font-size: 1.5rem;
    }
    
    .password-header p {
        font-size: 0.9rem;
    }
    
    #passwordInput {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .login-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .export-btn, .sync-btn, .reset-btn, .test-btn, .undo-btn {
        width: 100%;
        max-width: 200px;
    }
    
    /* GitHub Gist同步响应式 */
    .sync-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sync-modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}
