* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* 登录页面布局 */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 主页面布局 */
body.main-page {
    background: #f9fafb;
}

.container {
    display: flex;
    max-width: 1000px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.welcome-section {
    flex: 1;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-section h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.welcome-section p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.features {
    margin-top: 30px;
}

.feature {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.feature i {
    font-style: normal;
    background: rgba(255, 255, 255, 0.2);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.form-section {
    flex: 1.2;
    padding: 50px 40px;
}

.form-container {
    display: none;
}

.form-container.active {
    display: block;
}

.form-header {
    margin-bottom: 30px;
}

.form-header h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

.form-header p {
    color: #666;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #4f46e5;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 40px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
}

.password-requirements {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.password-requirements ul {
    margin-left: 20px;
}

.btn {
    padding: 14px 20px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #4338ca;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.success-message {
    color: #10b981;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.register-link {
    text-align: center;
    margin-top: 20px;
}

.register-link a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.register-link a:hover {
    text-decoration: underline;
}

.logout-btn {
    background: #ef4444;
    padding: 8px 16px;
}

.logout-btn:hover {
    background: #dc2626;
}

/* 主界面容器 */
.main-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background: #f9fafb;
}

/* 主导航栏 */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.main-title {
    color: #4f46e5;
    font-size: 20px;
    margin: 0;
}

.version {
    margin-left: 20px;
    color: blue;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    padding: 8px 12px;
    font-size: 14px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #4b5563;
}

/* 主内容区布局 */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧导航菜单 */
.sidebar {
    width: 200px;
    background: #f3f4f6;
    padding: 20px 0;
}

.sidebar .nav-item {
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    margin-bottom: 5px;
    transition: background 0.3s;
}

.sidebar .nav-item:hover {
    background: #e2e8f0;
}

.sidebar .nav-item.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 右侧内容区 */
.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f9fafb;
}

/* 店铺数据界面样式 */
.store-data-container {
    padding: 20px;
    background: white;
}

/* 搜索栏样式 */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.search-box {
    display: flex;
    align-items: center;
    flex: 1;
}

.search-box input {
    width: 300px;
    margin-right: 10px;
}

.total-amount-display {
    font-size: 16px;
    font-weight: 600;
    color: #4f46e5;
    white-space: nowrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.data-table th {
    background: #4f46e5;
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e1e1e1;
}

.data-table tr:hover {
    background: #f9fafb;
}

.balance-info {
    color: #059669;
    font-weight: 600;
}

.date-info {
    color: #6b7280;
    font-size: 13px;
}

/* 统管提取界面样式 */
.extract-management-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 统管提取表单行 */
.extract-form-row {
    display: flex;
    gap: 25px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    align-items: flex-start;
    max-width: 100%;
}

.extract-form-row .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.extract-form-row .form-group input,
.extract-form-row .form-group select {
    width: 100%;
    max-width: 100%;
}

.extract-form-row .form-group:nth-child(1) {
    flex: 0 0 200px;
}

.extract-form-row .form-group:nth-child(2) {
    flex: 0 0 350px;
}

.extract-form-row .form-group:nth-child(3) {
    flex: 0 0 120px;
}

.extract-form-row .form-group:nth-child(4) {
    flex: 0 0 40px;
    display: flex;
    align-items: flex-start;
    margin-top: 32px;
}

.add-btn-icon {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 38px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.add-btn-icon:hover {
    background: #059669;
    transform: scale(1.05);
}

.extract-table-container {
    margin-top: 5px;
}

/* 统管提取表头样式 */
.extract-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.extract-table-header h4 {
    margin: 0;
    color: #333;
}

.extract-summary-inline {
    display: flex;
    gap: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #4f46e5;
}

.extract-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.extract-table th {
    background: #f1f5f9;
    color: #333;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
}

.extract-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e1e1e1;
}

.extract-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.confirm-extract-btn {
    background: #3b82f6;
    padding: 12px 30px;
}

.confirm-extract-btn:hover {
    background: #2563eb;
}

.balance-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

/* 管理设置子导航 */
.management-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.management-nav-item {
    padding: 10px 20px;
    background: #f3f4f6;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    transition: all 0.3s;
}

.management-nav-item:hover {
    background: #e2e8f0;
}

.management-nav-item.active {
    background: #4f46e5;
    color: white;
}

/* 管理设置界面样式 */
.management-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.management-section h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4f46e5;
}

.user-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 10px;
    background: white;
    margin-top: 15px;
}

.user-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:last-child {
    border-bottom: none;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.role-admin {
    background: #dc2626;
    color: white;
}

.role-supervisor {
    background: #059669;
    color: white;
}

.role-cashier {
    background: #2563eb;
    color: white;
}

.store-selection-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.store-tag {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

/* 对话框样式 */
.dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
}

.dialog-content h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 对话框中的店铺选择列表 */
#storeSelectionDialog .store-selection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

#storeSelectionDialog .store-selection-list label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    margin: 0;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    background: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#storeSelectionDialog .store-selection-list label span {
    flex: 1;
    text-align: left;
}



#storeSelectionDialog .store-selection-list label:hover {
    background: #f8fafc;
    border-color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#storeSelectionDialog .store-selection-list input[type="radio"] {
    margin-left: 8px;
    transform: scale(1.2);
}

#storeSelectionDialog .store-selection-list label.selected {
    background: #eff6ff;
    border-color: #4f46e5;
}

#storeSelectionDialog .store-selection-list label.selected span {
    font-weight: 600;
    color: #4f46e5;
}

.store-tag .remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.delete-btn:hover {
    background: #dc2626;
}

/* 添加管理界面样式 */
.add-management-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.add-btn {
    background: #10b981;
}

.add-btn:hover {
    background: #059669;
}

.import-btn {
    background: #3b82f6;
}

.import-btn:hover {
    background: #2563eb;
}

.template-btn {
    background: #8b5cf6;
}

.template-btn:hover {
    background: #7c3aed;
}

.confirm-btn {
    background: #3b82f6;
}

.confirm-btn:hover {
    background: #2563eb;
}

/* 店铺分配界面样式 */
.store-assignment-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.assignment-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
}

/* 用户管理界面样式 */
.user-management-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-box-2 {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-box-2 input {
    flex: 1;
}

.search-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
}

.search-btn:hover {
    background: #4338ca;
}

/* 初始化界面样式 */
.init-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.init-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.init-section h4 {
    color: #333;
    margin-bottom: 10px;
}

.data-preview {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 10px;
    background: white;
}

/* 反馈提示样式 */
.feedback-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .welcome-section {
        padding: 30px 20px;
    }
    
    .form-section {
        padding: 30px 20px;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        display: flex;
        gap: 10px;
        padding: 10px;
        overflow-x: auto;
    }
    
    .sidebar .nav-item {
        white-space: nowrap;
    }
    
    .form-row, .extract-form-row {
        flex-direction: column;
    }
    
    .extract-summary-inline {
        flex-direction: column;
        gap: 5px;
    }
    
    .search-box input {
        width: 100% !important;
    }
}