
.profile-wrap { padding: 32px 0 80px; }

.profile-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 28px;
  align-items: start;
}

.profile-sidebar {
  position: sticky;
  top: calc(1.2rem + 72px + 16px);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card), inset 0 1px 0 var(--glass-highlight);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-sidebar::before {
  content: '';
  height: 3px;
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(167,139,250,0.8), rgba(56,189,248,0.6), rgba(96,165,250,0.5));
}

.profile-user-card {
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.profile-user-info { width: 100%; }

.profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 3px;
  word-break: break-word;
}

.profile-email {
  font-size: 0.73rem;
  color: var(--muted);
  word-break: break-all;
}

.profile-bio {
  font-size: 0.78rem;
  color: var(--muted2);
  line-height: 1.55;
  margin-top: 4px;
  min-height: 0;
}

.profile-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 0;
}
.profile-badge {
  font-size: 0.65rem;
  padding: 2px 9px;
  border-radius: 100px;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.2);
  color: #a78bfa;
  font-weight: 600;
}

.profile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0 14px;
  flex-shrink: 0;
}

.profile-avatar {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(167,139,250,0.3);
  box-shadow: 0 0 0 5px rgba(167,139,250,0.08), 0 6px 20px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--muted2);
  flex-shrink: 0;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  outline: none !important;
  transition: box-shadow 0.2s, transform 0.2s;
}
.profile-avatar:hover {
  box-shadow: 0 0 0 5px rgba(167,139,250,0.2), 0 8px 24px rgba(0,0,0,0.45);
  transform: translateY(-1px);
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.18s;
}
.profile-avatar:hover .profile-avatar-overlay { opacity: 1; }

.profile-nav {
  padding: 10px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-nav-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted2);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.15s, background 0.15s;
  width: 100%;
}
.profile-nav-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.profile-nav-btn.active {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  font-weight: 600;
}
.profile-nav-btn.active .pnav-icon {
  color: var(--green);
}

.pnav-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--muted);
  transition: color 0.15s;
}

.profile-main {
  min-width: 0;
}

.profile-section-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.profile-section-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.my-plugins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.my-plugin-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.my-plugin-card:hover {
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.4);
}

.my-plugin-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.my-plugin-img-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: rgba(255,255,255,0.02);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--muted);
}

.my-plugin-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.my-plugin-title {
  font-size: 0.9rem; font-weight: 700; color: var(--text);
  text-decoration: none; transition: color 0.15s;
}
.my-plugin-title:hover { color: var(--green); }
.my-plugin-versions { font-size: 0.65rem; font-family: inherit; color: var(--muted); }
.my-plugin-foot { padding: 0 14px 12px; }

.btn-my-download {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 8px 0;
  background: var(--green); color: #050505;
  font-size: 0.8rem; font-weight: 700; font-family: inherit;
  border-radius: 8px; text-decoration: none;
  transition: opacity 0.15s, transform 0.15s; border: none;
}
.btn-my-download:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-my-soon {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 8px 0;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.72rem; font-family: inherit; color: var(--muted);
}

.card-update-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 0.62rem; font-weight: 700;
  background: rgba(52,211,153,0.15); border: 1px solid rgba(52,211,153,0.3);
  color: #34d399; padding: 2px 8px; border-radius: 100px;
}

.orders-list { display: flex; flex-direction: column; gap: 8px; }

.order-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  border-radius: 12px; padding: 12px 16px;
  transition: border-color 0.15s;
}
.order-row:hover { border-color: rgba(255,255,255,0.14); }

.order-img { width: 52px; height: 33px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.order-img-placeholder { width: 52px; height: 33px; border-radius: 6px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); flex-shrink: 0; }
.order-info { flex: 1; min-width: 0; }
.order-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; transition: color 0.15s;
}
.order-title:hover { color: var(--green); }
.order-date { font-size: 0.68rem; font-family: inherit; color: var(--muted); margin-top: 2px; }
.order-price { font-size: 0.88rem; font-family: inherit; font-weight: 700; color: var(--green); flex-shrink: 0; }
.order-download {
  font-size: 0.7rem; font-family: inherit; color: var(--muted2);
  text-decoration: none; border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 100px; flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.order-download:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }

.settings-section {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 12px;
  max-width: 440px;
}

