/* ========================================
   企业API总站 - Windows 10 风格样式
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "微软雅黑", "Segoe UI", Tahoma, Arial, sans-serif;
}

html, body {
    height: 100%;
    background: #f3f3f3;
    color: #1a1a1a;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============== 登录页面 ============== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-window {
    width: 380px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    position: relative;
    z-index: 1;
}

.login-titlebar {
    height: 32px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 12px;
    color: #1a1a1a;
}

.login-titlebar .title-text {
    flex: 1;
    text-align: center;
    font-weight: 400;
}

.login-body {
    padding: 36px 40px 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #0078d4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    border: 1px solid #005a9e;
}

.login-app-name {
    text-align: center;
    font-size: 18px;
    font-weight: 300;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.login-app-sub {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: #333;
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    height: 32px;
    border: 1px solid #cccccc;
    background: #ffffff;
    padding: 0 8px;
    font-size: 14px;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.1s;
}

.form-control:focus {
    border-color: #0078d4;
}

.form-control:hover:not(:focus) {
    border-color: #999;
}

textarea.form-control {
    height: auto;
    min-height: 90px;
    padding: 8px;
    resize: vertical;
    font-family: inherit;
}

.btn {
    display: inline-block;
    height: 32px;
    line-height: 30px;
    padding: 0 16px;
    border: 1px solid #cccccc;
    background: #f5f5f5;
    color: #1a1a1a;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.1s, border-color 0.1s;
    user-select: none;
}

.btn:hover {
    background: #ebebeb;
    border-color: #adadad;
}

.btn:active {
    background: #dfdfdf;
}

.btn-primary {
    background: #0078d4;
    border-color: #0078d4;
    color: #ffffff;
}

.btn-primary:hover {
    background: #106ebe;
    border-color: #106ebe;
}

.btn-primary:active {
    background: #005a9e;
    border-color: #005a9e;
}

.btn-danger {
    background: #d83b01;
    border-color: #d83b01;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b32d00;
    border-color: #b32d00;
}

.btn-small {
    height: 24px;
    line-height: 22px;
    padding: 0 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.login-actions {
    margin-top: 20px;
}

.login-msg {
    padding: 8px 10px;
    background: #fde7e9;
    border: 1px solid #f1aeb5;
    color: #a4262c;
    font-size: 12px;
    margin-bottom: 12px;
}

.login-msg.ok {
    background: #dff6dd;
    border-color: #a7f0ba;
    color: #107c10;
}

.login-footer {
    border-top: 1px solid #e0e0e0;
    padding: 10px 12px;
    font-size: 11px;
    color: #888;
    text-align: center;
    background: #fafafa;
}

/* ============== 主窗口框架 ============== */
.app-window {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f3f3f3;
}

.titlebar {
    height: 32px;
    background: #0078d4;
    color: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 8px;
    user-select: none;
}

.titlebar .tb-title {
    flex: 1;
    font-size: 12px;
    font-weight: 400;
    padding-left: 8px;
}

.titlebar .tb-controls {
    display: flex;
}

.titlebar .tb-btn {
    width: 46px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: "Segoe MDL2 Assets", "Segoe UI Symbol", sans-serif;
    font-size: 10px;
    cursor: pointer;
}

.titlebar .tb-btn:hover {
    background: rgba(255,255,255,0.15);
}

.titlebar .tb-btn.close:hover {
    background: #e81123;
}

.tb-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #fff;
    margin-right: 8px;
    position: relative;
}

.tb-icon::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 10px; height: 10px;
    background: #0078d4;
}

.app-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 侧边导航 */
.sidebar {
    width: 220px;
    background: #fafafa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    height: 40px;
    background: #f0f0f0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: #ebebeb;
}

.menu-item.active {
    background: #e5f1fb;
    border-left-color: #0078d4;
    color: #0078d4;
    font-weight: 600;
}

.menu-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    background: #555;
    display: inline-block;
    position: relative;
}

.menu-item.active .menu-icon { background: #0078d4; }

.sidebar-footer {
    border-top: 1px solid #e0e0e0;
    padding: 10px 14px;
    font-size: 12px;
    color: #666;
    background: #fafafa;
}

/* 主内容 */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toolbar {
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
}

.toolbar .toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-right: 16px;
}

.toolbar .spacer { flex: 1; }

.content {
    flex: 1;
    overflow: auto;
    padding: 16px;
    background: #f3f3f3;
}

