* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif; background: #f0f2f5; min-height: 100vh; }
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg,#1890ff 0%,#36cfcf 100%); }
.login-box { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); width: 400px; }
.login-title { font-size: 24px; font-weight: 600; text-align: center; margin-bottom: 32px; color: #262626; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; margin-bottom: 8px; font-size: 14px; color: #595959; }
.login-form input { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; transition: all 0.3s; }
.login-form input:focus { outline: none; border-color: #40a9ff; box-shadow: 0 0 0 3px rgba(24,144,255,0.15); }
.login-btn { width: 100%; padding: 12px; background: #1890ff; color: white; border: none; border-radius: 6px; font-size: 16px; cursor: pointer; transition: background 0.3s; margin-top: 8px; }
.login-btn:hover { background: #40a9ff; }
.login-tip { text-align: center; margin-top: 16px; font-size: 13px; color: #8c8c8c; }
.app { display: none; }
.app.active { display: block; }
.header { background: #1890ff; color: white; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 8px rgba(0,0,0,0.15); position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.header h1 { font-size: 20px; font-weight: 500; }
.header .user { font-size: 14px; opacity: 0.9; cursor: pointer; }
.container { display: flex; min-height: 100vh; padding-top: 64px; }
.sidebar { width: 220px; background: #fff; box-shadow: 2px 0 8px rgba(0,0,0,0.05); position: fixed; top: 64px; left: 0; bottom: 0; overflow-y: auto; z-index: 50; }
.nav-item { padding: 14px 20px; cursor: pointer; color: #595959; font-size: 14px; transition: all 0.3s; border-left: 3px solid transparent; display: flex; align-items: center; gap: 10px; }
.nav-item:hover { color: #1890ff; background: #e6f7ff; }
.nav-item.active { color: #1890ff; background: #e6f7ff; border-left-color: #1890ff; font-weight: 500; }
.nav-badge { background: #ff4d4f; color: white; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.hidden { display: none; }
.main-content { flex: 1; margin-left: 220px; padding: 24px; overflow: auto; }
.card { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.card-title { font-size: 16px; font-weight: 500; color: #262626; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.btn { padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.3s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: #1890ff; color: white; }
.btn-primary:hover { background: #40a9ff; }
.btn-success { background: #52c41a; color: white; }
.btn-success:hover { background: #73d13d; }
.btn-danger { background: #ff4d4f; color: white; }
.btn-danger:hover { background: #ff7875; }
.btn-default { background: #fff; border: 1px solid #d9d9d9; color: #595959; }
.btn-default:hover { border-color: #40a9ff; color: #1890ff; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.table th { background: #fafafa; font-weight: 500; color: #595959; }
.table tr:hover { background: #fafafa; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 8px; font-size: 14px; color: #595959; font-weight: 500; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; transition: all 0.3s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: #40a9ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.modal-header { padding: 16px 24px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 16px; font-weight: 500; color: #262626; }
.modal-close { font-size: 20px; cursor: pointer; color: #bfbfbf; background: none; border: none; }
.modal-close:hover { color: #595959; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.stat-label { font-size: 14px; color: #8c8c8c; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 600; color: #262626; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag-green { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.tag-red { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }
.tag-gray { background: #f5f5f5; color: #8c8c8c; border: 1px solid #d9d9d9; }
.empty { text-align: center; padding: 40px; color: #999; }
.info-box { background: #e6f7ff; border: 1px solid #91d5ff; padding: 12px 16px; border-radius: 4px; color: #1890ff; font-size: 13px; }

/* 设备协议管理：Tab 切换 */
.proto-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.proto-tab { padding: 8px 18px; border-radius: 4px; background: #f5f5f5; color: #595959; font-size: 14px; cursor: pointer; transition: all 0.3s; }
.proto-tab:hover { color: #1890ff; background: #e6f7ff; }
.proto-tab.active { background: #1890ff; color: #fff; }