.settings-section h3 {
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.form-group label { font-size: 0.7rem; font-family: inherit; color: var(--muted); font-weight: 500; }

.form-group input,
.settings-input {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-family: inherit;
  font-size: 0.85rem; padding: 8px 12px; outline: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%; box-sizing: border-box;
}
.form-group input:focus,
.settings-input:focus { border-color: rgba(167,139,250,0.45); background: rgba(255,255,255,0.06); }

.form-msg {
  font-size: 0.72rem; font-family: inherit; padding: 7px 11px;
  border-radius: 7px; margin-bottom: 10px; display: none;
}
.form-msg.ok  { background: rgba(52,211,153,0.08); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
.form-msg.err { background: rgba(248,113,113,0.08); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }

.btn-settings-save {
  background: var(--green); color: #050505;
  font-size: 0.8rem; font-weight: 700; font-family: inherit;
  border: none; border-radius: 9px; padding: 8px 20px;
  cursor: pointer; transition: opacity 0.15s, transform 0.15s;
}
.btn-settings-save:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-settings-save:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.profile-empty { font-size: 0.82rem; font-family: inherit; color: var(--muted); padding: 32px 0; }
.profile-empty a { color: var(--green); text-decoration: none; }
.plugins-loading { font-size: 0.82rem; color: var(--muted); padding: 20px 0; }

.aff-wrap { display: flex; flex-direction: column; gap: 16px; }
.aff-stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }

.aff-stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-card);
  border-radius: 12px; padding: 14px 18px;
}
.aff-stat-val { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-top: 4px; }

.aff-code-box, .aff-payout-form, .aff-apply-box, .aff-earnings {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-card);
  border-radius: 14px; padding: 18px 20px;
}

.aff-code-label { font-size: 0.7rem; color: var(--muted); margin-bottom: 10px; }
.aff-code-row, .aff-link-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.aff-code { font-size: 1.05rem; font-weight: 700; color: var(--green); letter-spacing: 2px; }
.aff-link { font-size: 0.72rem; color: var(--muted2); word-break: break-all; }

.aff-copy-btn {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text); font-size: 0.7rem; font-family: inherit;
  padding: 4px 12px; border-radius: 100px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.aff-copy-btn:hover { background: rgba(255,255,255,0.1); }

.aff-hint { font-size: 0.77rem; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.aff-apply-desc { font-size: 0.84rem; color: var(--muted2); margin-bottom: 18px; line-height: 1.6; }
.aff-section-title { font-size: 0.7rem; color: var(--muted); font-weight: 600; margin-bottom: 12px; }

.aff-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.aff-label { font-size: 0.7rem; font-family: inherit; color: var(--muted); font-weight: 500; }

.aff-input, .aff-select, .aff-textarea {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-family: inherit;
  font-size: 0.85rem; padding: 9px 12px; outline: none;
  transition: border-color 0.2s; width: 100%; box-sizing: border-box;
}
.aff-select { appearance: none; cursor: pointer; }
.aff-textarea { resize: vertical; min-height: 80px; }
.aff-input:focus, .aff-select:focus, .aff-textarea:focus { border-color: rgba(167,139,250,0.4); }
.aff-input::placeholder, .aff-textarea::placeholder { color: var(--muted); }

.aff-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.aff-table th { text-align: left; padding: 7px 10px; font-size: 0.68rem; font-family: inherit; color: var(--muted); border-bottom: 1px solid var(--border); font-weight: 600; }
.aff-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--muted2); }
.aff-table tr:last-child td { border-bottom: none; }

