/* 景嘉物流监控软件 - 授权码管理系统 */
/* Windows 桌面应用风格 UI */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: "Segoe UI", "Microsoft YaHei UI", Tahoma, sans-serif;
    font-size: 12px;
    background: #0078d4;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* 主窗口容器 */
.window {
    background: #f0f0f0;
    border: 1px solid #707070;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
    max-width: 800px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 窗口标题栏 */
.window-titlebar {
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
    border-bottom: 1px solid #d0d0d0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.window-titlebar .icon {
    width: 16px;
    height: 16px;
    background: #0078d4;
    border-radius: 2px;
}

.window-titlebar .title {
    font-size: 12px;
    font-weight: 400;
    color: #1a1a1a;
    flex: 1;
}

.window-titlebar .window-controls {
    display: flex;
    gap: 2px;
}

.window-titlebar .window-btn {
    width: 46px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-titlebar .window-btn:hover {
    background: #e5f3ff;
}

.window-titlebar .window-btn.close:hover {
    background: #e81123;
    color: #fff;
}

/* 窗口内容区 */
.window-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f6f6f6;
}

/* 分组框 */
.group-box {
    background: #fff;
    border: 1px solid #d0d0d0;
    margin-bottom: 16px;
    position: relative;
    padding: 24px 12px 12px 12px;
}

.group-box-title {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #fff;
    padding: 0 8px;
    font-size: 12px;
    color: #0078d4;
    font-weight: 600;
}

/* 表单元素 */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.form-row label {
    width: 80px;
    text-align: right;
    font-size: 12px;
    flex-shrink: 0;
}

.form-row .input-field {
    flex: 1;
    max-width: 300px;
}

.input-field input,
.input-field textarea {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #7a7a7a;
    font-size: 12px;
    font-family: inherit;
    background: #fff;
}

.input-field input:focus,
.input-field textarea:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 1px #0078d4;
}

