* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1a1a1a;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.btn-add {
    padding: 8px 20px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add:hover {
    background: #40a9ff;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    width: 240px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #1890ff;
}

/* 表格 */
.app-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

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

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #fafafa;
}

.status-text {
    text-align: center;
    color: #999;
    padding: 40px 0 !important;
}

.status-text.error {
    color: #ff4d4f;
}

.actions button {
    padding: 4px 12px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    margin-right: 6px;
    transition: opacity 0.2s;
}

.actions button:hover {
    opacity: 0.85;
}

.btn-edit {
    background: #1890ff;
    color: #fff;
}

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

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 16px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination button:disabled {
    color: #ccc;
    cursor: not-allowed;
}

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

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 8px;
    width: 440px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.btn-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #1890ff;
}

.form-group input:disabled {
    background: #f5f5f5;
    color: #999;
}

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

.btn-cancel, .btn-submit {
    padding: 6px 18px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #fff;
    border: 1px solid #d9d9d9;
    color: #666;
}

.btn-cancel:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.btn-submit {
    background: #1890ff;
    border: 1px solid #1890ff;
    color: #fff;
}

.btn-submit:hover {
    background: #40a9ff;
    border-color: #40a9ff;
}

.btn-submit:disabled {
    background: #91caff;
    border-color: #91caff;
    cursor: not-allowed;
}

/* ---- 应用卡片列表 ---- */
.app-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.app-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.app-id {
    font-size: 13px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
}

.app-time {
    font-size: 13px;
    color: #999;
}

.app-card-actions {
    display: flex;
    gap: 8px;
}

.btn-upgrade {
    padding: 4px 12px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    background: #52c41a;
    color: #fff;
    transition: opacity 0.2s;
}

.btn-upgrade:hover {
    opacity: 0.85;
}

.app-card-body {
    padding: 0;
}

/* 升级记录表格 */
.rec-app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

.rec-app-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
    font-size: 12px;
}

.rec-app-table tr:last-child td {
    border-bottom: none;
}

.rec-app-table tr:hover td {
    background: #fafafa;
}

.url-cell {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-records {
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-size: 13px;
}

/* 宽弹窗 */
.modal-wide {
    width: 640px;
}

.modal-body-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
    vertical-align: middle;
}