/* ============================================================
   墨觉互联 - 主样式表
   设计风格：科技蓝 + 白色卡片，参考QQ互联/阿里云控制台
   ============================================================ */

/* ---------- Reset & Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #1f2937;
    background: #f5f7fa;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: #1677ff; text-decoration: none; }
a:hover { color: #4096ff; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main-content { flex: 1; padding: 24px 0; }

/* ---------- Header ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}
.logo:hover { color: #1f2937; }
.logo-icon {
    width: 32px;
    height: 32px;
    background: #1677ff;
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}
.main-nav {
    display: flex;
    gap: 28px;
    margin-left: 40px;
    flex: 1;
}
.main-nav a {
    color: #4b5563;
    font-size: 14px;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color .2s;
}
.main-nav a:hover { color: #1677ff; }
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-dropdown {
    position: relative;
    cursor: pointer;
}
.user-name {
    color: #4b5563;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
}
.user-dropdown:hover .user-name { background: #f5f7fa; }
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 160px;
    padding: 6px 0;
    z-index: 200;
}
.user-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #4b5563;
    font-size: 14px;
}
.dropdown-menu a:hover { background: #f5f7fa; color: #1677ff; }
.dropdown-logout { border-top: 1px solid #f0f0f0; margin-top: 4px; padding-top: 10px !important; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s;
    line-height: 1.4;
    white-space: nowrap;
}
.btn-primary { background: #1677ff; color: #fff; border-color: #1677ff; }
.btn-primary:hover { background: #4096ff; border-color: #4096ff; color: #fff; }
.btn-default { background: #fff; color: #4b5563; border-color: #d9d9d9; }
.btn-default:hover { color: #1677ff; border-color: #1677ff; }
.btn-success { background: #52c41a; color: #fff; border-color: #52c41a; }
.btn-success:hover { background: #73d13d; border-color: #73d13d; color: #fff; }
.btn-warning { background: #faad14; color: #fff; border-color: #faad14; }
.btn-warning:hover { background: #ffc53d; border-color: #ffc53d; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff7875; border-color: #ff7875; color: #fff; }
.btn-link { background: none; border: none; color: #1677ff; padding: 8px 12px; }
.btn-link:hover { color: #4096ff; background: none; }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 24px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.card-title { font-size: 16px; font-weight: 600; color: #1f2937; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}
.form-label .required { color: #ff4d4f; margin-left: 2px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.form-control:focus {
    outline: none;
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22,119,255,0.1);
}
.form-control::placeholder { color: #bfbfbf; }
textarea.form-control { resize: vertical; min-height: 80px; font-family: inherit; }
.form-hint { font-size: 12px; color: #8c8c8c; margin-top: 4px; }
.form-error { font-size: 12px; color: #ff4d4f; margin-top: 4px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* ---------- Tables ---------- */
.table-wrapper { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.data-table th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
table.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #4b5563;
}
table.data-table tr:hover td { background: #fafafa; }
table.data-table .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Status Badges ---------- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}
.badge-pending, .status-pending { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.badge-active, .status-active { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-rejected, .status-rejected { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }
.badge-banned, .status-banned { background: #f5f5f5; color: #8c8c8c; border: 1px solid #d9d9d9; }
.badge-info { background: #e6f4ff; color: #1677ff; border: 1px solid #91caff; }
.badge-admin { background: #f9f0ff; color: #722ed1; border: 1px solid #d3adf7; }

/* ---------- Alert / Message ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid;
}
.alert-success { background: #f6ffed; border-color: #b7eb8f; color: #389e0d; }
.alert-error { background: #fff1f0; border-color: #ffa39e; color: #cf1322; }
.alert-warning { background: #fffbe6; border-color: #ffe58f; color: #d48806; }
.alert-info { background: #e6f4ff; border-color: #91caff; color: #0958d9; }

/* ---------- Hero (Homepage) ---------- */
.hero {
    background: #fff;
    padding: 60px 0 50px;
    border-bottom: 1px solid #f0f0f0;
}
.hero-inner {
    display: flex;
    align-items: center;
    gap: 48px;
}
.hero-text { flex: 1; }
.hero-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #e6f4ff;
    color: #1677ff;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 20px;
}
.hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    margin-bottom: 16px;
}
.hero h1 .highlight { color: #1677ff; }
.hero p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 28px;
    line-height: 1.8;
}
.hero-buttons { display: flex; gap: 12px; }
.hero-visual {
    flex: 0 0 380px;
    height: 280px;
    background: #f5f7fa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.hero-visual-placeholder {
    text-align: center;
    color: #bfbfbf;
}
.hero-visual-placeholder .big-icon {
    font-size: 64px;
    color: #1677ff;
    margin-bottom: 12px;
    opacity: .3;
}

/* ---------- Features Section ---------- */
.section { padding: 48px 0; }
.section-title {
    text-align: center;
    margin-bottom: 36px;
}
.section-title h2 {
    font-size: 26px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}
.section-title p { color: #6b7280; font-size: 15px; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 28px 24px;
    transition: box-shadow .2s, transform .2s;
}
.feature-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.feature-icon {
    width: 48px;
    height: 48px;
    background: #e6f4ff;
    color: #1677ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}
.feature-card h3 { font-size: 17px; font-weight: 600; color: #1f2937; margin-bottom: 8px; }
.feature-card p { color: #6b7280; font-size: 14px; line-height: 1.7; }

/* ---------- Steps / Flow ---------- */
.steps-section { background: #fff; padding: 48px 0; border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    position: relative;
}
.step-item {
    text-align: center;
    position: relative;
}
.step-number {
    width: 40px;
    height: 40px;
    background: #1677ff;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    margin: 0 auto 14px;
}
.step-item h4 { font-size: 15px; font-weight: 600; color: #1f2937; margin-bottom: 6px; }
.step-item p { font-size: 13px; color: #6b7280; line-height: 1.6; }

/* ---------- Auth Pages (login/register) ---------- */
.auth-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 36px 32px;
}
.auth-card h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin-bottom: 8px;
}
.auth-card .auth-subtitle {
    text-align: center;
    color: #8c8c8c;
    font-size: 14px;
    margin-bottom: 28px;
}
.auth-footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6b7280;
}

/* ---------- OAuth Consent Page ---------- */
.oauth-body {
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.oauth-card {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 32px;
}
.oauth-header { text-align: center; margin-bottom: 24px; }
.oauth-app-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.oauth-app-icon img { width: 100%; height: 100%; object-fit: cover; }
.oauth-app-icon-placeholder {
    width: 100%;
    height: 100%;
    background: #1677ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
}
.oauth-header h2 { font-size: 20px; font-weight: 600; color: #1f2937; }
.oauth-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #4b5563;
}
.oauth-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.oauth-user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1677ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.oauth-scope {
    background: #fafafa;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
}
.oauth-scope-title { font-size: 14px; font-weight: 500; color: #1f2937; margin-bottom: 10px; }
.oauth-scope-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
    padding: 4px 0;
}
.scope-icon { color: #52c41a; font-weight: 700; }
.oauth-buttons { display: flex; flex-direction: column; gap: 10px; }
.oauth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}
.oauth-footer a { color: #8c8c8c; }

/* ---------- Dashboard Layout (console/admin) ---------- */
.dashboard-layout {
    display: flex;
    gap: 24px;
    min-height: calc(100vh - 60px - 48px);
}
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px 0;
    height: fit-content;
    position: sticky;
    top: 80px;
}
.sidebar-title {
    padding: 0 20px 12px;
    font-size: 12px;
    color: #8c8c8c;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #4b5563;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-nav a:hover { background: #f5f7fa; color: #1677ff; }
.sidebar-nav a.active {
    background: #e6f4ff;
    color: #1677ff;
    border-left-color: #1677ff;
    font-weight: 500;
}
.sidebar-nav .nav-icon { width: 18px; text-align: center; font-size: 15px; }
.dashboard-main { flex: 1; min-width: 0; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.page-header h1 { font-size: 22px; font-weight: 600; color: #1f2937; }
.page-header .page-desc { color: #6b7280; font-size: 14px; margin-top: 4px; }

/* ---------- Stats Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 20px;
}
.stat-card .stat-label { font-size: 13px; color: #8c8c8c; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #1f2937; }
.stat-card .stat-value.primary { color: #1677ff; }
.stat-card .stat-value.success { color: #52c41a; }
.stat-card .stat-value.warning { color: #faad14; }
.stat-card .stat-value.danger { color: #ff4d4f; }

/* ---------- App Detail / Secret ---------- */
.secret-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fafafa;
    border-radius: 6px;
    margin-bottom: 10px;
}
.secret-label {
    font-size: 13px;
    color: #8c8c8c;
    min-width: 80px;
    flex-shrink: 0;
}
.secret-value {
    flex: 1;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    color: #1f2937;
    word-break: break-all;
}
.secret-value.masked { letter-spacing: 2px; }

/* ---------- Docs Layout ---------- */
.docs-layout {
    display: flex;
    gap: 24px;
}
.docs-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px 0;
    height: fit-content;
    position: sticky;
    top: 80px;
}
.docs-sidebar .sidebar-title { padding: 0 20px 12px; }
.docs-sidebar a {
    display: block;
    padding: 8px 20px;
    color: #4b5563;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.docs-sidebar a:hover { background: #f5f7fa; color: #1677ff; }
.docs-sidebar a.active {
    background: #e6f4ff;
    color: #1677ff;
    border-left-color: #1677ff;
}
.docs-content {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 32px;
    min-width: 0;
}
.docs-content h1 { font-size: 24px; font-weight: 600; color: #1f2937; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; }
.docs-content h2 { font-size: 19px; font-weight: 600; color: #1f2937; margin: 28px 0 14px; }
.docs-content h3 { font-size: 16px; font-weight: 600; color: #1f2937; margin: 20px 0 10px; }
.docs-content p { color: #4b5563; line-height: 1.8; margin-bottom: 12px; }
.docs-content ul, .docs-content ol { padding-left: 24px; margin-bottom: 12px; color: #4b5563; line-height: 1.8; }
.docs-content ul li { list-style: disc; margin-bottom: 4px; }
.docs-content ol li { list-style: decimal; margin-bottom: 4px; }
.docs-content code {
    background: #f5f7fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #d63384;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.docs-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.docs-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 14px;
}
.docs-content table th {
    background: #fafafa;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #f0f0f0;
    color: #1f2937;
}
.docs-content table td {
    padding: 10px 14px;
    border: 1px solid #f0f0f0;
    color: #4b5563;
}
.docs-content blockquote {
    border-left: 4px solid #1677ff;
    background: #e6f4ff;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 16px;
    color: #0958d9;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: #4b5563;
    background: #fff;
}
.pagination a:hover { border-color: #1677ff; color: #1677ff; }
.pagination .current { background: #1677ff; color: #fff; border-color: #1677ff; }
.pagination .disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #8c8c8c;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ---------- Footer ---------- */
.site-footer {
    background: #fff;
    border-top: 1px solid #e8e8e8;
    margin-top: auto;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 40px 0 32px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}
.footer-desc { color: #6b7280; font-size: 13px; line-height: 1.7; }
.footer-col h4 { font-size: 14px; font-weight: 600; color: #1f2937; margin-bottom: 14px; }
.footer-col a {
    display: block;
    color: #6b7280;
    font-size: 13px;
    padding: 4px 0;
}
.footer-col a:hover { color: #1677ff; }
.footer-bottom {
    border-top: 1px solid #f0f0f0;
    padding: 16px 0;
    text-align: center;
    color: #8c8c8c;
    font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-inner { flex-direction: column; }
    .hero-visual { display: none; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .dashboard-layout, .docs-layout { flex-direction: column; }
    .sidebar, .docs-sidebar { width: 100%; position: static; }
}
@media (max-width: 640px) {
    .main-nav { display: none; }
    .features-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .hero h1 { font-size: 26px; }
}