.input-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Windows 风格按钮 */
.btn {
    display: inline-block;
    padding: 5px 16px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid #7a7a7a;
    background: linear-gradient(180deg, #f5f5f5 0%, #e5e5e5 100%);
    color: #1a1a1a;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    min-width: 80px;
}

.btn:hover {
    background: linear-gradient(180deg, #e5f3ff 0%, #cce8ff 100%);
    border-color: #0078d4;
}

.btn:active {
    background: linear-gradient(180deg, #cce8ff 0%, #99d1ff 100%);
}

.btn-primary {
    background: linear-gradient(180deg, #0078d4 0%, #0066b8 100%);
    border-color: #0066b8;
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #1a86d9 0%, #0078d4 100%);
    border-color: #0078d4;
}

.btn-primary:active {
    background: linear-gradient(180deg, #0066b8 0%, #005a9e 100%);
}

.btn-danger {
    background: linear-gradient(180deg, #e81123 0%, #c50f1f 100%);
    border-color: #c50f1f;
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #f02435 0%, #e81123 100%);
}

.btn-sm {
    padding: 3px 12px;
    min-width: 60px;
    font-size: 11px;
}

/* Tab 控件 */
.tab-control {
    background: #fff;
    border: 1px solid #d0d0d0;
    margin-bottom: 16px;
}

.tab-header {
    display: flex;
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
    border-bottom: 1px solid #d0d0d0;
}

.tab-header .tab-item {
    padding: 8px 20px;
    font-size: 12px;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    cursor: pointer;
    margin-bottom: -1px;
    color: #666;
}

.tab-header .tab-item:hover {
    color: #0078d4;
}

.tab-header .tab-item.active {
    background: #fff;
    border-color: #d0d0d0;
    border-bottom-color: #fff;
    color: #0078d4;
    font-weight: 600;
}

.tab-body {
    padding: 16px;
}

.tab-page {
    display: none;
}

.tab-page.active {
    display: block;
}

/* 消息提示 */
.message {
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    line-height: 1.5;
}

.message-success {
    background: #e6f7e6;
    border-color: #4caf50;
    color: #2e7d32;
}

.message-error {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.message-warning {
    background: #fff8e1;
    border-color: #ff9800;
    color: #e65100;
}

.message-info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

/* 下载区域 */
.download-section {
    text-align: center;
    padding: 20px;
}

.download-section .version {
    font-size: 28px;
    font-weight: 300;
    color: #0078d4;
    margin-bottom: 8px;
}

.download-section .description {
    color: #666;
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 12px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 13px;
    background: linear-gradient(180deg, #0078d4 0%, #0066b8 100%);
    border: 1px solid #005a9e;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.download-btn:hover {
    background: linear-gradient(180deg, #1a86d9 0%, #0078d4 100%);
}

.download-btn::before {
    content: "⬇";
}

/* 状态栏 */
.status-bar {
    background: #f0f0f0;
    border-top: 1px solid #d0d0d0;
    padding: 4px 12px;
    font-size: 11px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

/* 状态标签 */
.status {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 2px;
}

.status-success {
    background: #e6f7e6;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.status-pending {
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.status-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffab40;
}

/* ========== 后台管理样式 ========== */

.admin-body {
    background: #f0f0f0;
    padding: 0;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边导航 */
.sidebar {
    width: 200px;
    background: #1a1a1a;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #333;
    font-size: 13px;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li a {
    display: block;
    padding: 10px 16px;
    color: #ccc;
    text-decoration: none;
    font-size: 12px;
    border-bottom: 1px solid #2a2a2a;
}

.sidebar-menu li a:hover {
    background: #2a2a2a;
    color: #fff;
}

.sidebar-menu li a.active {
    background: #0078d4;
    color: #fff;
}

/* 主内容区 */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 工具栏 */
.toolbar {
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
    border-bottom: 1px solid #d0d0d0;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar .toolbar-title {
    font-size: 12px;
    color: #333;
    margin-right: auto;
}

/* 内容面板 */
.content-panel {
    flex: 1;
    padding: 16px;
    background: #f6f6f6;
    overflow-y: auto;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #d0d0d0;
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #e0e0e0;
    font-size: 12px;
}

.data-table th {
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
    font-weight: 600;
    color: #333;
}

.data-table tr:nth-child(even) {
    background: #fafafa;
}

.data-table tr:hover {
    background: #e5f3ff;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.search-bar input {
    padding: 5px 8px;
    border: 1px solid #7a7a7a;
    font-size: 12px;
    width: 200px;
}

.search-bar input:focus {
    outline: none;
    border-color: #0078d4;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 16px;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    border: 1px solid #d0d0d0;
    background: #fff;
    text-decoration: none;
    color: #333;
    font-size: 12px;
}

.pagination a:hover {
    background: #e5f3ff;
    border-color: #0078d4;
}

.pagination .current {
    background: #0078d4;
    border-color: #0078d4;
    color: #fff;
}

/* 模态框 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-window {
    background: #f0f0f0;
    border: 1px solid #707070;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
    border-bottom: 1px solid #d0d0d0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.modal-header .modal-title {
    font-size: 12px;
    font-weight: 400;
    flex: 1;
}

.modal-header .modal-close {
    width: 30px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.modal-header .modal-close:hover {
    background: #e81123;
    color: #fff;
}

.modal-body {
    padding: 16px;
    background: #f6f6f6;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    background: #f0f0f0;
    border-top: 1px solid #d0d0d0;
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 16px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 300;
    color: #0078d4;
}

.stat-card .stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* 登录页面 */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0078d4;
}

.login-window {
    width: 360px;
}

.login-window .window-content {
    padding: 24px;
}

.login-window .form-row {
    flex-direction: column;
    align-items: stretch;
}

.login-window .form-row label {
    width: auto;
    text-align: left;
    margin-bottom: 4px;
}

.login-window .input-field {
    max-width: none;
}

.login-window .btn {
    width: 100%;
    padding: 8px 16px;
    margin-top: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
    }
    
    .sidebar-menu li a {
        white-space: nowrap;
        border-bottom: none;
        border-right: 1px solid #2a2a2a;
    }
    
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row label {
        width: auto;
        text-align: left;
        margin-bottom: 4px;
    }
    
    .form-row .input-field {
        max-width: none;
    }
}