/* 卡片/面板 */
.panel {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    margin-bottom: 12px;
}

.panel-header {
    height: 36px;
    padding: 0 14px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    background: #fafafa;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.panel-body {
    padding: 14px;
}

.panel-title-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}

.data-table thead th {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 12px;
}

.data-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #ebebeb;
    color: #1a1a1a;
}

.data-table tbody tr:hover {
    background: #f5f8fb;
}

.data-table .row-actions {
    display: flex;
    gap: 6px;
}

/* 表单 */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #ebebeb;
    display: flex;
    gap: 8px;
}

/* API Key 显示 */
.api-key-box {
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    padding: 10px 12px;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.api-key-box .key-text {
    flex: 1;
    word-break: break-all;
    user-select: all;
}

/* API 文档块 */
.api-doc {
    border: 1px solid #e0e0e0;
    margin-bottom: 10px;
    background: #fff;
}

.api-doc-header {
    padding: 10px 14px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
}

.method-tag {
    display: inline-block;
    height: 20px;
    line-height: 18px;
    padding: 0 8px;
    border: 1px solid;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.method-get { color: #0078d4; border-color: #0078d4; background: #e5f1fb; }
.method-post { color: #107c10; border-color: #107c10; background: #dff6dd; }

.api-doc-url {
    font-family: "Consolas", monospace;
    color: #1a1a1a;
    font-weight: 400;
    font-size: 12px;
    word-break: break-all;
}

.api-doc-body {
    padding: 12px 14px;
}

.api-doc-desc {
    color: #555;
    font-size: 12px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.api-doc table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.api-doc table th,
.api-doc table td {
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    text-align: left;
}

.api-doc table th {
    background: #fafafa;
    font-weight: 600;
}

.api-doc pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 10px 12px;
    font-family: "Consolas", monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    margin-top: 8px;
}

/* 状态栏 */
.statusbar {
    height: 24px;
    background: #0078d4;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 11px;
    gap: 16px;
}

.statusbar .sb-item { display: flex; align-items: center; gap: 4px; }

/* 提示 */
.alert {
    padding: 10px 14px;
    border: 1px solid;
    margin-bottom: 12px;
    font-size: 13px;
}

.alert-info { background: #e5f1fb; border-color: #b3d7f0; color: #005a9e; }
.alert-success { background: #dff6dd; border-color: #a7f0ba; color: #107c10; }
.alert-error { background: #fde7e9; border-color: #f1aeb5; color: #a4262c; }

/* 模态对话框 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    width: 480px;
    background: #fff;
    border: 1px solid #d0d0d0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.modal-titlebar {
    height: 32px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 13px;
}

.modal-titlebar .mt-title { flex: 1; }
.modal-titlebar .mt-close {
    cursor: pointer;
    color: #666;
    font-family: "Segoe MDL2 Assets", sans-serif;
}

.modal-body { padding: 16px; }
.modal-footer {
    padding: 10px 14px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 12px;
    color: #555;
}

.pagination a, .pagination span {
    height: 24px;
    min-width: 24px;
    line-height: 22px;
    padding: 0 8px;
    border: 1px solid #d0d0d0;
    background: #fff;
    text-decoration: none;
    color: #1a1a1a;
    text-align: center;
}

.pagination a:hover { background: #ebebeb; }
.pagination .current {
    background: #0078d4;
    border-color: #0078d4;
    color: #fff;
}

/* 安装提示 */
.install-box {
    max-width: 480px;
    margin: 80px auto;
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 30px;
    text-align: center;
}
.install-box h2 { font-weight: 300; color: #0078d4; margin-bottom: 10px; }
.install-box p { color: #555; margin: 8px 0; }
.install-box .btn { margin-top: 16px; }
.install-icon {
    width: 48px;
    height: 48px;
    background: #107c10;
    margin: 0 auto 16px;
    position: relative;
}
.install-icon::after {
    content: '';
    position: absolute;
    left: 14px; top: 24px;
    width: 12px; height: 6px;
    border-left: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: rotate(-45deg);
}

/* 滚动条 */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #f5f5f5; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border: 2px solid #f5f5f5; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

.text-muted { color: #666; font-size: 12px; }
.text-mono { font-family: "Consolas", monospace; }
.mb-12 { margin-bottom: 12px; }
.mb-8 { margin-bottom: 8px; }
.mt-8 { margin-top: 8px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
