/**
 * 云后台管理系统 - 公共样式
 * 妙联工作室 2026
 * 白色主题专业风格
 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 禁止缩放 */
html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
    min-height: 100vh;
}

/* 登录页面 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo::before {
    content: "<>";
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-family: monospace;
}

.login-box h1 {
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.login-box h2 {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
    font-weight: normal;
}

.login-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.login-links a:hover {
    text-decoration: underline;
}

/* 表单提示 */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.form-inline .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.form-inline .form-group input,
.form-inline .form-group select {
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
    color: #555;
    border: 1px solid #d9d9d9;
    font-weight: 500;
}

.btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.btn-primary {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background: #5a6fd6;
    border-color: #5a6fd6;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}

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

.btn-warning {
    background: #faad14;
    border-color: #faad14;
    color: #fff;
}

.btn-warning:hover {
    background: #ffc53d;
    border-color: #ffc53d;
}

.btn-success {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}

.btn-success:hover {
    background: #73d13d;
    border-color: #73d13d;
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

/* 提示信息 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-success {
    background: #f6ffed;
    border-color: #52c41a;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border-color: #ff4d4f;
    color: #ff4d4f;
}

.alert-warning {
    background: #fffbe6;
    border-color: #faad14;
    color: #faad14;
}

.alert-info {
    background: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

/* 头部导航 */
.header {
    background: #fff;
    color: #333;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e8e8e8;
}

.header-logo {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo::before {
    content: "</>";
    font-family: monospace;
    font-size: 18px;
    color: #667eea;
    font-weight: bold;
}

.header-logo a {
    color: #333;
    text-decoration: none;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav span {
    color: #666;
    font-size: 14px;
}

.header-nav a {
    color: #ff4d4f;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 14px;
    border: 1px solid #ff4d4f;
}

.header-nav a:hover {
    background: #ff4d4f;
    color: #fff;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #fff;
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 99;
    border-right: 1px solid #e8e8e8;
}

.sidebar-menu {
    list-style: none;
    padding: 12px 0;
}

.sidebar-menu li {
    margin: 4px 12px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-menu a:hover {
    color: #667eea;
    background: #f5f7fa;
}

.sidebar-menu a.active {
    color: #667eea;
    background: #f0f5ff;
    font-weight: 500;
}

.sidebar-menu .icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
    font-style: normal;
    color: #999;
}

.sidebar-menu a.active .icon,
.sidebar-menu a:hover .icon {
    color: #667eea;
}

/* 主内容区 */
.main-container {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

.content {
    flex: 1;
    margin-left: 220px;
    padding: 24px;
    padding-bottom: 80px;
}

.content h2 {
    margin-bottom: 24px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

/* 面板 */
.panel {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8;
}

.panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-body {
    padding: 24px;
}

/* 欢迎面板 */
.welcome-panel {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
}

.welcome-panel .panel-body {
    padding: 24px;
}

.welcome-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 500;
}

.welcome-content p {
    opacity: 0.9;
    font-size: 14px;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}

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

.data-table .text-center {
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

/* 信息表格 */
.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.info-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.info-table td:first-child {
    background: #fafafa;
    font-weight: 500;
    color: #555;
    width: 120px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stats-grid.mini {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8;
}

.stat-card.mini {
    padding: 16px;
    flex-direction: column;
    text-align: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
    color: #fff;
    font-weight: bold;
    font-style: normal;
}

.stat-card.mini .stat-icon {
    margin-right: 0;
    margin-bottom: 8px;
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.stat-card.mini .stat-number {
    font-size: 20px;
}

.stat-label {
    color: #888;
    font-size: 13px;
    margin-top: 4px;
}

/* 快捷操作 */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 100px;
    background: #f5f7fa;
    border-radius: 10px;
    text-decoration: none;
    color: #555;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.quick-action-btn:hover {
    background: #f0f5ff;
    border-color: #667eea;
    color: #667eea;
}

.quick-action-btn .icon {
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: bold;
    font-style: normal;
    color: #667eea;
}

.quick-action-btn .label {
    font-size: 13px;
    font-weight: 500;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
}

.badge-danger {
    background: #fff2f0;
    color: #ff4d4f;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
}

.badge-primary {
    background: #e6f7ff;
    color: #1890ff;
}

.badge-default {
    background: #f5f5f5;
    color: #888;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background: #fff;
    margin: 50px auto;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close:hover {
    color: #333;
}

/* 文档内容 */
.doc-content-box {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
}

.doc-content-box pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.doc-meta {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
}

.doc-meta p {
    margin: 4px 0;
    font-size: 13px;
    color: #666;
}

/* 卡密样式 */
.card-key-text {
    cursor: pointer;
    color: #667eea;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 13px;
    padding: 4px 8px;
    background: #f5f7fa;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid #e8e8e8;
}

.card-key-text:hover {
    background: #e6f7ff;
    border-color: #667eea;
}

/* Userkey */
.userkey-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.userkey-text {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 14px;
    color: #333;
    background: #f5f7fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

/* 用户信息框 */
.user-info-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.user-info-box h4 {
    margin-bottom: 16px;
    color: #333;
    font-size: 16px;
}

/* 搜索结果 */
.search-result {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.search-result h4 {
    margin-bottom: 16px;
    color: #333;
    font-size: 16px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state.small {
    padding: 20px;
}

.empty-state::before {
    content: "[ ]";
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
    color: #ddd;
    font-family: monospace;
}

/* 代码样式 */
code {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 12px;
    background: #f5f7fa;
    padding: 2px 6px;
    border-radius: 3px;
    color: #667eea;
    border: 1px solid #e8e8e8;
}

/* 文本颜色 */
.text-primary {
    color: #667eea;
}

/* 间距 */
.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

/* 版权信息 */
.copyright {
    text-align: center;
    color: #888;
    margin-top: 20px;
    font-size: 12px;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 220px;
    right: 0;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 12px 24px;
    text-align: center;
    color: #888;
    font-size: 12px;
    z-index: 98;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .content {
        margin-left: 0;
    }
    
    .footer {
        left: 0;
    }
    
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-inline .form-group {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        justify-content: center;
    }
}