.aff-status { font-size: 0.67rem; font-family: inherit; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.aff-status.pending  { background: rgba(251,191,36,0.1); color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.aff-status.paid     { background: rgba(52,211,153,0.1); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
.aff-status.approved { background: rgba(52,211,153,0.1); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
.aff-status.rejected { background: rgba(248,113,113,0.1); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }

.aff-payout-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.aff-payouts .aff-payout-row:last-child { border-bottom: none; }

.payout-method-btn {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted2); font-family: inherit;
  font-size: 0.8rem; padding: 6px 14px; cursor: pointer; transition: all 0.15s;
}
.payout-method-btn:hover { border-color: rgba(255,255,255,0.15); color: var(--text); }
.payout-method-btn.active { background: rgba(167,139,250,0.08); border-color: rgba(167,139,250,0.3); color: var(--green); font-weight: 600; }

.my-threads-list { display: flex; flex-direction: column; gap: 6px; }
.my-thread-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.my-thread-row:hover { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); }
.my-thread-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.my-thread-title { font-size: 0.86rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-thread-meta { display: flex; align-items: center; gap: 8px; }
.my-thread-cat { font-size: 0.68rem; padding: 2px 7px; border-radius: 5px; background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.2); color: #a78bfa; }
.my-thread-date { font-size: 0.68rem; color: var(--muted); }
.my-thread-stats { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; }

html.light .profile-sidebar {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
html.light .profile-sidebar::before {
  background: linear-gradient(90deg, rgba(99,102,241,0.6), rgba(56,189,248,0.5), rgba(96,165,250,0.4));
}
html.light .profile-nav-divider { background: rgba(0,0,0,0.08); }
html.light .profile-avatar {
  background: #f1f5f9; border-color: rgba(99,102,241,0.25);
  box-shadow: 0 0 0 5px rgba(99,102,241,0.08), 0 4px 14px rgba(0,0,0,0.08);
}
html.light .profile-nav-btn:hover { background: rgba(0,0,0,0.04); }
html.light .profile-nav-btn.active { background: rgba(0,0,0,0.06); }
html.light .profile-nav-btn.active .pnav-icon { color: var(--text); }
html.light .profile-badge { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.2); color: #6366f1; }

html.light .my-plugin-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
html.light .my-plugin-img-placeholder { background: rgba(0,0,0,0.03); }
html.light .btn-my-download { color: #fff; }
html.light .btn-my-soon { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }

html.light .order-row:hover { border-color: rgba(0,0,0,0.12); }
html.light .order-download:hover { background: rgba(0,0,0,0.04); }
html.light .order-img-placeholder { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }

html.light .settings-section h3 { border-bottom-color: rgba(0,0,0,0.08); }
html.light .form-group input,
html.light .settings-input { background: #fff; border-color: rgba(0,0,0,0.1); }
html.light .form-group input:focus,
html.light .settings-input:focus { border-color: rgba(99,102,241,0.4); background: #fff; }
html.light .aff-input, html.light .aff-select, html.light .aff-textarea { background: #fff; border-color: rgba(0,0,0,0.1); }
html.light .aff-copy-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); }
html.light .aff-copy-btn:hover { background: rgba(0,0,0,0.08); }
html.light .aff-table td { border-bottom-color: rgba(0,0,0,0.05); }
html.light .aff-payout-row { border-bottom-color: rgba(0,0,0,0.06); }
html.light .payout-method-btn { border-color: rgba(0,0,0,0.1); }
html.light .payout-method-btn.active { background: rgba(99,102,241,0.07); border-color: rgba(99,102,241,0.25); }
html.light .btn-settings-save { color: #fff; }
html.light .my-thread-row:hover { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }

@media (max-width: 960px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .profile-sidebar {
    position: static;
    border-radius: 18px;
  }
  .profile-user-card {
    padding: 20px 22px;
  }
  .profile-avatar { width: 72px; height: 72px; font-size: 1.4rem; }
  .profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 10px 12px;
  }
  .profile-nav-btn { flex: 1; justify-content: center; min-width: 110px; }
  .profile-nav-divider { display: none; }
}

@media (max-width: 600px) {
  .aff-stats-row { grid-template-columns: 1fr; }
  .my-plugins-grid { grid-template-columns: 1fr; }
  .aff-code-row, .aff-link-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .aff-code-box, .aff-payout-form { overflow-x: auto; }
  .aff-table { min-width: 400px; }
  .aff-apply-box { padding: 16px; }
  .profile-wrap { padding: 20px 0 60px; }
  .order-row { flex-wrap: wrap; gap: 8px; }
  .order-download { flex: 1; text-align: center; }
}
@media (max-width: 480px) {
  .profile-nav-btn { min-width: 90px; font-size: 0.78rem; padding: 7px 10px; }
  .profile-username { font-size: 1.1rem; }
  .profile-actions { flex-direction: column; gap: 6px; }
  .profile-actions button, .profile-actions a { width: 100%; justify-content: center; text-align: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .aff-stats-row { grid-template-columns: repeat(2, 1fr); }
}
